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 786427 - [PATCH] about_dialog: set parent to a terminal window
[PATCH] about_dialog: set parent to a terminal window
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-17 15:38 UTC by Xiang Fan
Modified: 2017-09-04 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-about_dialog-set-parent-to-a-terminal-window.patch (1.27 KB, patch)
2017-08-17 15:38 UTC, Xiang Fan
none Details | Review
0001-util-assign-about-dialog-to-the-application.patch (908 bytes, patch)
2017-08-18 10:20 UTC, Xiang Fan
none Details | Review
0001-util-assign-about-dialog-to-the-application.patch (3.05 KB, patch)
2017-08-19 00:27 UTC, Xiang Fan
none Details | Review

Description Xiang Fan 2017-08-17 15:38:35 UTC
Created attachment 357818 [details] [review]
0001-about_dialog-set-parent-to-a-terminal-window.patch

This helps to show the app name and icon for about dialogs in Wayland.
Comment 1 Christian Persch 2017-08-17 16:56:13 UTC
Duplicate of bug 786026 ? 

In any case, not using a transient parent is done on purpose, so you'll need to find a different fix.
Comment 2 Xiang Fan 2017-08-18 10:20:46 UTC
Created attachment 357876 [details] [review]
0001-util-assign-about-dialog-to-the-application.patch

(In reply to Christian Persch from comment #1)
> Duplicate of bug 786026 ? 
> 
> In any case, not using a transient parent is done on purpose, so you'll need
> to find a different fix.

How about this?
Comment 3 Christian Persch 2017-08-18 10:34:02 UTC
That's a better idea :-)  

How about making that change in gtk+ (gtk+/gtk/gtkaboutdialog.c:gtk_show_about_dialog()), so as to fix every programme in one step, not just gnome-terminal?
Comment 4 Xiang Fan 2017-08-18 14:47:22 UTC
(In reply to Christian Persch from comment #3)
> That's a better idea :-)  
> 
> How about making that change in gtk+
> (gtk+/gtk/gtkaboutdialog.c:gtk_show_about_dialog()), so as to fix every
> programme in one step, not just gnome-terminal?

I would like to, but for programs that don't use GApplication, or have multiple applications, it's too hard to determine which app ID to use. Also, setting the application keeps it always alive because GTK+ reuses about dialogs, which may not be ideal for some programs.
Comment 5 Christian Persch 2017-08-18 15:06:49 UTC
Oh, so setting the "application" property holds the app, making this a not-solution for gnome-terminal too.

Why exactly does gnome-shell not get the right title and/or icon for the about dialogue?
Comment 6 Xiang Fan 2017-08-18 16:39:34 UTC
(In reply to Christian Persch from comment #5)
> Oh, so setting the "application" property holds the app, making this a
> not-solution for gnome-terminal too.

For clarity, it only holds the gnome-terminal-server and there's no visual impact.

> Why exactly does gnome-shell not get the right title and/or icon for the
> about dialogue?

To my (limited) knowledge, a window can't be associated with the application in Wayland just because it's started through a .desktop file. It has to set the ID to or match the process name with the filename of .desktop.

https://git.gnome.org/browse/gnome-shell/tree/src/shell-window-tracker.c#n424 seems to handle the condition when neither matched, but it fails for Wayland.
Comment 7 Christian Persch 2017-08-18 17:08:03 UTC
(In reply to Xiang Fan from comment #6)
> For clarity, it only holds the gnome-terminal-server and there's no visual
> impact.

That's still bad.

However, the fix is simple: instead of using gtk_show_about_dialog(), just construct the dialogue yourself with g_object_new(GTK_TYPE_ABOUT_DIALOG, ....) and then gtk_window_present().
Comment 8 Xiang Fan 2017-08-19 00:27:19 UTC
Created attachment 357938 [details] [review]
0001-util-assign-about-dialog-to-the-application.patch
Comment 9 Christian Persch 2017-09-04 19:04:30 UTC
I've committed a smaller patch, and that also takes care to destroy the dialogue when it's dismissed.

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.