GNOME Bugzilla – Bug 602289
gdk_spawn_on_screen(_with_pipes) uses gint for pid
Last modified: 2010-06-15 23:49:51 UTC
Instead it should use GPid I think, maybe something for the 2.90/3.0 overhaul?
True, but the only platform where GPid is not an int is Windows, and on Windows there is just one screen (in the X11/GDK sense, I don't mean "monitor") anyway. So it doesn't matter that much.
Bump.
Created attachment 162866 [details] [review] Use a GPid on gdk_spawn_on_screen[_with_pipes] instead a gint
Comment on attachment 162866 [details] [review] Use a GPid on gdk_spawn_on_screen[_with_pipes] instead a gint Patch will not even compile, since it has 'GInt' types in it...
Created attachment 162885 [details] [review] Use a GPid on gdk_spawn_on_screen[_with_pipes] instead a gint.v2 Sorry, here the correct patch
Looks fine to me.
Comment on attachment 162885 [details] [review] Use a GPid on gdk_spawn_on_screen[_with_pipes] instead a gint.v2 commit 71c501d895104d568061a4d0a55c883a9663eb89
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
The change is needed in gdkspawn.h as well ...
Mostly pointless bug, as gdk_spawn_on_screen() is quite Unix-specific anyway, and on Unix a pid is, afaik, always an int. Did you read the comment in front of the GPid typedef in glibconfig.h? It says: /* A GPid is an abstraction for a process "handle". It is *not* an * abstraction for a process identifier in general. GPid is used in * GLib only for descendant processes spawned with the g_spawn* * functions. On POSIX there is no "process handle" concept as such, * but on Windows a GPid is a handle to a process, a kind of pointer, * not a process identifier. */
Not sure who you are talking to Tor, and tbh, I don't care about this except for the fact that it breaks building on win32: gdkspawn-win32.c:30:1: error: conflicting types for 'gdk_spawn_on_screen' ../../gdk/gdkspawn.h:33:10: note: previous declaration of 'gdk_spawn_on_screen' was here gdkspawn-win32.c:54:1: error: conflicting types for 'gdk_spawn_on_screen_with_pipes' ../../gdk/gdkspawn.h:43:10: note: previous declaration of 'gdk_spawn_on_screen_with_pipes' was here So revert or change the header, I'm just letting people know this breaks things, and not interested in the artistic/whatever motivations.
@Martin: committed the fix in f62e000be492deb83f8544b29265f25d00eab934
I did not want to sound rude btw. - just wanted to clarify that I'm only reporting the issue that the commit caused for me, and did not want to give an opinion about the change.
@Martin: Sure, thanks for notifiyng