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 783938 - applet: Always center dialogs on the screen
applet: Always center dialogs on the screen
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-applet
git master
Other All
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-06-18 22:12 UTC by Jeremy Bicha
Modified: 2017-07-03 09:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
applet: Always center dialogs on the screen (2.66 KB, patch)
2017-06-18 22:12 UTC, Jeremy Bicha
none Details | Review

Description Jeremy Bicha 2017-06-18 22:12:35 UTC
Ubuntu has been carrying this patch for about 5 years.

https://launchpad.net/bugs/1043934
Comment 1 Jeremy Bicha 2017-06-18 22:12:38 UTC
Created attachment 354010 [details] [review]
applet: Always center dialogs on the screen
Comment 2 Thomas Haller 2017-06-19 09:04:03 UTC
patch looks good to me
Comment 3 Thomas Haller 2017-06-19 09:08:53 UTC
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.
Comment 4 Jeremy Bicha 2017-06-19 15:43:42 UTC
Mathieu, do you want to comment on Thomas' question?

https://developer.gnome.org/gtk3/stable/GtkWindow.html#GtkWindowPosition
Comment 5 Mathieu Trudel-Lapierre 2017-06-20 14:44:22 UTC
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.
Comment 6 Lubomir Rintel 2017-07-03 08:22:52 UTC
Looks all right to me.