solus-project / brisk-menu

An efficient menu for the MATE Desktop
GNU General Public License v2.0
139 stars 23 forks source link

Update to new API from mate-menus 1.21 #103

Closed vkareh closed 5 years ago

vkareh commented 6 years ago

This may be considered work in progress. The mate-menus project has been updated and has breaking API changes. This pull request updates Brisk to support the new API, but until all necessary dependencies have been tagged appropriately (and 1.21 is a dev version), it might not make sense to merge this.

I will update this as necessary.

Fixes #115

vkareh commented 6 years ago

@raveit65, @monsta, @flexiondotorg, @yetist - please test at your convenience. This update won't really be necessary until we hit 1.22 (unless @ikeydoherty wants to track this against MATE 1.21 dev version)

monsta commented 6 years ago

Well, I don't use this menu, so I probably won't be able to test for regressions...

yetist commented 5 years ago

Looks like it's not finished? If install/uninstall the software, brisk-menu applet will crash. When the matemenutree changed, should run matemenu_tree_load_sync again.

vkareh commented 5 years ago

@yetist - When the "changed" signal is triggered:

Some of those are deferred because of the monitor callbacks, so maybe I need to explicitly call it earlier?

Or am I looking at the wrong thing? Sorry, it's been a while since I touch this code and I honestly don't remember a lot of what I did here :confused:

yetist commented 5 years ago

In my tests, it working in most cases, the install/uninstall software works. But there may be some bugs in the code.

I wrote the following script:

$ cat test.sh 
#!/bin/bash
sudo mv /usr/share/applications/0ad.desktop ~/
update-desktop-database
sleep 5
sudo cp ~/0ad.desktop /usr/share/applications/0ad.desktop
update-desktop-database
sleep 5

And use watch -n 5 ./test.sh to run, keep the menu open while the script is running, click on some menu categories, and then brisk-menu crash.

vkareh commented 5 years ago

@yetist - yeah, I can reproduce this consistently.

The issue seems to happen when adding the item to the GTK container in src/frontend/classic/classic-window.c, line 203:

gtk_container_add(GTK_CONTAINER(BRISK_CLASSIC_WINDOW(self)->apps), button);

It also happens with the dash-window.c. That's currently where I'm stuck - it seems like the BriskItem app_item that gets generated in brisk_apps_backend_recurse_root is somehow different during changes in the menu tree, which causes a segfault when trying to add it to the front-end...

vkareh commented 5 years ago

damn, did I just really do that? sigh... I'll close this and open a new pull request under https://github.com/getsolus/brisk-menu

vkareh commented 5 years ago

I've moved this to https://github.com/getsolus/brisk-menu/pull/2