<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>376277</bug_id>
          
          <creation_ts>2017-02-10 10:41:53 +0000</creation_ts>
          <short_desc>Right clicking on a system tray icon causes keeps focus on the icon even if user has moved elsewhere</short_desc>
          <delta_ts>2019-08-15 16:54:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>plasmashell</product>
          <component>System Tray widget</component>
          <version>5.9.1</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolaos Kakouros">tterranigma</reporter>
          <assigned_to name="Plasma Bugs List">plasma-bugs-null</assigned_to>
          <cc>bcom</cc>
    
    <cc>hal7df</cc>
    
    <cc>kde</cc>
    
    <cc>kdebugs</cc>
    
    <cc>linus.kardell</cc>
    
    <cc>materka</cc>
    
    <cc>nate</cc>
    
    <cc>notmart</cc>
    
    <cc>s.roussak</cc>
    
    <cc>simonandric5</cc>
    
    <cc>toost.b</cc>
    
    <cc>vitorvlv</cc>
          
          <cf_commitlink>https://commits.kde.org/plasma-workspace/67c1117fa52d43877626ed2d7e3b5cdf02f3e5df</cf_commitlink>
          <cf_versionfixedin>5.17.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1660066</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolaos Kakouros">tterranigma</who>
    <bug_when>2017-02-10 10:41:53 +0000</bug_when>
    <thetext>Steps to Reproduce:
1) Right click on an icon in the system tray that provides a context menu (eg not klipper)
2) Open the settings of the plasmoid or press Esc to move the focus elsewhere
3) Lefft-click somewhere in any panel (even on the system tray).

Actual Results:
The dropdown menu (the one that appears with a left click on an icon) of the icon pressed in step 1 appears.

Expected results:
The left-click action of the panel part the user clicked on should happen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660129</commentid>
    <comment_count>1</comment_count>
    <who name="Kai Uwe Broulik">kde</who>
    <bug_when>2017-02-10 15:56:16 +0000</bug_when>
    <thetext>Are you really using Plasma 5.9.1? I did a fix that landed there (cf. Bug 375941) but if you&apos;re still experiencing this, my fix wasn&apos;t good enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660130</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Uwe Broulik">kde</who>
    <bug_when>2017-02-10 15:56:55 +0000</bug_when>
    <thetext>Wrong bug, I was refering to this commit https://cgit.kde.org/plasma-workspace.git/commit/?id=dfdb7296275c2c4bb9eda77982f8ff5663e58e5f (is both in 5.8.6 and 5.9.1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1660695</commentid>
    <comment_count>3</comment_count>
    <who name="sparhawk">kdebugs</who>
    <bug_when>2017-02-12 23:57:44 +0000</bug_when>
    <thetext>I can confirm this in Arch Linux, Plasma 5.9.1-2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1668553</commentid>
    <comment_count>4</comment_count>
    <who name="Joost Bremmer">toost.b</who>
    <bug_when>2017-03-26 22:40:37 +0000</bug_when>
    <thetext>Also seem to still have this problem (plasma-workspace 5.9.4; Arch Linux).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1669058</commentid>
    <comment_count>5</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2017-03-29 11:42:39 +0000</bug_when>
    <thetext>Git commit e20f155190ac4e47bd2a9c1967b79f6e125c95ec by Marco Martin.
Committed on 29/03/2017 at 11:42.
Pushed by mart into branch &apos;master&apos;.

Setting a sensible minimum size for plasmawindowed

Summary:
plasmawindowed didn&apos;t set any minimum size to its window,
so it could be resized unusably small.
it tried to find its attached Layout, but the attached property
object wasn&apos;t created.
now set the minimum size by the following heiristics:
* if there is a switchsize, set it to switch to full representation
* then take the full representation minimum size if available and bigger then switch size
* otherwise, set it as SizeEnormous icon size
* in any case, don&apos;t let the window be less than that

Test Plan:
tried both an applet that exports a layout and ful lrepresentation (kickoff)
and an applet that wants to stay collapsed (analog clock) kickoff
stays expanded at a reasonable minimum size, the clock can be scaled down
to 128x128

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5235

M  +1    -0    plasma-windowed/CMakeLists.txt
M  +29   -15   plasma-windowed/plasmawindowedview.cpp
M  +2    -0    plasma-windowed/plasmawindowedview.h

https://commits.kde.org/plasma-workspace/e20f155190ac4e47bd2a9c1967b79f6e125c95ec</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1669060</commentid>
    <comment_count>6</comment_count>
    <who name="Marco Martin">notmart</who>
    <bug_when>2017-03-29 11:45:59 +0000</bug_when>
    <thetext>commit closed wrong bug, sorry</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1866320</commentid>
    <comment_count>7</comment_count>
    <who name="">hal7df</who>
    <bug_when>2019-06-30 13:34:45 +0000</bug_when>
    <thetext>I&apos;m experiencing this issue in Plasma 5.16.2, although the behavior is a little different:

- Plasmoids in the system tray that do provide context menus are unaffected
- The user needs to click on one of the context menu items for the bug to occur

