GNOME Bugzilla – Bug 783938
applet: Always center dialogs on the screen
Last modified: 2017-07-03 09:31:59 UTC
Ubuntu has been carrying this patch for about 5 years. https://launchpad.net/bugs/1043934
Created attachment 354010 [details] [review] applet: Always center dialogs on the screen
patch looks good to me
hm, https://developer.gnome.org/gtk3/3.4/gtk3-Standard-Enumerations.html says: Note that using GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. It won't necessarily work well with all window managers or on all windowing systems.
Mathieu, do you want to comment on Thomas' question? https://developer.gnome.org/gtk3/stable/GtkWindow.html#GtkWindowPosition
I'm not aware of any issues from this. It's been a long while, I suspect at least part of it was copy-pasta from other bits of code where centering was already being done. I'm usually not very original when I write patches ;) I don't follow the changes in that doc, but I would suspect this warning wasn't there at the time. In any case, GTK_WIN_POS_CENTER could be used instead, but I would consider "not properly centering on all window managers, etc etc" to be a bug in the window managers that don't support it. The intent in this patch is to make sure things look pretty and consistent. This is better achieved when a window is always properly centered regarless of its sizing at the time (which can change due to string lengths, etc.) rather than just created centered and then finished with a possibly slightly different position off-center. From my quick re-reading of the comments in gtk+ directly, it looks to me like this usage is safe in this context, but I'm no GTK wizard. AFAIK the issue is mostly because in some usages, setting CENTER_ALWAYS would cause things to loop and fight the user trying to resize a window.
Looks all right to me.
merged to master: https://git.gnome.org/browse/network-manager-applet/commit/?id=fff8de7a8afa69203d096d769d29ac57dc318955 Thanks