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 765161 - on win32 maximized window position wrong when windows toolbar is on left side
on win32 maximized window position wrong when windows toolbar is on left side
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
3.20.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-16 23:24 UTC by theadib
Modified: 2017-02-11 20:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot explaining the problem (506.35 KB, image/png)
2016-04-16 23:24 UTC, theadib
  Details
gtk-demo-application_maximize_minimize_win7aero.log (79.82 KB, text/plain)
2017-01-26 12:16 UTC, Andrew Chadwick
  Details
gtk-demo-application_maximize_minimize_win7basic.log (57.83 KB, text/plain)
2017-01-26 12:17 UTC, Andrew Chadwick
  Details
GDK W32: Different maximized window position for non-CSD windows (2.46 KB, patch)
2017-01-26 17:46 UTC, LRN
committed Details | Review

Description theadib 2016-04-16 23:24:19 UTC
Created attachment 326175 [details]
screenshot explaining the problem

I tested the geany win32 nightly application on my windows7
geany team explained this is compiled against latest gtk 3.20.

I have toolbar permanently on the left desktop side in order to spare vertical space.

http://download.geany.org/snapshots/geany-1.28nightly20160410_setup.exe

when I maximize the application window then the window top-left position is off.

There is a gap to the supposed-to-be position. It looks the shift is the same distance as the toolbar wide is.

see the screenshot for example

regards, Adib.
--
here a list of files in bin directory
ctags.exe
geany.exe
gpg2.exe
gpgconf.exe
gpgme-tool.exe
gpgme-w32spawn.exe
grep.exe
libasprintf-0.dll
libassuan-0.dll
libatk-1.0-0.dll
libatomic-1.dll
libbz2-1.dll
libcairo-2.dll
libcairo-gobject-2.dll
libcairo-script-interpreter-2.dll
libcharset-1.dll
libctpl-2.dll
libcurl-4.dll
libdbus-1-3.dll
libdbus-glib-1-2.dll
libeay32.dll
libenchant.dll
libepoxy-0.dll
libexpat-1.dll
libexslt-0.dll
libffi-6.dll
libfontconfig-1.dll
libfreetype-6.dll
libgailutil-3-0.dll
libgcc_s_dw2-1.dll
libgcrypt-20.dll
libgdk-3-0.dll
libgdk_pixbuf-2.0-0.dll
libgeany-0.dll
libgeoclue-0.dll
libgettextlib-0-19-7.dll
libgettextpo-0.dll
libgettextsrc-0-19-7.dll
libgif-7.dll
libgio-2.0-0.dll
libgit2.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgmp-10.dll
libgmpxx-4.dll
libgnutls-30.dll
libgnutlsxx-28.dll
libgobject-2.0-0.dll
libgomp-1.dll
libgomp-plugin-host_nonshm-1.dll
libgpg-error-0.dll
libgpgme-11.dll
libgstallocators-1.0-0.dll
libgstapp-1.0-0.dll
libgstaudio-1.0-0.dll
libgstbase-1.0-0.dll
libgstcheck-1.0-0.dll
libgstcontroller-1.0-0.dll
libgstfft-1.0-0.dll
libgstnet-1.0-0.dll
libgstpbutils-1.0-0.dll
libgstreamer-1.0-0.dll
libgstriff-1.0-0.dll
libgstrtp-1.0-0.dll
libgstrtsp-1.0-0.dll
libgstsdp-1.0-0.dll
libgsttag-1.0-0.dll
libgstvideo-1.0-0.dll
libgthread-2.0-0.dll
libgtk-3-0.dll
libgtkreftestprivate-0.dll
libgtkspell-0.dll
libharfbuzz-0.dll
libharfbuzz-gobject-0.dll
libharfbuzz-icu-0.dll
libhistory6.dll
libhogweed-4-1.dll
libhttp_parser-2.dll
libhunspell-1.3-0.dll
libiconv-2.dll
libicudt56.dll
libicuin56.dll
libicuio56.dll
libicule56.dll
libiculx56.dll
libicutest56.dll
libicutu56.dll
libicuuc56.dll
libidn-11.dll
libintl-8.dll
libjavascriptcoregtk-3.0-0.dll
libjpeg-8.dll
liblzma-5.dll
libminizip-1.dll
libnettle-6-1.dll
libogg-0.dll
liborc-0.4-0.dll
liborc-test-0.4-0.dll
libp11-kit-0.dll
libpango-1.0-0.dll
libpangocairo-1.0-0.dll
libpangoft2-1.0-0.dll
libpangowin32-1.0-0.dll
libpcre-1.dll
libpcre16-0.dll
libpcre32-0.dll
libpcrecpp-0.dll
libpcreposix-0.dll
libpixman-1-0.dll
libpng16-16.dll
libquadmath-0.dll
libreadline6.dll
librtmp-1.dll
libsoup-2.4-1.dll
libsoup-gnome-2.4-1.dll
libsqlite3-0.dll
libssh2-1.dll
libssp-0.dll
libstdc++-6.dll
libsystre-0.dll
libtasn1-6.dll
libtermcap-0.dll
libtheora-0.dll
libtheoradec-1.dll
libtheoraenc-1.dll
libtiff-5.dll
libtiffxx-5.dll
libtre-5.dll
libturbojpeg-0.dll
libvorbis-0.dll
libvorbisenc-2.dll
libvorbisfile-3.dll
libvorbisidec-1.dll
libvtv-0.dll
libvtv_stubs-0.dll
libwebkitgtk-3.0-0.dll
libwebp-6.dll
libwebpdecoder-2.dll
libwebpdemux-2.dll
libwebpmux-2.dll
libwinpthread-1.dll
libxml2-2.dll
libxslt-1.dll
lua51.dll
sort.exe
ssleay32.dll
zlib1.dll
Comment 1 LRN 2016-04-17 12:07:48 UTC
I cannot reproduce this with non-geany applications (gtk3-demo) and gtk-3.20.0.

