From 1bf4f55fd483b4db92168aaf54dcb82924a2f99a Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Fri, 9 Jan 2015 00:09:43 +0100 Subject: [PATCH] Simplify check for shaded windows of e01b5aba182 --- panel/panel-window.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/panel/panel-window.c b/panel/panel-window.c index c9712ab..8f30e41 100644 --- a/panel/panel-window.c +++ b/panel/panel-window.c @@ -31,7 +31,6 @@ #ifdef GDK_WINDOWING_X11 #include #include -#include #endif #include @@ -2178,29 +2177,17 @@ panel_window_active_window_geometry_changed (WnckWindow *active_window, &window_area.width, &window_area.height); /* if a window is shaded, check the height of the window's - * decoration as exposed through the _NET_FRAME_EXTENTS application - * window property */ + * decoration */ if (wnck_window_is_shaded (active_window)) { - Display *display; - Atom real_type; - int real_format; - unsigned long items_read, items_left; - guint32 *data; - - display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); - if (XGetWindowProperty (display, wnck_window_get_xid (active_window), - XInternAtom(display, "_NET_FRAME_EXTENTS", True), - 0, 4, FALSE, AnyPropertyType, - &real_type, &real_format, &items_read, &items_left, - (unsigned char **) &data) == Success - && (items_read >= 4)) - window_area.height = data[2] + data[3]; - - if (data) - { - XFree (data); - } + GdkRectangle window_content; + + wnck_window_get_client_window_geometry (active_window, + &window_content.x, + &window_content.y, + &window_content.width, + &window_content.height); + window_area.height = window_area.height - window_content.height; } /* obtain position and dimension from the panel */ -- 1.9.1