Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuffled tray icon order after SIGHUP #242

Closed
zaza42 opened this issue Mar 5, 2018 · 21 comments
Closed

Shuffled tray icon order after SIGHUP #242

zaza42 opened this issue Mar 5, 2018 · 21 comments
Labels
enhancement The report requests an enhancement beyond the intended behaviour.

Comments

@zaza42
Copy link

zaza42 commented Mar 5, 2018

I take care the order of my tray icons:
gkrellshoot_2018-03-05_182111
But after a killall -HUP icewm...
gkrellshoot_2018-03-05_192155
and again:
gkrellshoot_2018-03-05_192208

xxkb is still running, but it losts its icon. :-/

ps: Are there any command line utility to arrange the icons in tray?

@gijsbers
Copy link
Collaborator

gijsbers commented Mar 5, 2018

icewm -r is shorter.

xxkb is not very conformant anymore, therefore it won't behave as well as other tray icons.

In theory one could write a script to suspend all tray apps and then after restarting icewm enabling the tray apps in the proper order with a little delay inbetween. This script could be called by a user defined icewm hotkey to restart icewm.

@zaza42
Copy link
Author

zaza42 commented Mar 5, 2018

The 1.4.2 version doesn't have this ordering bug or disappearing xxkb icon.
Ok, i can start xxkb from script after icewm -r, so it's much less important than keeping the order.

ps.: Some terminal windows gets swapped after SIGHUP, but i wrote a script to store all window positions and i can restore them. (1.4.2 also has this "effect".) But there is no utility for system tray. :-/

@gijsbers
Copy link
Collaborator

gijsbers commented Mar 5, 2018

1.4.2 doesn't have reordering of tray icons on icewm restarts because it uses a separate tray process which doesn't restart. You can still use that design by setting a compile time option.

You mean their position on the taskbar gets swapped? Controllable taskbar positions seems to be a wish by many, so we could have some ideas on how this best be controlled.

@zaza42
Copy link
Author

zaza42 commented Mar 5, 2018

Which compile time option is that?

No, I mean the window positions. I have 5-6 rxvt and the first swaps with the second or simply overlaps it by pixel accuracy. The same effect happens after changing the desktop geometry (enable 2nd monitor).

@gijsbers
Copy link
Collaborator

gijsbers commented Mar 5, 2018

CONFIG_EXTERNAL_TRAY

I can't reproduce that rxvt swap sofar. That makes it impossible to fix for me. I remember some changes on restart (not by me for sure) a while ago which changed restart effects, e.g. #190 for one.

@zaza42
Copy link
Author

zaza42 commented Mar 5, 2018

Sorry, I have no luck with CONFIG_EXTERNAL_TRAY :-/

/usr/bin/ld: Dwarf Error: Could not find abbrev number 8195.
/tmp/ccwWsaJV.ltrans0.ltrans.o: In function `YXTrayEmbedder::paint(Graphics&, YRect const&)':
<artificial>:(.text+0xa5e4): undefined reference to `taskbackPixmap'
/usr/bin/ld: Dwarf Error: Could not find abbrev number 192.
/tmp/ccwWsaJV.ltrans1.ltrans.o: In function `XftGraphics::drawString(Graphics&, _XftFont*, int, int, unsigned int*, unsigned long)':
<artificial>:(.text+0xa35): undefined reference to `fribidi_log2vis'
collect2: error: ld returned 1 exit status
src/CMakeFiles/icewmtray.dir/build.make:877: recipe for target 'icewmtray' failed
make[3]: *** [icewmtray] Error 1
make[3]: Leaving directory '/usr/src/sources/2018/x/icewm-20180305/obj-x86_64-linux-gnu'
CMakeFiles/Makefile2:106: recipe for target 'src/CMakeFiles/icewmtray.dir/all' failed
make[2]: *** [src/CMakeFiles/icewmtray.dir/all] Error 2
make[2]: Leaving directory '/usr/src/sources/2018/x/icewm-20180305/obj-x86_64-linux-gnu'
Makefile:132: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/sources/2018/x/icewm-20180305/obj-x86_64-linux-gnu'
dh_auto_build: cd obj-x86_64-linux-gnu && make -j16 returned exit code 2
debian/rules:28: recipe for target 'binary' failed
make: *** [binary] Error 2

@zaza42
Copy link
Author

zaza42 commented Mar 5, 2018

UPDATE: I did a quickfix for that. Disabling FRIBIDI and patching yxtray.cc:

void YXTrayEmbedder::paint(Graphics &g, const YRect& r) {
    if (fRepaint) {
        extern ref<YPixmap> taskbackPixmap;
//        if (taskbackPixmap != null) {
//            g.fillPixmap(taskbackPixmap,
//                         r.x(), r.y(), r.width(), r.height(),
//                         x() + r.x(), y() + r.y());
//        }
//        else {
            g.setColor(taskBarBg);
            g.fillRect(r.x(), r.y(), r.width(), r.height());
//        }
    }
}

Now I got back the good old icewmtray, but xxkb has no direct support for background again. :-/
gkrellshoot_2018-03-05_221725
Still trying to "backport" your xxkb fix...

update: patch for compiling icewmtray:
icewm-1.4.3-externaltray.patch.gz

@zaza42
Copy link
Author

zaza42 commented Mar 5, 2018

