treesheets icon indicating copy to clipboard operation
treesheets copied to clipboard

Minimize to tray does not work on Linux Cinnamon

Open sphh opened this issue 5 years ago • 15 comments

I use TreeSheets Sep 22 2018 on an up-to-date Linux Mint 19.1 Cinnamon 4.0.10.

I checked Options > Minimize to tray, restarted Linux, but when I press the minimize button, TreeSheets does not minimize to tray, but to the panel's window list.

If you need further information, I am happy to provide it.

sphh avatar Jul 26 '19 07:07 sphh

Looks like it is only implemented for Windows:

https://github.com/aardappel/treesheets/blob/754b839dd78f61ea0860e9006409c68bc5d4fb54/src/myframe.h#L1001-L1013

If you can build TreeSheets, you could try removing that #ifdef (or better, changing to #ifndef __WXMAC__ and seeing if it functions correctly for you. If not I can try later.

aardappel avatar Jul 26 '19 14:07 aardappel

I would like to try it, but Linux Mint 19.1 only has wxWidgets 3.0.4 in it's repository ...

sphh avatar Jul 30 '19 07:07 sphh

Just tried it, and changing the #ifdef indeed now allows it to minimize to tray, but the icon looks funny, and clicking on it does not de-minimize.

Given that this is standard wxWidgets functionality, unless I go digging into their Linux implementation, I have no obvious way to fix this. Looks like others have had issues as well: https://forums.wxwidgets.org/viewtopic.php?t=41613

aardappel avatar Jul 31 '19 23:07 aardappel

I am sure you have seen those two threads (but just wanted to make sure):

  • https://forums.wxwidgets.org/viewtopic.php?f=1&t=27109&p=117316&hilit=minimize+to+tray#p117316
  • https://forums.wxwidgets.org/viewtopic.php?p=90794#p95363

sphh avatar Aug 01 '19 07:08 sphh

Hmm, some of that discussion appears to be about Windows, where it already works fine. But I can experiment with some of the sequences mentioned :)

aardappel avatar Aug 01 '19 14:08 aardappel

@sphh In the end it was even simpler than in the links you found: https://github.com/aardappel/treesheets/commit/3e61414d9bdf3b01a97f45b08a1afe117a0d13a1

This at least works on Mint 19.1 Cinnamon for me.

aardappel avatar Aug 30 '19 22:08 aardappel

Great!

Do you plan a new release?

sphh avatar Sep 02 '19 07:09 sphh

@sphh TreeSheets has never had "releases", I've just occasionally uploaded binaries for different platforms at random intervals. I've not done one for Linux in a while since most people get it in a different way (package manager, source builds etc). Which "release" would you want?

aardappel avatar Sep 02 '19 14:09 aardappel

I use the uploaded binary from the website, because the Ubuntu/Linux Mint is way out of date.

I also tried to compile it myself. Despite having compiled a lot of programs, I failed here. wxWindows compiled fine. But the directive "Note that you must currently use an "in tree" build, since TreeSheets will look for its files relative to the binary." is far from clear to me. Where do I put the compiled wxWindows in relation to TreeSheets source directory?

sphh avatar Sep 02 '19 14:09 sphh

If you do cmake -DCMAKE_BUILD_TYPE=Release . as it says in the readme, you will get an "in tree" build, since the . is the current dir. This only affects how you run it, not how you build it. It does not affect wxWidgets, it can pick that up from wherever the install step puts it. What errors do you get?

I'll go make an updated binary, just a sec.

aardappel avatar Sep 02 '19 15:09 aardappel

Ok, the 64-bit binary on http://strlen.com/treesheets/ has been updated to today (sept 2 2019), built on Mint 19.1

aardappel avatar Sep 02 '19 15:09 aardappel

Thanks for the new build!!

The program now minimizes to the tray, but

  • It shows a funny icon
  • Cannot be restored (single click, double click, right click, middle click)
  • Does not show a menu when right-clicking (but I don't know if it should show a menu)

I use Collapsible Systray by feuerfuchs v1.20 as a systray.

sphh avatar Sep 03 '19 12:09 sphh

To me, on an unmodified cinnamon, it now shows a correct icon, and restores with a double click. There is no menu associated with the icon from my code.

I don't think I have further time to debug this with custom systrays. I welcome any further improvements that make it work on all a Linuxes, wm's and trays equally, but I personally don't know what that requires, especially since wxWidgets appears to function differently on each OS. PRs welcome.

aardappel avatar Sep 03 '19 18:09 aardappel

I should have tested it with the stock systray before writing my message ...

Anyway, I tested it now. I removed the Collapsible Systray and added the stock systray. No luck: I cannot restore TreeSheet with a double click. These are the relevant snippets from .xsession-errors:

Cjs-Message: 10:41:57.112: JS LOG: [LookingGlass/info] Role locked: tray
Cjs-Message: 10:41:57.114: JS LOG: [LookingGlass/info] Loaded applet [email protected] in 8 ms
[...]
Cjs-Message: 10:42:48.050: JS LOG: [LookingGlass/info] Adding systray: treesheets (24x24px)
Cjs-Message: 10:42:48.051: JS LOG: [LookingGlass/info] Resized treesheets with normalized size (24x24px)

I also tested it by putting the standard systray in a newly created panel with the default values. Same result:

Cjs-Message: 10:48:30.717: JS LOG: [LookingGlass/info] Adding systray: treesheets (24x24px)
Cjs-Message: 10:48:30.718: JS LOG: [LookingGlass/info] Resized treesheets with normalized size (32x32px)

Do you have any ideas?

sphh avatar Sep 04 '19 08:09 sphh

Those aren't actual errors.. I'm not sure why it is not working for you. If you can manage to build it, you can experiment with the code yourself.

aardappel avatar Sep 04 '19 14:09 aardappel