From ffb76025fa8463321fddaf65f4e436754f35cdd7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 11 May 2003 17:31:23 +0000 Subject: [PATCH] use the size of the icon window for slit apps, not the client window --- openbox/client.c | 2 +- openbox/slit.c | 11 ++++++++--- openbox/slit.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 29a20ad9..3389fdc6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -202,7 +202,7 @@ void client_manage(Window window) if ((wmhint = XGetWMHints(ob_display, window))) { if ((wmhint->flags & StateHint) && wmhint->initial_state == WithdrawnState) { - slit_add(window, wmhint, &attrib); + slit_add(window, wmhint); grab_server(FALSE); XFree(wmhint); return; diff --git a/openbox/slit.c b/openbox/slit.c index 45d14be2..7b39e227 100644 --- a/openbox/slit.c +++ b/openbox/slit.c @@ -86,10 +86,11 @@ void slit_shutdown() g_hash_table_destroy(slit_map); } -void slit_add(Window win, XWMHints *wmhints, XWindowAttributes *attrib) +void slit_add(Window win, XWMHints *wmhints) { Slit *s; SlitApp *app; + XWindowAttributes attrib; /* XXX pick a slit */ s = &slit[0]; @@ -100,8 +101,12 @@ void slit_add(Window win, XWMHints *wmhints, XWindowAttributes *attrib) app->icon_win = (wmhints->flags & IconWindowHint) ? wmhints->icon_window : win; - app->w = attrib->width; - app->h = attrib->height; + if (XGetWindowAttributes(ob_display, app->icon_win, &attrib)) { + app->w = attrib.width; + app->h = attrib.height; + } else { + app->w = app->h = 64; + } s->slit_apps = g_list_append(s->slit_apps, app); slit_configure(s); diff --git a/openbox/slit.h b/openbox/slit.h index 0d4ffa93..3dd3d3db 100644 --- a/openbox/slit.h +++ b/openbox/slit.h @@ -40,7 +40,7 @@ void slit_shutdown(); void slit_configure_all(); void slit_hide(Slit *self, gboolean hide); -void slit_add(Window win, XWMHints *wmhints, XWindowAttributes *attrib); +void slit_add(Window win, XWMHints *wmhints); void slit_remove_all(); void slit_remove(SlitApp *app, gboolean reparent); -- 2.44.0