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 522269 - Evince windows sometimes incorrectly unmaximized, caused by missing flag initialization
Evince windows sometimes incorrectly unmaximized, caused by missing flag init...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.13.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-03-13 17:09 UTC by Danny Baumann
Modified: 2008-08-04 01:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Fix proposal (1.13 KB, patch)
2008-03-13 17:10 UTC, Danny Baumann
committed Details | Review

Description Danny Baumann 2008-03-13 17:09:56 UTC
Please describe the problem:
Evince windows sometimes erroneously unmaximize when used under Compiz. A detailed description can be found under http://bugs.opencompositing.org/show_bug.cgi?id=521

Closer inspection showed that this is caused by gdk wrongly unmaximizing the window, caused by missing initialization of the have_horzmax and have_vertmax members of the GdkToplevelX11 structure.

Imagine the following situation:
- window is maximized,
- mapped afterwards and
- desktop is set

What now happens is
- gdk_event_translate (gdkevents-x11.c) receives the PropertyNotify for _NET_WM_STATE (maximization), but ignores it as it is pre-map
- gdk_event_translate receives the PropertyNotify for _NET_WM_DESKTOP
- it calls gdk_check_wm_desktop_changed
- this one calls do_net_wm_state_changes
- as in this function old_state includes GDK_WINDOW_STATE_MAXIMIZED, it uses the not-previously-set have_maxhorz and have_maxvert members to determine if the window is still maximized
- as those are initialized to FALSE, the window will be unmaximized.

The correct solution is to properly initialize those flags. I'll attach a patch that does that.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Danny Baumann 2008-03-13 17:10:51 UTC
Created attachment 107233 [details] [review]
Fix proposal

This patch completely cures the issue for me.
Comment 2 Tim Janik 2008-05-16 09:55:58 UTC
(In reply to comment #1)
> Created an attachment (id=107233) [edit]
> Fix proposal
> 
> This patch completely cures the issue for me.

Thanks a lot for the analysis and patch. Bratsche, tbf, please apply.
Comment 3 Cody Russell 2008-05-25 23:09:17 UTC
2008-05-25  Cody Russell  <bratsche@gnome.org>

        Bug 522269 - Evince windows sometimes incorrectly unmaximized,
        caused by missing flag initialization

        * gdk/x11/gdkwindow-x11.c (set_initial_hints): Initialize
        top-level private flags correctly.  Patch by Danny Baumann.
Comment 4 Tomas Rimkus 2008-08-04 01:48:58 UTC
Was this actually committed? I can still reproduce the bug with latest build from svn and I can't find any info about this bug in changelog.
Comment 5 Tomas Rimkus 2008-08-04 01:50:57 UTC
Sorry, thought that it was a bug in evince.