I also cannot reproduce this with geany-1.27 (which i've just built myself) and gtk-3.20.0, gtk-3.20.2 or gtk-3.20.3.

The only thing left to check is to build geany from git and see if it works. I'm not sure whether that would solve anything - i've looked at geany git log, and ay first glance it didn't have any window-related or UI-related changes since 1.27.0.

I've also tried disabling Desktop Composition (seeing how you have it disabled), that didn't change anything.

I'd ask you to run "geany &>geany.log" with GDK_DEBUG environment variable set to "EVENTS,MISC" and letting me look at the log (make sure geany window is not maximized, close geany, run with stdout and stderr redirecting into a log file, maximize geany window, then close it; event log tends to be extremely verbose, so try to avoid unnecessary activity).

Also, see if geany devs can reproduce it with non-geany applications (you don't have any other GTK applications to try; geany devs do), and maybe different gtk versions (if they have gtk-3.19.x builds, trying them out will be almost as good as bisecting).
Comment 2 Andrew Chadwick 2017-01-26 12:06:10 UTC
Confirmed downstream in MyPaint land: <https://github.com/mypaint/mypaint/issues/770>. It appears that this is only reproducible when *not* using the special GTK3 window surrounds as of GTK 3.22.7. That happens when using themes other than the Windows 7 one in Aero mode (e.g. Classic or High Contrast, or Windows 7 Basic)

* I can't reproduce this in Windows 7 Enterprise 64-bit with Aero bells and whistles when using the default Windows 7 theme. The maximize button operates correctly in both MyPaint and GTK3-Demo, regardless of whether the taskbar is at the bottom or the top of the screen.

* I tried in the Windows 7 Basic theme, and it's reproducible in mypaint and gtk3-demo-application.exe on the MSYS2 command line. Both of these use "standard" window surrounds, i.e. not GtkHeaderBar. It is NOT reproducable with gtk3-demo.exe, but that used GtkHeaderBar.

* Looks like this does not present with Aero effects turned on when using the Windows 7 theme. In this case, GTK apps display difefrent window surrounds to the ones above, which resemble the ones used on the GNOME desktop. The position bug is absent with these.
Comment 3 Andrew Chadwick 2017-01-26 12:16:00 UTC
Created attachment 344315 [details]
gtk-demo-application_maximize_minimize_win7aero.log

Windows 7 theme *with Aero effects* with the taskbar at the top. Bug is *not* evident. Log prepared with:

  $ GDK_DEBUG=EVENTS,MISC gtk3-demo-application.exe 2>&1 >/tmp/gtk-demo-application_maximize_minimize_win7aero.log

on the MSYS2 "MINGW64" command line using stock MSYS2 GTK 3.22.7.
Comment 4 Andrew Chadwick 2017-01-26 12:17:21 UTC
Created attachment 344317 [details]
gtk-demo-application_maximize_minimize_win7basic.log

Windows 7 theme *without* Aero effects with the taskbar at the top. Bug *is* evident. Log prepared with:

  $ GDK_DEBUG=EVENTS,MISC gtk3-demo-application.exe 2>&1 >/tmp/gtk-demo-application_maximize_minimize_win7basic.log

on the MSYS2 "MINGW64" command line using stock MSYS2 GTK 3.22.7.
Comment 5 Andrew Chadwick 2017-01-26 12:19:30 UTC
I should remark that the logs actually capture [start, maximize, unmaximize, close]. Not "minimize", sorry.
Comment 6 LRN 2017-01-26 17:46:39 UTC
Created attachment 344339 [details] [review]
GDK W32: Different maximized window position for non-CSD windows

It seems that WM interprets the same MINMAXINFO contents differently
depending on which styles the window has.

This patch does fix the issue for me on a Windows 7 VM.
Comment 7 eclipse11295 2017-01-26 19:52:54 UTC
Hi, KirshD from the MyPaint bug. It looks like the gap is caused by the "Desktop Window Manager" either being disabled or left passive. When the DWM is passive (classic windows, or no desktop composition") it doesn't eat the GPU for it's own fanciness, but also doesn't handle programs dependant on it properly.

This is mostly a problem for Windows 7 users as the DWM isn't required for 7 to function but is supposedly an essential process for Windows 8 and above, and disabling it can actually cause problems in those.
Comment 8 eclipse11295 2017-01-26 19:55:09 UTC
Oop, that also works. ^_^;
Comment 9 LRN 2017-02-10 15:24:10 UTC
I't been some time since i've attached a patch to fix this issue. Can anyone please confirm that it's a fix? I understand that the but is a few months old and the original submitter isn't paying attention, but since this bug is also reported against MyPaint, i had hopes that *someone* would test the patch.
Comment 10 Andrew Chadwick 2017-02-10 18:06:48 UTC
Review of attachment 344339 [details] [review]:

Looks good to me. Patch in attachment 344339 [details] [review] builds cleanly against 8f01d6c5f4 (git stable branch, 3.22.7 + 46 revisions).

I can confirm that it fixes the issue in Windows 7 64-bit.

Binary build for MSYS2 MINGW64 current, good for 2 months for anyone else willing to test:

    https://filebin.net/spha5ipavlzmaq1l

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

04ec9975d5a471f3612490b8a9adb67909a5e0bfc242a87e3c5574cd2919f4b4 *mingw-w64-x86_64-gtk3-git-3.22.7.46.g8f01d6c5f4.344339-1-any.pkg.tar.xz
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwCOR9Luk8OKyfGv/bjA34Sh4spkFAlieAJ0ACgkQbjA34Sh4
splNEQ/+K1JwECZsT2BH7PeFEGjRMFO3a/9Tt9WaQBIh1eHJxVjsV34jyV4L9KTN
NdwuL1o7ShHlq0zuFreZJ5DMYWRfG2poRigO05uUBHcihw/RNQFKwDOoKsCyC5qV
3ne8VnMVZ5vVjkionqBrGCQ7x6cXVZxoOzYXkaUhzmSalBLDmVRDI8LjmPTLPwh8
Bbx7e+2wZbqKPGO2FxXqKFPc57incPlBva6OPcETykBxVc0Obc8ee2qwckD+TLPH
yu0olPFuhglFHWy6ElmEpt1dKqVwvjp1X5aOMWkqBm8KpV0WsFG7nYgzb4BEtDFi
YJTZYb9ysJziRcSZyOUp9pSt2A5RXRMwkSb51tCjLE314xWNQJx2hgaLOrsDQ10J
/2dhQ6b5VvC9cImVpxQ12xIrAk8wA7EFhgdeFqW59ngJMFbEBiL8KYFvXmt4AONH
HkkxwWaRdhKlvmfM2RtEUG//JF0WZ/245LW+VppINxMrzA0ug3F/4Y8nADv/IBJ0
ZqxPlAj/d6ymqDsK7yiSZgR6CqQjIc27s5hsxf0OgGK46dfK3+ZutcextEmqFEmC
vAADBzkJQ2sfLjnZNFYyWE2/iVG89XVAhgeDCF7TO4enCsd60eP6M4XRno6jvd8h
qxstoT1W+ph4Robl9o2fCSw6LgHs3Pm6X+9gxiUvUeso448NcCU=
=CiLm
-----END PGP SIGNATURE-----
Comment 11 Andrew Chadwick 2017-02-10 18:06:51 UTC
Review of attachment 344339 [details] [review]:

Looks good to me. Patch in attachment 344339 [details] [review] builds cleanly against 8f01d6c5f4 (git stable branch, 3.22.7 + 46 revisions).

I can confirm that it fixes the issue in Windows 7 64-bit.

Binary build for MSYS2 MINGW64 current, good for 2 months for anyone else willing to test:

    https://filebin.net/spha5ipavlzmaq1l

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

04ec9975d5a471f3612490b8a9adb67909a5e0bfc242a87e3c5574cd2919f4b4 *mingw-w64-x86_64-gtk3-git-3.22.7.46.g8f01d6c5f4.344339-1-any.pkg.tar.xz
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEwCOR9Luk8OKyfGv/bjA34Sh4spkFAlieAJ0ACgkQbjA34Sh4
splNEQ/+K1JwECZsT2BH7PeFEGjRMFO3a/9Tt9WaQBIh1eHJxVjsV34jyV4L9KTN
NdwuL1o7ShHlq0zuFreZJ5DMYWRfG2poRigO05uUBHcihw/RNQFKwDOoKsCyC5qV
3ne8VnMVZ5vVjkionqBrGCQ7x6cXVZxoOzYXkaUhzmSalBLDmVRDI8LjmPTLPwh8
Bbx7e+2wZbqKPGO2FxXqKFPc57incPlBva6OPcETykBxVc0Obc8ee2qwckD+TLPH
yu0olPFuhglFHWy6ElmEpt1dKqVwvjp1X5aOMWkqBm8KpV0WsFG7nYgzb4BEtDFi
YJTZYb9ysJziRcSZyOUp9pSt2A5RXRMwkSb51tCjLE314xWNQJx2hgaLOrsDQ10J
/2dhQ6b5VvC9cImVpxQ12xIrAk8wA7EFhgdeFqW59ngJMFbEBiL8KYFvXmt4AONH
HkkxwWaRdhKlvmfM2RtEUG//JF0WZ/245LW+VppINxMrzA0ug3F/4Y8nADv/IBJ0
ZqxPlAj/d6ymqDsK7yiSZgR6CqQjIc27s5hsxf0OgGK46dfK3+ZutcextEmqFEmC
vAADBzkJQ2sfLjnZNFYyWE2/iVG89XVAhgeDCF7TO4enCsd60eP6M4XRno6jvd8h
qxstoT1W+ph4Robl9o2fCSw6LgHs3Pm6X+9gxiUvUeso448NcCU=
=CiLm
-----END PGP SIGNATURE-----
Comment 12 LRN 2017-02-10 18:34:39 UTC
attachment 344339 [details] [review] pushed into branch gtk-3-22 as commit dca4f1e715610a3f42826fb7ba1cdc3bc0df319c