And sorry, window swapping only happens when changing the desktop geometry.
before:
maim-2018-03-05_22 53 01

after:
maim-2018-03-05_22 53 10

The 1st and the 2nd terminal had swapped. This was the same with 1.4.2 too.

gijsbers added a commit that referenced this issue Mar 6, 2018
@gijsbers
Copy link
Collaborator

gijsbers commented Mar 6, 2018

Pixmap added to icetray.cc to make it look nicer.
Could you perhaps move the terminal swapping to its own issue?
It's easier to work with if each topic has its own issue.
The patch is mostly CMake hence @Code7R might be interested in it.

@Code7R
Copy link
Collaborator

Code7R commented Mar 6, 2018

Uhm, I always considered the external icewmtray thingie PITA and I was happy when it was gone. But if somebody is interested, I will review the patch and incorporate it, no problem.

@zaza42
Copy link
Author

zaza42 commented Mar 7, 2018

@Code7R I could live happy with internal tray if it keeps the order of icons after SIGHUP, or a command line utility which allows me to change the order of icons.
(I use SIGHUP often for changing one icon on the toolbar: when projector (2nd head) is on, and when it's off. i use it as an indicator which is clickable. )
projector-off
projector-on

@zaza42
Copy link
Author

zaza42 commented Mar 7, 2018

This commit was no so perfect :-<

/usr/src/sources/2018/x/icewm-20180307/src/icetray.cc: In member function ‘void SysTrayApp::loadConfig()’:
/usr/src/sources/2018/x/icewm-20180307/src/icetray.cc:144:22: error: ‘YResourcePaths’ has not been declared
     taskbackPixmap = YResourcePaths::loadPixmapFile(file);
                      ^~~~~~~~~~~~~~
/usr/src/sources/2018/x/icewm-20180307/src/icetray.cc:144:53: error: ‘file’ was not declared in this scope
     taskbackPixmap = YResourcePaths::loadPixmapFile(file);
                                                     ^~~~
/usr/src/sources/2018/x/icewm-20180307/src/icetray.cc:144:53: note: suggested alternative: ‘nice’
     taskbackPixmap = YResourcePaths::loadPixmapFile(file);
                                                     ^~~~
                                                     nice
src/CMakeFiles/icewmtray.dir/build.make:65: recipe for target 'src/CMakeFiles/icewmtray.dir/icetray.cc.o' failed

@gijsbers
Copy link
Collaborator

gijsbers commented Mar 7, 2018

@Code7R You're right about the pain... If someone only would fix #209.

@zaza42
Copy link
Author

zaza42 commented Mar 8, 2018

Ok, it's compiled, but...but the tray icon of xxkb is not transparent as with internal systemtray.
vsddsds

@gijsbers
Copy link
Collaborator

gijsbers commented Mar 8, 2018

the external is unmaintained.

@bbidulock bbidulock added bug The issue exposes a bug. enhancement The report requests an enhancement beyond the intended behaviour. and removed bug The issue exposes a bug. labels Mar 10, 2018
@bbidulock
Copy link
Owner

Internal tray or external tray, restarting the tray results in a different ordering, so, not really a bug. In fact, most system trays (such as those based on gnome wnck) do reorder on restart. Nevertheless, it is a relatively minor enhancement. Simply need to support _KDE_NET_SYSTEM_TRAY_WINDOWS and _KDE_NET_SYSTEM_TRAY_WINDOW_FOR and examine the properties on restart of the tray. However, on initial start of the tray, the icons will appear in the system tray in the order in which they asked for an icon to be installed. Probably not terribly hard to have a preference file set the preferred order on tray startup: most toolkits set resource name and class on their status icon windows.

@gijsbers
Copy link
Collaborator

Where are these properties documented?

gijsbers added a commit that referenced this issue Mar 11, 2018
…stem tray for issues #242, #180, #198. Use _KDE_NET_SYSTEM_TRAY_WINDOWS for issue #242. Possible fixes for issue #209 which requires further testing.
@zaza42
Copy link
Author

zaza42 commented Mar 13, 2018

Ok, it works like a charm with winoptions:

pasystray.order: 1
audacious.order: 2
hexchat.order: 3
uget-gtk.order: 4
claws-mail.order: 5
XXkb.order: 6

gkrellshoot_2018-03-13_111302
But xxkb's icon always disappears after killall -HUP icewm or icewm -r
gkrellshoot_2018-03-13_111423

@bbidulock
Copy link
Owner

xxkb might not be looking for a new systray to appear after the one it was in disappears.

@zaza42
Copy link
Author

zaza42 commented Mar 13, 2018

Ok, then i'll write an xxkb bugreport. Thx for this feature! It helped a lot, because i have a lot sleep X and xdotool search --sync --class XX lines in startup file for waiting programs to be placed after each other. Now I can run them in any order. Thx again!

@zaza42 zaza42 closed this as completed Mar 13, 2018
@gijsbers
Copy link
Collaborator

Or you could restart xxkb when icewm restarts like this:

xprop -spy -root _WIN_SUPPORTING_WM_CHECK | while read a; do echo "# $a" ; if [ -n "$a" ]; then pkill -x xxkb; sleep 0.5; xxkb & fi; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The report requests an enhancement beyond the intended behaviour.
Projects
None yet
Development

No branches or pull requests

4 participants