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 764996 - GDK: Incorrect window size when creating window with position specified
GDK: Incorrect window size when creating window with position specified
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
3.0.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-13 13:43 UTC by Jeremy Tan
Modified: 2016-09-02 05:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program exhibiting issue (1.49 KB, text/plain)
2016-04-13 13:43 UTC, Jeremy Tan
  Details
Patch to fix the issue (1.08 KB, patch)
2016-04-13 13:45 UTC, Jeremy Tan
accepted-commit_now Details | Review
GDK W32: Fix bounding rect calculation on window creation (1.07 KB, patch)
2016-09-02 05:03 UTC, LRN
committed Details | Review

Description Jeremy Tan 2016-04-13 13:43:01 UTC
Created attachment 325862 [details]
Sample program exhibiting issue

This bug was introduced with 1d838f586c574af7f05c618a337f8d34a58d9125.
https://github.com/GNOME/gtk/blame/4dcd33f2d5f1bcabc8b5195a85d4f92054506e1e/gdk/win32/gdkwindow-win32.c#L820

When creating a new window with a specific position, the window width and height is incorrectly set due to an error in how the bounding rect is calculated.

The bug appears when creating a window with the GDK_WA_X and/or GDK_WA_Y attribute flag and a non-zero x/y position is provided.
Comment 1 Jeremy Tan 2016-04-13 13:45:50 UTC
Created attachment 325863 [details] [review]
Patch to fix the issue
Comment 2 LRN 2016-04-13 14:04:27 UTC
Review of attachment 325863 [details] [review]:

Patch is obviously correct.
Comment 3 LRN 2016-04-13 14:07:31 UTC
Do you need someone to push it into git master, or you can do it yourself?
Comment 4 Jeremy Tan 2016-04-13 14:11:39 UTC
As far as I know, I don't have git access, so if you could push it that would be great!
Comment 5 LRN 2016-04-13 14:18:28 UTC
Attachment 325863 [details] pushed as commit 260d521dd7f2cdfb9a88c32280120fabfb3a27d0.
Comment 6 Jeremy Tan 2016-09-02 04:53:28 UTC
This is also present in GTK2 (see here: https://github.com/GNOME/gtk/blob/gtk-2-24/gdk/win32/gdkwindow-win32.c#L686)

Is it possible to get this fix backported?
Comment 7 LRN 2016-09-02 05:03:46 UTC
Created attachment 334617 [details] [review]
GDK W32: Fix bounding rect calculation on window creation

Does this patch fix the issue for you in gtk+-2.24.x?
Comment 8 Jeremy Tan 2016-09-02 05:30:06 UTC
I've just checked, and yes that patch fixes it for gtk+-2.24.x

Thanks!
Comment 9 LRN 2016-09-02 05:38:48 UTC
Comment on attachment 334617 [details] [review]
GDK W32: Fix bounding rect calculation on window creation

Attachment 334617 [details] pushed as a4af2dd - GDK W32: Fix bounding rect calculation on window creation