<?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>497075</bug_id>
          
          <creation_ts>2024-12-05 11:20:29 +0000</creation_ts>
          <short_desc>Gtk4 popover prevents focusing kicker</short_desc>
          <delta_ts>2025-07-09 20:41:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>general</component>
          <version>6.2.3</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>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="postix">postix</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>kde</cc>
    
    <cc>nate</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/-/commit/51c0880f47ecd2e29ceb61e9dd9b30a535d18ff8</cf_commitlink>
          <cf_versionfixedin>6.4.3</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2379077</commentid>
    <comment_count>0</comment_count>
    <who name="postix">postix</who>
    <bug_when>2024-12-05 11:20:29 +0000</bug_when>
    <thetext>STEPS TO REPRODUCE
1.  Open gtk4-demo
2.  Click on the hamburger button to open a popover
3. Hit Meta to open kicker
4. Type something

OBSERVED RESULT
The input field of Kicker is not focused. On typing Kicker closes.

EXPECTED RESULT
Gtk4 popovers are treated like context menus and close on hitting Meta to open kicker.


SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.8-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Gtk: 4.16.4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2379930</commentid>
    <comment_count>1</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2024-12-09 16:59:09 +0000</bug_when>
    <thetext>It seems we don&apos;t dismiss the popup on Qt either, we just send a keyboard_leave which it handles differently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2381654</commentid>
    <comment_count>2</comment_count>
    <who name="postix">postix</who>
    <bug_when>2024-12-15 21:51:08 +0000</bug_when>
    <thetext>I&apos;ve noticed that the Gtk4 popover also stays above kicker: 

1) Create a panel on the top or left edge
2) Make kicker wide enough so that it covers the gtk4-demo app
3) Open the popover in the gtk4-demo
4) Hit Meta to open kicker</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2386496</commentid>
    <comment_count>3</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-01-03 13:43:26 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6963</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2431221</commentid>
    <comment_count>4</comment_count>
    <who name="postix">postix</who>
    <bug_when>2025-06-09 11:29:23 +0000</bug_when>
    <thetext>For reproducing, instead of opening kicker, you can also use Alt+Tab.

I&apos;ve found another case, where the gtk4 popover doesn&apos;t close even on clicking somewhere after tabbing to another window. Would you like to have a reproducer for this as well or do you think this case is also covered already?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2439527</commentid>
    <comment_count>5</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2025-07-09 09:58:55 +0000</bug_when>
    <thetext>Git commit 43f7621eb1ef22704c4c12c21c29945bffa37e47 by David Edmundson.
Committed on 09/07/2025 at 09:17.
Pushed by davidedmundson into branch &apos;master&apos;.

wayland: close popups upon window activation

Popups should grab all input on Wayland, however there are numerous
(deliberate) ways to get outside the grab, such as a shortcut that opens
a new window or pressing alt-tab.

If a popup is active when the focus changes we are left in a state where
the new window visibly has focus and appears on top of the popup&apos;s main
window, but the popup is still visible with an input grab. This is a
broken state.

This patch cancels popups if the focus window changes for whatever
reason.

Cancelling a popup also destroys the window server side rather than
waiting for the client to handle the popupDone so there is no racey
aspect for the next input.

M  +45   -0    autotests/integration/xdgshellwindow_test.cpp
M  +7    -0    src/popup_input_filter.cpp
M  +1    -1    src/popup_input_filter.h

https://invent.kde.org/plasma/kwin/-/commit/43f7621eb1ef22704c4c12c21c29945bffa37e47</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2439586</commentid>
    <comment_count>6</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2025-07-09 13:42:16 +0000</bug_when>
    <thetext>Git commit 51c0880f47ecd2e29ceb61e9dd9b30a535d18ff8 by Vlad Zahorodnii.
Committed on 09/07/2025 at 13:28.
Pushed by vladz into branch &apos;Plasma/6.4&apos;.

wayland: close popups upon window activation

Popups should grab all input on Wayland, however there are numerous
(deliberate) ways to get outside the grab, such as a shortcut that opens
a new window or pressing alt-tab.

If a popup is active when the focus changes we are left in a state where
the new window visibly has focus and appears on top of the popup&apos;s main
window, but the popup is still visible with an input grab. This is a
broken state.

This patch cancels popups if the focus window changes for whatever
reason.

Cancelling a popup also destroys the window server side rather than
waiting for the client to handle the popupDone so there is no racey
aspect for the next input.


(cherry picked from commit 43f7621eb1ef22704c4c12c21c29945bffa37e47)

Co-authored-by: David Edmundson &lt;kde@davidedmundson.co.uk&gt;

M  +45   -0    autotests/integration/xdgshellwindow_test.cpp
M  +7    -0    src/popup_input_filter.cpp
M  +1    -1    src/popup_input_filter.h

https://invent.kde.org/plasma/kwin/-/commit/51c0880f47ecd2e29ceb61e9dd9b30a535d18ff8</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>