After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733577 - doesn't reuse window if too close to the bottom or top of the screen
doesn't reuse window if too close to the bottom or top of the screen
Status: RESOLVED DUPLICATE of bug 730414
Product: gedit
Classification: Applications
Component: general
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 745469 747939 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-07-22 19:30 UTC by Matthew Gabeler-Lee
Modified: 2015-06-12 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Gabeler-Lee 2014-07-22 19:30:37 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.
Comment 1 Sébastien Wilmet 2015-03-09 13:04:01 UTC
*** Bug 745469 has been marked as a duplicate of this bug. ***
Comment 2 Simon Sapin 2015-04-18 08:49:38 UTC
*** Bug 747939 has been marked as a duplicate of this bug. ***
Comment 3 Simon Sapin 2015-04-18 08:52:11 UTC
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.
Comment 4 Sébastien Wilmet 2015-06-12 13:40:00 UTC
See also bug #730414, it's maybe the same bug.
Comment 5 Sébastien Wilmet 2015-06-12 13:52:06 UTC

*** This bug has been marked as a duplicate of bug 730414 ***