Strangely, this was not an issue for me in Plasma 5.13-5.15. Only the update to 5.16 started causing this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871708</commentid>
    <comment_count>8</comment_count>
    <who name="Konrad Materka">materka</who>
    <bug_when>2019-07-29 09:19:04 +0000</bug_when>
    <thetext>I confirm that with latest Plasma 5.16.3. I found solution, will provide patch later.

Root cause:
System Tray sends two &quot;ContextMenu&quot; events which breaks focus. One is send on mouse pressed, second on mouse clicked. It is leftover from not full reverted patch.
Revert commit:
https://github.com/KDE/plasma-workspace/commit/27b1030756002e91b60ba51483efe9c2c477d16e


Fix:
Remove lines 111-113 from:
https://github.com/KDE/plasma-workspace/blob/master/applets/systemtray/package/contents/ui/items/AbstractItem.qml

Local test:
Edit file and logout/reboot:
/usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/AbstractItem.qml


It will also fix Wine applications, now it is not possible to close context menu by clicking outside of the menu. Sometimes it is not working at all - menu shows, but cannon click on any position.
Surprisingly GTK + xembededsniproxy was working fine (For example XChat). GTK applications ignore first event because mouse state is invalid (pressed), only the second event is handled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871712</commentid>
    <comment_count>9</comment_count>
    <who name="Konrad Materka">materka</who>
    <bug_when>2019-07-29 09:23:59 +0000</bug_when>
    <thetext>*** Bug 409649 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872260</commentid>
    <comment_count>10</comment_count>
    <who name="">hal7df</who>
    <bug_when>2019-07-31 18:08:47 +0000</bug_when>
    <thetext>(In reply to Konrad Materka from comment #8)
&gt; I confirm that with latest Plasma 5.16.3. I found solution, will provide
&gt; patch later.
&gt; 
&gt; Root cause:
&gt; System Tray sends two &quot;ContextMenu&quot; events which breaks focus. One is send
&gt; on mouse pressed, second on mouse clicked. It is leftover from not full
&gt; reverted patch.
&gt; Revert commit:
&gt; https://github.com/KDE/plasma-workspace/commit/27b1030756002e91b60ba51483efe9c2c477d16e
&gt; 
&gt; 
&gt; Fix:
&gt; Remove lines 111-113 from:
&gt; https://github.com/KDE/plasma-workspace/blob/master/applets/systemtray/package/contents/ui/items/AbstractItem.qml
&gt; 
&gt; Local test:
&gt; Edit file and logout/reboot:
&gt; /usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/
&gt; items/AbstractItem.qml
&gt; 
&gt; 
&gt; It will also fix Wine applications, now it is not possible to close context
&gt; menu by clicking outside of the menu. Sometimes it is not working at all -
&gt; menu shows, but cannon click on any position.
&gt; Surprisingly GTK + xembededsniproxy was working fine (For example XChat).
&gt; GTK applications ignore first event because mouse state is invalid
&gt; (pressed), only the second event is handled.

Just tried the fix on my machine, and can confirm that it works. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872298</commentid>
    <comment_count>11</comment_count>
    <who name="Konrad Materka">materka</who>
    <bug_when>2019-07-31 20:41:23 +0000</bug_when>
    <thetext>My fix from comment above is not correct - it breaks right click for plasmoids. Improved patch sent for review:
https://phabricator.kde.org/D22804</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1874000</commentid>
    <comment_count>12</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2019-08-09 15:14:06 +0000</bug_when>
    <thetext>*** Bug 410749 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1875084</commentid>
    <comment_count>13</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2019-08-15 16:54:32 +0000</bug_when>
    <thetext>Git commit 67c1117fa52d43877626ed2d7e3b5cdf02f3e5df by Nate Graham, on behalf of Konrad Materka.
Committed on 15/08/2019 at 16:54.
Pushed by ngraham into branch &apos;master&apos;.

[System Tray] Do not send ContextMenu signal twice

Summary:
System Tray sends two &quot;ContextMenu&quot; events which breaks focus.
One is send on mouse pressed, second on mouse clicked. As a result
right click on the system tray icon causes focus to lock on the icon.
If later user clicks somewhere else event is send to the first icon.
Related: bug 409768
FIXED-IN: 5.17.0

Test Plan:
The best to test with Skype for Linux with SNI bridge.

To reproduce:
* Right click on the Skype icon, click on menu item (can be Show Skype)
* Right click on any other icon in system tray (or even any other place on the panel)
* Skype menu will appear

After fix:
* Right click on the Skype icon, click on menu item (can be Show Skype)
* Right click on any other icon in system tray (or even any other place on the panel)
* Correct menu should show

Reviewers: #plasma, broulik, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, apol, plasma-devel, #plasma_workspaces

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D22804

M  +2    -3    applets/systemtray/package/contents/ui/items/AbstractItem.qml
M  +5    -0    applets/systemtray/package/contents/ui/items/PlasmoidItem.qml

https://commits.kde.org/plasma-workspace/67c1117fa52d43877626ed2d7e3b5cdf02f3e5df</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>