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 705980 - Update Win32 code so that GTK+ will build and run
Update Win32 code so that GTK+ will build and run
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
unspecified
Other Windows
: Normal critical
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-14 10:56 UTC by Fan, Chun-wei
Modified: 2013-08-26 02:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updates tp the Win32 GDK backend and the Win32-specific part of GTK (6.67 KB, patch)
2013-08-14 10:58 UTC, Fan, Chun-wei
reviewed Details | Review
Updates to gdk/win32/gdkdevice-virtual.c (2.10 KB, patch)
2013-08-14 11:03 UTC, Fan, Chun-wei
reviewed Details | Review
Updates tp the Win32 GDK backend and the Win32-specific part of GTK [take ii] (7.14 KB, patch)
2013-08-21 13:59 UTC, Fan, Chun-wei
reviewed Details | Review

Description Fan, Chun-wei 2013-08-14 10:56:33 UTC
Hi,

Due to the works to handle scaled cursor images, the commit b2113b73 (gdk: Add gdk_cursor_new_from_surface) changed get_cursor_for_pixbuf() of GdkDisplayClass to et_cursor_for_surface(), which required an update to the various backends of GDK, which, as a result, broke the build of the Win32 GDK backend and some Win32-specific code in GTK.

I have did a bit of work to update the the code so that GTK/GDK will be able to be built and run on Windows, but probably would not yet cover the stuff needed for the scaled cursor images work, but it seems to me that the GTK test programs run at least as well as it did when before the work on handling scaled cursor images was committed.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2013-08-14 10:58:15 UTC
Created attachment 251605 [details] [review]
Updates tp the Win32 GDK backend and the Win32-specific part of GTK

This addresses the internal API changes in GDK due to "gdk: Add gdk_cursor_new_from_surface" in the Win32 GDK backend and Win32-specific code in GTK.
Comment 2 Fan, Chun-wei 2013-08-14 11:03:41 UTC
Created attachment 251606 [details] [review]
Updates to gdk/win32/gdkdevice-virtual.c

This also updates some prototypes and parameters of functions that were changed in gdk/win32/gdkdevice-virtual.c, and also addresses the GDK_IS_DEVICE critical message (bug 696756, courtesy of LE GARREC Vincent) issue when one uses GTK+-3.x on Windows.  This file has a commit of its own as it has DOS/Windows line endings, which needs to be committed using "git am --ignore-whitespace "(or
something like that).

With blessings, thanks for the time.
Comment 3 Fan, Chun-wei 2013-08-20 15:04:48 UTC
Ping... Would like to see GTK+ still working on Windows.

With blessings, thank you!
Comment 4 Emmanuele Bassi (:ebassi) 2013-08-21 11:38:23 UTC
Review of attachment 251605 [details] [review]:

::: gdk/win32/gdkcursor-win32.c
@@ +252,2 @@
 GdkPixbuf *
+gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon, gdouble *x_hot, gdouble *y_hot)

coding style: the arguments should go on separate lines.

@@ +457,3 @@
+  gint height = cairo_image_surface_get_height (surface);
+
+  pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, width, height);

these should really go below the argument checks.

the GDK_IS_PIXBUF check should be replaced by a surface != NULL check; then, if gdk_pixbuf_get_from_surface() returns NULL, there should be a critical error and the function should return NULL.

::: gdk/win32/gdkwin32misc.h
@@ +99,3 @@
 /* For internal GTK use only */
 GDK_AVAILABLE_IN_ALL
+GdkPixbuf    *gdk_win32_icon_to_pixbuf_libgtk_only (HICON hicon, gdouble *x_hot, gdouble *y_hot);

coding style: the arguments should be on separate lines.
Comment 5 Emmanuele Bassi (:ebassi) 2013-08-21 11:39:13 UTC
Review of attachment 251606 [details] [review]:

looks okay to me.
Comment 6 Fan, Chun-wei 2013-08-21 13:59:39 UTC
Created attachment 252558 [details] [review]
Updates tp the Win32 GDK backend and the Win32-specific part of GTK [take ii]

Hi,

Is this patch better?  Please correct me if I'm wrong, but I am still using GDK_IS_PIXBUF after the gdk_pixbuf_get_from_surface() call as IMHO GDK_IS_PIXBUF also checks whether pixbuf is NULL.

With blessings, thank you!
Comment 7 Fan, Chun-wei 2013-08-21 14:01:22 UTC
Review of attachment 251606 [details] [review]:

Hi,

Can this patch be committed, just to make sure?

With blessings, thank you!
Comment 8 Emmanuele Bassi (:ebassi) 2013-08-23 11:26:24 UTC
Review of attachment 252558 [details] [review]:

looks good to me
Comment 9 Fan, Chun-wei 2013-08-26 02:39:04 UTC
Hi,

I think I will go ahead to commit these patches as:
-I don't see any objections for these so far, IMHO
-The latest GTK+ 3.9.x needs these patches to build and run on Windows

Please feel free to reopen if these patches should be an issue.

I have pushed these patches on master as:
-Attachment 251606 [details]: bd596144
-Attachment 252558 [details]: 0e01f9cc

With blessings, thank you!