save the dock's class/name for future evil purposes!
also print names of windows being managed/unmanaged
This commit is contained in:
parent
2efed807b3
commit
f17b225daa
3 changed files with 24 additions and 4 deletions
|
@ -301,7 +301,7 @@ void client_manage(Window window)
|
||||||
|
|
||||||
dispatch_client(Event_Client_Mapped, self, 0, 0);
|
dispatch_client(Event_Client_Mapped, self, 0, 0);
|
||||||
|
|
||||||
g_message("Managed window 0x%lx", window);
|
g_message("Managed window 0x%lx (%s)", window, self->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_unmanage_all()
|
void client_unmanage_all()
|
||||||
|
@ -315,7 +315,7 @@ void client_unmanage(Client *self)
|
||||||
int j;
|
int j;
|
||||||
GSList *it;
|
GSList *it;
|
||||||
|
|
||||||
g_message("Unmanaging window: %lx", self->window);
|
g_message("Unmanaging window: %lx (%s)", self->window, self->name);
|
||||||
|
|
||||||
dispatch_client(Event_Client_Destroy, self, 0, 0);
|
dispatch_client(Event_Client_Destroy, self, 0, 0);
|
||||||
g_assert(self != NULL);
|
g_assert(self != NULL);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "dock.h"
|
#include "dock.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
#include "prop.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "grab.h"
|
#include "grab.h"
|
||||||
#include "openbox.h"
|
#include "openbox.h"
|
||||||
|
@ -51,6 +52,7 @@ void dock_add(Window win, XWMHints *wmhints)
|
||||||
{
|
{
|
||||||
DockApp *app;
|
DockApp *app;
|
||||||
XWindowAttributes attrib;
|
XWindowAttributes attrib;
|
||||||
|
char **data;
|
||||||
|
|
||||||
app = g_new0(DockApp, 1);
|
app = g_new0(DockApp, 1);
|
||||||
app->obwin.type = Window_DockApp;
|
app->obwin.type = Window_DockApp;
|
||||||
|
@ -58,6 +60,18 @@ void dock_add(Window win, XWMHints *wmhints)
|
||||||
app->icon_win = (wmhints->flags & IconWindowHint) ?
|
app->icon_win = (wmhints->flags & IconWindowHint) ?
|
||||||
wmhints->icon_window : win;
|
wmhints->icon_window : win;
|
||||||
|
|
||||||
|
if (PROP_GETSS(app->win, wm_class, locale, &data)) {
|
||||||
|
if (data[0]) {
|
||||||
|
app->name = g_strdup(data[0]);
|
||||||
|
if (data[1])
|
||||||
|
app->class = g_strdup(data[1]);
|
||||||
|
}
|
||||||
|
g_strfreev(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (app->name == NULL) app->name = g_strdup("");
|
||||||
|
if (app->class == NULL) app->class = g_strdup("");
|
||||||
|
|
||||||
if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
|
if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) {
|
||||||
app->w = attrib.width;
|
app->w = attrib.width;
|
||||||
app->h = attrib.height;
|
app->h = attrib.height;
|
||||||
|
@ -98,7 +112,7 @@ void dock_add(Window win, XWMHints *wmhints)
|
||||||
|
|
||||||
g_hash_table_insert(window_map, &app->icon_win, app);
|
g_hash_table_insert(window_map, &app->icon_win, app);
|
||||||
|
|
||||||
g_message("Managed Dock App: 0x%lx", app->icon_win);
|
g_message("Managed Dock App: 0x%lx (%s)", app->icon_win, app->class);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dock_remove_all()
|
void dock_remove_all()
|
||||||
|
@ -123,8 +137,10 @@ void dock_remove(DockApp *app, gboolean reparent)
|
||||||
dock->dock_apps = g_list_remove(dock->dock_apps, app);
|
dock->dock_apps = g_list_remove(dock->dock_apps, app);
|
||||||
dock_configure();
|
dock_configure();
|
||||||
|
|
||||||
g_message("Unmanaged Dock App: 0x%lx", app->icon_win);
|
g_message("Unmanaged Dock App: 0x%lx (%s)", app->icon_win, app->class);
|
||||||
|
|
||||||
|
g_free(app->name);
|
||||||
|
g_free(app->class);
|
||||||
g_free(app);
|
g_free(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ typedef struct DockApp {
|
||||||
|
|
||||||
Window icon_win;
|
Window icon_win;
|
||||||
Window win;
|
Window win;
|
||||||
|
|
||||||
|
char *name;
|
||||||
|
char *class;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
int w;
|
int w;
|
||||||
|
|
Loading…
Reference in a new issue