samdroid-apps / something-for-reddit

A Reddit Client For GNOME (with Gtk+ and Python)
GNU General Public License v3.0
162 stars 14 forks source link

Define window title and icon #17

Closed tgraven closed 8 years ago

tgraven commented 8 years ago

Right now the window title and icon are undefined, which results in the title defaulting to reddit-is-gtk and the icon defaulting to a grey box with a question mark (ot whatever your gtk theme sets it to)

samdroid-apps commented 8 years ago

I pushed a commit that might help on the icon front: https://github.com/samdroid-apps/reddit-is-gtk/commit/69fd9ca9d31b76b8e4a8da3073a920d7b9846806

tgraven commented 8 years ago

Yep, the icon works, the title still doesn't.

samdroid-apps commented 8 years ago

I'm really not sure what the title issue is. I pass the "title" argument to set the title property of the Gtk window.

What desktop environment are you using? For some reason, GNOME calls it "reddit-is-gtk". Are you on GNOME 3 as well?

tgraven commented 8 years ago

I alternate between MATE and i3, but the issue is in both.

bilelmoussaoui commented 8 years ago

@samdroid-apps I think the issue is a missing Startup_WM_CLASS, you should add a self.set_wm_class('a', 'Something for reddit') to the main window class, and add a StartupWMClass=a in the desktop file

samdroid-apps commented 8 years ago

I tested that on my GNOME3.20 desktop, and it didn't cause any changes. What desktop environment are you running? What part of the DE does this effect?

bilelmoussaoui commented 8 years ago

I don't have the issue on Gnome 3.20 but i think an application should have a WM_CLASS so it can be detected by the desktop manager (like ocmpiz..)

samdroid-apps commented 8 years ago

Ah, I should test on one of those compositors.

I thought the bug was refering to the fact that the window title in the GNOME overview is just 'reddit-is-gtk', rather than a proper title ('Something for Reddit').

bilelmoussaoui commented 8 years ago

Ah, i can open à PR to fix that if you want Le 4 juin 2016 11:56, "Sam" notifications@github.com a écrit :

Ah, I should test on one of those compositors.

I thought the bug was refering to the fact that the window title in the GNOME overview is just 'reddit-is-gtk', rather than a proper title ('Something for Reddit').

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samdroid-apps/something-for-reddit/issues/17#issuecomment-223747361, or mute the thread https://github.com/notifications/unsubscribe/AHTlxcqsMMdD-05gE84cfLE6R0P3LqK-ks5qIUvogaJpZM4ICoFO .

samdroid-apps commented 8 years ago

If you have a solution, please send the pull request :)

bilelmoussaoui commented 8 years ago

Before i open a PR to fix this, i think that you should add a Gtk.Application first; instead of using the Gtk.Window directly, and inside of the Gtk.Application __init__ method you can use GLib.set_application_name("Something for reddit") This will fix this issue without having to use a WM_CLASS. As you can see here a lot of gnome apps have been ported to use Gtk Application too https://wiki.gnome.org/Initiatives/GnomeGoals/PortToGtkApplication. This might help too https://wiki.gnome.org/HowDoI/GtkApplication

samdroid-apps commented 8 years ago

I do have a GtkApplication - it is at the bottom of the main.py file

bilelmoussaoui commented 8 years ago

My bad! sorry didn't see that