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, when container window is visible, XembedSNIProxy needs hide it again by stacking the container window below again.
BUG: 357443
FIXED-IN: 5.18.0
Test Plan:
1. Run any application with XEmbed system tray icon, do not click on the icon
2. Restart KWin
3. [Optional] Disable compositor - with disable container window is black and easier to spot
4. Expected:
a) before fix: black/transparent rectangle in the top-left corner, reacts to mouse click
b) after fix: 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/D26395
Summary:
Regression introduced in previous commit, review D25777. Tray icons should have an ability to resize. If not, icons smaller than 32x32 will render incorectly. In addition, do not notify using xcb_configure_notify_event_t, in some cases (Wine) it messes up the event handling.
BUG: 414667
FIXED-IN: 5.18.0
Test Plan: Tested with keepass2, keepassx, pidgin, xchat, hexchat, tuxguitar, liferea, wine tflash.exe, workrave, stardict
Reviewers: #plasma_workspaces, #plasma, davidedmundson
Reviewed By: #plasma_workspaces, #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D26088
Summary:
When the window is embedded, it should not request position change. Sometimes applications are misbehaving and ignore this constrain. We need to capture all structure requests (position or size change) and ignore them. In other words, we must be a window manager for the embedded window.
BUG: 414667
Test Plan:
0. You need multiples screens to test this
1. Configure screens so that (0,0) is not on the primary screen
2. Run any Windows app with tray icon using Wine
3. Left click event should work correctly
Reviewers: #plasma_workspaces, #plasma, davidedmundson
Reviewed By: #plasma_workspaces, #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D26079
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:
If available, always use 32-bit color. We don't need Composite extension to handle transparency - all client windows are our children and transparency in handled in QML, inside the panel (so no need to composite real windows).
BUG: 356937
FIXED-IN: 5.17.1
Test Plan:
Disable compositor, run:
- pidgin (make sure pidgin-libnotify is NOT installed)
- keepassx
- xchat
- liferea
Before changes: black backgroud
After changes: transparent background
Reviewers: davidedmundson, #plasma_workspaces, #plasma
Reviewed By: davidedmundson, #plasma_workspaces, #plasma
Subscribers: mlaurent, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24530
Summary:
If available, always use 32-bit color. We don't need Composite extension to handle transparency - all client windows are our children and transparency in handled in QML, inside the panel (so no need to composite real windows).
BUG: 356937
FIXED-IN: 5.17.1
Test Plan:
Disable compositor, run:
- pidgin (make sure pidgin-libnotify is NOT installed)
- keepassx
- xchat
- liferea
Before changes: black backgroud
After changes: transparent background
Reviewers: davidedmundson, #plasma_workspaces, #plasma
Reviewed By: davidedmundson, #plasma_workspaces, #plasma
Subscribers: mlaurent, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24530
Summary:
XCB may return null pointer as a response. Add a check to prevent
segmentation fault.
BUG: 409652
FIXED-IN: 5.17.1
Test Plan: It is hard to reproduce, but the reason of the segmentation fault is pretty obvious, thanks to the debug dump from bug 409652
Reviewers: #plasma_workspaces, #plasma, davidedmundson
Reviewed By: #plasma_workspaces, #plasma, davidedmundson
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24514
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
Summary:
xembedsniproxy doesn't do anything that requires it to be
aware of KDE GUI settings (colors, style, standard keys, etc).
This makes it start a fair bit faster.
Reviewers: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9194
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:
Use the cmake variable rather than the library name to link.
This fixes linking on FreeBSD, where the library location is not
in the default linker path.
Reviewers: #freebsd, davidedmundson
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5997
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