--- a/gedit/gedit-app.c 2016-09-20 12:06:27.000000000 +0200 +++ b/gedit/gedit-app.c 2016-09-20 12:11:09.196007270 +0200 @@ -324,6 +324,7 @@ gint sc_width, sc_height; gint x, y, width, height; gint vp_x, vp_y; + gint window_center_x, window_center_y; /* Check for screen and display match */ display = gdk_screen_get_display (screen); @@ -353,16 +354,16 @@ width = gdk_window_get_width (gdkwindow); height = gdk_window_get_height (gdkwindow); gedit_utils_get_current_viewport (screen, &vp_x, &vp_y); - x += vp_x; - y += vp_y; + window_center_x = x + vp_x + width * .5; + window_center_y = y + vp_y + height * .5; sc_width = gdk_screen_get_width (screen); sc_height = gdk_screen_get_height (screen); - - return x + width * .25 >= viewport_x && - x + width * .75 <= viewport_x + sc_width && - y >= viewport_y && - y + height <= viewport_y + sc_height; + /* use window center so any symmetrical shadow additions can be ignored*/ + return window_center_x >= viewport_x && + window_center_x <= viewport_x + sc_width && + window_center_y >= viewport_y && + window_center_y <= viewport_y + sc_height; }