Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 527  / 2 Years ago, fri, october 28, 2022, 7:44:46

I'm porting a commercial app to Linux, it is to run on several distros. When run on Ubuntu, the GtkMenuBar is removed from the app's window and placed on the main global menu bar. That's fine ... but there is a corresponding empty space in the app window where the menu was removed (it is placed with GtkFixed). I need to be able to detect when this has happened (and ONLY) when it has happened from any distro, so that I can reliably remove the empty space.



What's the best way to detect this? (ie via gtk_widget_... calls) What has been done to the GtkMenuBar to achieve this? Thanks.


More From » unity

 Answers
2

Here's what I finally had to resort to for multiple distros and the possibility the user has set an exception:



static int menu_proxy = -1;
typedef void *(*KVoidPtoF)();

void *proxylib;
KVoidPtoF gtk_menu_proxy_get;

menu_proxy = 0;
proxylib = dlopen("libappmenu.so", RTLD_NOLOAD | RTLD_LAZY);
if (proxylib)
{
gtk_menu_proxy_get = (KVoidPtoF)dlsym(proxylib,
"ubuntu_menu_proxy_get");
if (gtk_menu_proxy_get && (*gtk_menu_proxy_get)() != 0)
menu_proxy = 1;
}

[#32450] Saturday, October 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mocipe

Total Points: 161
Total Questions: 106
Total Answers: 118

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
;