=== modified file 'src/defaults.c' --- src/defaults.c 2009-09-29 09:52:49 +0000 +++ src/defaults.c 2009-10-09 10:31:12 +0000 @@ -2383,6 +2383,9 @@ gboolean is_panel = FALSE; GdkRectangle frame; int result; + GdkScreen *screen; + gint monitor; + GdkRectangle monitor_rect; if (win == NULL) return FALSE; @@ -2405,7 +2408,12 @@ /* select only the top panel */ gdk_window_get_frame_extents (win, &frame); - if (frame.x != 0 || frame.y != 0) + + screen = gdk_drawable_get_screen(win); + monitor = gdk_screen_get_monitor_at_window(screen, win); + gdk_screen_get_monitor_geometry(screen, monitor, &monitor_rect); + + if (frame.x != monitor_rect.x || frame.y != monitor_rect.y) goto failed; if (frame.width < frame.height) @@ -2527,7 +2535,7 @@ panel_monitor == monitor) { /* position the corner on the selected monitor */ - rect.y += panel_rect.y + panel_rect.height; + rect.y = panel_rect.y + panel_rect.height; } else if (! has_panel_window) { g_debug ("no panel detetected; using workarea fallback");