Summary:
For each tray icon XEmbedSNIProxy is creating container window 32x32 in size. It is black with opaque set to 0 (fully transparent when compositor is enabled). All of these container windows are stacked below all windows, so normally you can't see them. On creation all container windows are created in top-left corner. When user clicks on the tray icon, container window is moved to the click location (to handle events correctly).
On KWin restart all windows are shuffled, usually KWin is able to restore ordering correctly, but for some reason not it this case. As a result black/transparent container windows are stacked above all other windows and panels.
To solve that, on KWin restart, XembedSNIProxy needs to iterate over all known container windows and stack them below again.
BUG: 357443
Test Plan:
1. [Optional] Disable compositor - with disable container window is black and easier to spot
2. Run any application with XEmbed system tray icon, do not click on the icon
3. Restart KWin
a) Before: black/transparent rectangle in the top-left corner, reacts to mouse click
b) After: no rectangle, mouse clicks work as expected
Reviewers: #plasma_workspaces, #plasma, davidedmundson
Reviewed By: #plasma_workspaces, #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D25603
Summary:
Do not scale up small icons to avoid quality detoriation. For small icons scaling should be done in SystemTray only. Currently XembedSNIProxy scales to 32x32, then SystemTray (usually) scales it down to 24x24.
BUG: 366047
FIXED-IN: 5.17.1
Test Plan:
I've run few applications with small icons:
- keepassx (22x22)
- liferea (16x16)
- tuxguitar (16x16)
It looks much better without scaling in xemebdsniproxy.
Reviewers: davidedmundson, #plasma, #plasma_workspaces
Reviewed By: davidedmundson, #plasma, #plasma_workspaces
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24531
Summary:
If needed, perform resize in each update().
Client window may be too big, it must be resized to a certain reasonable size. Sometimes resizing in the constructor is not enough because it is too early and the client window is not fully initialized. Even if client window is resized, on first update it reverts back to original size (or just ignores the first request - some kind of a race condition).
In addition, I applied some rules from: https://community.kde.org/Policies/Kdelibs_Coding_Style
BUG: 358240
Test Plan:
I tested it using keepass2, now it shows better results (still not perfect). Window is resized to 32x32, but icon is only 24x24 it top-left. Better than 273x273 with tiny dot in the corner. This is a workaround for unsolvable bug in Mono - AFAIK Windows Forms are not longer maintained so it won't be fixed.
I tested this change with several other apps for regressions, no issues:
pidgin
liferea
hexchat
tuxguitar
xchat
keepassx
stardict
and other I don't remember now. No regressions.
Reviewers: davidedmundson, #plasma, #plasma_workspaces, broulik
Reviewed By: davidedmundson, #plasma, #plasma_workspaces
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24529
Summary:
Wine is using XWindow Shape Extension for transparent tray icons.
We need to find first clickable point starting from top-left.
BUG: 399234
Test Plan:
Bug fix test:
1. Enable KWin compositing;
2. Download this test program (SHA-1: 63ae606aee64259091e7f82436d4ecdf3a6e9047): https://www.nirsoft.net/utils/tflash210.zip
3. Run the .exe with Wine **Staging**
4. Right click on the icon
5. Context menu should show
Regression test:
1. Run XChat
2. Right click
3. Context menu should show in the same place as without patch
Reviewers: davidedmundson, #plasma_workspaces
Reviewed By: davidedmundson, #plasma_workspaces
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22767
The structure was only freed in case the XTest method was chosen.
But it should always be freed of course (as long as it isn't NULL).
Use a QScopedPointer instead to free it automatically when it goes out
of scope and to be more consistent with the rest of t
Differential Revision: https://phabricator.kde.org/D6389
Check the return value of xcb_get_window_attributes_reply() to prevent a crash if getting the window attributes would fail for some reason.
Also free the returned structure after usage to avoid memleaks.
This is necessary according to https://xcb.freedesktop.org/windowcontextandmanipulation (see the end of the page).
Differential Revision: https://phabricator.kde.org/D6252
Because of C++'s operator precedence, '!' logically negated
all_event_masks only instead of the whole expression.
This resulted in the condition always being false and XTest never being
used.
Adding a pair of brackets fixes it.
BUG: 362941
BUG: 375017
FIXED-IN: 5.10.1
Differential Revision: https://phabricator.kde.org/D6048
Summary:
A certain toolkit doesn't register for mouse press release events
because it now uses XI2 only.
Injecting those directly to the window is too difficult, fortunately in
the GTK3 case we can use XTest to send an event. Something I had
previously chosen against using because it didn't work with something
else (can't remember what). I now have a bit of code choosing which
method to use, which will hopefully cover all cases.
Code is a bit convuluted because the xcb version of xtest doesn't have
the high-level method I want to use in it's API, so I just used Xlib
version.
CCBUG: 375017
CCBUG: 362941
Test Plan:
Ran my usual bunch of test apps:
- xchat
- a GTK3 systray demo I made
- skype (A Qt4 app without SNI patches)
All worked as before
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5156
1a13806d74 changed from configure to
config_notify which fixed some applications, however also broke other
applications such as radiotray and pidgin not appearing.
This patch sends both types of resize, so that one should work.
The selection manager of tray may hold a property to indicate the tray
icon window visual. Try to use the visual with alpha channel when
composite is enabled.
REVIEW: 127009
Coverity noted we were mismatching new Foo with free(foo), which is
undefined behavior (CID 1340556). While I was fixing that I noticed we
have the same issue with QScopedPointer<>: when using QSP to track
objects returned by libxcb, we must use free() to release memory, not
C++ delete. (e.g. see
http://xcb.freedesktop.org/manual/group__XCB____API.html#ga6727f2bfb24769655e52d1f1c50f58fe)
QScopedPointer will do this if we use QScopedPointerPodDeleter.
REVIEW:126512
If grabbed icons are blank, try to salvage the copied data as well as
possible while leaving setups where image grabbing works fine alone.
Based on a patch by Rakyn Barker.
BUG:355684
REVIEW: 126336
Hush the NetWinInfo deprecation warning
Hush the int narrowing warning
Create the container window on-screen
Switch to 32x32 pixel icons and avoid scaling
Made sure container window is under mouse upon click
Reviewed-by: David Edmundson
The goal of this project is to make xembed system trays available in
Plasma.
This is to allow legacy apps (xchat, pidgin, tuxguitar) etc. system
trays[1] available in Plasma which only supports StatusNotifierItem [2].
Ideally we also want this to work in an xwayland session, making X
system tray icons available even when plasmashell only has a wayland
connection.
REVIEW: 125655