Set application title under Gnome 3

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
fishnet37222
Knows some wx things
Knows some wx things
Posts: 27
Joined: Sat May 06, 2017 1:40 pm

Set application title under Gnome 3

Postby fishnet37222 » Tue Nov 14, 2017 2:07 pm

I've noticed that when I run a wxWidgets application under Gnome 3, the name that's displayed in the top bar is the name of the executable with the first letter capitalized. Is it possible to set it to a more user-friendly string? I tried calling both wxApp::SetAppName() and wxApp::SetAppDisplayName() with no effect.

I'm using wxWidgets 3.1.0 on Ubuntu 17.10 with GCC version 7.2.0.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2009
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Set application title under Gnome 3

Postby ONEEYEMAN » Wed Nov 15, 2017 3:43 pm

Hi,
This application has a frame, right?

Thank you.

fishnet37222
Knows some wx things
Knows some wx things
Posts: 27
Joined: Sat May 06, 2017 1:40 pm

Re: Set application title under Gnome 3

Postby fishnet37222 » Wed Nov 15, 2017 3:47 pm

The application has a frame. You can look at the code on GitHub if you want.

https://github.com/fishnet37222/mymusiccollection

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2009
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Set application title under Gnome 3

Postby ONEEYEMAN » Wed Nov 15, 2017 4:57 pm

Hi,
So why not use SetTitle() on the frame?
Or just check documentation on how to set the title properly?

Thank you.

fishnet37222
Knows some wx things
Knows some wx things
Posts: 27
Joined: Sat May 06, 2017 1:40 pm

Re: Set application title under Gnome 3

Postby fishnet37222 » Wed Nov 15, 2017 5:18 pm

I'm passing the title for the window in the constructor as in the following line.

Code: Select all

MainWindow::MainWindow() : wxFrame(nullptr, wxID_ANY, "My Music Collection")


That sets the title for the window without any issues. However, the title displayed in the Gnome 3 top bar still shows the name of the executable. This is the bar that runs across the top of the screen in Gnome 3, not the title bar of the window.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2009
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Set application title under Gnome 3

Postby ONEEYEMAN » Wed Nov 15, 2017 7:29 pm

Hi,
Is this what you are looking for?
Just try calling gtk_window_set_wmclass() and if it changes see if there is a wxWidgets call that does it.

If not - you can make a patch implementing it and submit it to trac.wxwidgets.org. You will have to register and be approved once.

Thank you.


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 2 guests