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 764730 - win32: GtkDialog wrong position to parent using GTK_DIALOG_USE_HEADER_BAR
win32: GtkDialog wrong position to parent using GTK_DIALOG_USE_HEADER_BAR
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-07 14:06 UTC by juloml
Modified: 2016-04-12 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
issue reproducer (2.11 KB, text/plain)
2016-04-08 07:57 UTC, juloml
Details

Description juloml 2016-04-07 14:06:50 UTC
Since GTK 3.20 GtkDialog is shown in wrong position to parent window if using GTK_DIALOG_USE_HEADER_BAR flag. Same code did work correctly for me with GTK 3.18 of same platform - dialog was centered on parent window. In GTK 3.20 CSD was enabled on MS windows platform.

Found nothing special with my code, added gtk_window_set_position for sure:

dialog  = gtk_dialog_new_with_buttons (
	 _("some text"),
	 GTK_WINDOW(parent),    GtkDialogFlags(GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_USE_HEADER_BAR),
	 _("_OK"), GTK_RESPONSE_OK, _("_Cancel"), GTK_RESPONSE_CANCEL,
	 NULL);
     
  gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(parent));
  gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
...

Details on setup if relevant:
- Using GTK 3.20.2 build, msys2 environment
- multiple monitor configuration
Comment 1 Ignacio Casal Quinteiro (nacho) 2016-04-07 14:13:56 UTC
Thanks for taking the time to report this.
This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 764722 ***
Comment 2 LRN 2016-04-07 14:19:10 UTC
What is a "wrong" position, and what is a "right" one?
Does it happen in non-multimonitor setup?
It will be easier to reproduce (and fix) if there's a C program that reproduces it (doesn't have to be minimal - as long as it's easy to build; even better if gtk3-demo or gtk3-widget-factory or gtksrc/tests/testgtk have functionality that exposes this bug).

If you build your own gtk, see if https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-20&id=f233609c9328d03222a19e37db78caedb8b7e9c5 fixes this (it fixed a bug that made tooltops appear in top-left corner of the virtual screen).

Nacho, the description is too vague to be sure that this is indeed a duplicate of bug 764722.
Comment 3 juloml 2016-04-07 14:28:35 UTC
Happens with single display too.

Dialog window for described case is positioned always if close to top left display corner (circa on position 24,24).

If I remove GTK_DIALOG_USE_HEADER_BAR flag dialog window position is correct again, centered on parent.
Comment 4 juloml 2016-04-08 07:57:48 UTC
Created attachment 325572 [details]
issue reproducer

reproducer attached, built with 
gcc reproducer.c `pkg-config --cflags --libs gtk+-3.0 gmodule-2.0` -m64
Comment 5 LRN 2016-04-08 11:34:36 UTC
This bug does not seem to be a duplicate of bug 764722. Applying or not applying a fix for that bug to 3.20.2 does not the difference, *this* bug still happens.

However, running the testcase against gtk+-3.0 git master (a93e477, to be specific) does not reproduce the bug anymore.
Comment 6 LRN 2016-04-09 12:40:41 UTC
tried a few tarballs

The bug appeared between 3.20.1 and 3.20.2, so it'll be easy to find now.
Comment 7 LRN 2016-04-09 13:39:13 UTC
This bug was introduced by commit ba91d7d3a92d58dfe8058d31854c135353b87e01 and fixed in master (by commit a91237d65e91cf7dc1581fabf9245ca89e988088, i think).
Comment 8 juloml 2016-04-12 11:24:48 UTC
Reproducer works correctly using GTK 3.20.3.

Not using gtk in MS windows frequently, but looks to me good job was done in past two gtk3 releases. Thanks to all involved.