GNOME Bugzilla – Bug 733577
doesn't reuse window if too close to the bottom or top of the screen
Last modified: 2015-06-12 13:52:06 UTC
(This is effectively a follow-up to Bug 559280) If an existing gedit window is too close to the bottom or top of the screen, it will not be considered as on the viewport, and a new window will be used, instead of reusing the existing window. This would be annoying enough for windows that are moved to be just a single pixel below the bottom or above the top of the screen, but it is made worse by the way embedded decorations in Gnome 3.12 seem to be handled. In this case, the window width seems to extend about 16 pixels(?) beyond the visible window borders, meaning that a window that visually is 100% within the viewport is not considered as being so. As a side effect of this, a gedit window that is maximized, or vertically maximized, will never be reused (effectively thus a regression of Bug 559280). The relevant code looks to be in gedit-app.c, the end of the is_in_viewport function: return x + width * .25 >= viewport_x && x + width * .75 <= viewport_x + sc_width && y >= viewport_y && y + height <= viewport_y + sc_height; I notice that a tolerance has been applied to the width, effectively saying "the middle 50% of the window must be on the screen". Applying the same logic to the height would make sense (to me) and by and large fix this. A total fix, I think, would subtract the "overflow" area from these calculations and only use the visible portion of the gedit window. I haven't tested, but from browsing the git web interface, this same logic is present on the master branch too.
*** Bug 745469 has been marked as a duplicate of this bug. ***
*** Bug 747939 has been marked as a duplicate of this bug. ***
Since upgrading to GNOME 3.16 I see this issue with "half maximized" (Super + left/right arrow) gedit windows, but interestingly not with fully maximized windows. (See bug 747939.) I never saw this issue in 3.14 or earlier.
See also bug #730414, it's maybe the same bug.
*** This bug has been marked as a duplicate of bug 730414 ***