<?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>442375</bug_id>
          
          <creation_ts>2021-09-13 08:47:18 +0000</creation_ts>
          <short_desc>[Wayland] Hamburger menu opens as window if app window is unfocused</short_desc>
          <delta_ts>2022-11-06 23:27:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kconfigwidgets</product>
          <component>general</component>
          <version>5.86.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=444312</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>wayland-only</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>guimarcalsilva</reporter>
          <assigned_to name="kdelibs bugs">kdelibs-bugs-null</assigned_to>
          <cc>bugseforuns</cc>
    
    <cc>dolphin-bugs-null</cc>
    
    <cc>felixernst</cc>
    
    <cc>jebin12raj</cc>
    
    <cc>kde</cc>
    
    <cc>nate</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kconfigwidgets/commit/82c40f18709484fd462643aa113a8ccf961b646a</cf_commitlink>
          <cf_versionfixedin>5.89</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2060669</commentid>
    <comment_count>0</comment_count>
    <who name="">guimarcalsilva</who>
    <bug_when>2021-09-13 08:47:18 +0000</bug_when>
    <thetext>SUMMARY


STEPS TO REPRODUCE
1. Open Dolphin or Gwenview
2. Click on the desktop to unfocus the window
3. Click on the hamburger menu button on the top right corner

OBSERVED RESULT

Hamburger menu gets its own window

EXPECTED RESULT

The menu should either open as intended on the first click or not get triggered and instead only focus the window (like what happens with the hamburger menu on System Settings when doing the same thing).

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-34-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6200U CPU @ 2.30GHz
Memory: 3.7 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 520</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060670</commentid>
    <comment_count>1</comment_count>
    <who name="David Edmundson">kde</who>
    <bug_when>2021-09-13 08:52:19 +0000</bug_when>
    <thetext>Moving to dolphin until kwin is proven to be at fault.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2060672</commentid>
    <comment_count>2</comment_count>
    <who name="">guimarcalsilva</who>
    <bug_when>2021-09-13 09:00:58 +0000</bug_when>
    <thetext>(In reply to David Edmundson from comment #1)
&gt; Moving to dolphin until kwin is proven to be at fault.

Well, the issue also happens with Gwenview, so ir can&apos;t be expecific to Dolphin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2061491</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-09-16 18:49:05 +0000</bug_when>
    <thetext>Could be an issue in KHamburgerMenu itself too. Given that it happens in both apps, moving to where it lives for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2062749</commentid>
    <comment_count>4</comment_count>
    <who name="Felix Ernst">felixernst</who>
    <bug_when>2021-09-21 14:56:06 +0000</bug_when>
    <thetext>Yes, my guess is that the bug is produced because no parent is set for the QMenu in KHamburgerMenuPrivate::newMenu(). It is saved in a std::unique_ptr currently which makes the normal workaround (https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes#Popup_Menus) to this not easily applicable.

It is also doubly tricky because this menu is set to be the menu of any potential amount of hamburger menus that the application might want to place anywhere including in multiple windows. In practice we are not doing that currently but this means that there is no clear parent window that can be reliably chosen and expected to be alive for longer than the QMenu itself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072089</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Silva">bugseforuns</who>
    <bug_when>2021-10-25 19:53:40 +0000</bug_when>
    <thetext>Similar bug affects Yakuake, see bug 437163</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072091</commentid>
    <comment_count>6</comment_count>
    <who name="">guimarcalsilva</who>
    <bug_when>2021-10-25 20:06:32 +0000</bug_when>
    <thetext>On System Settings this bug doesn&apos;t happen because clicking on the hamburger menu focuses the window first and then you have to click again to activate it. Would it be possible to make the hamburger menu non-interactive if the window is unfocused?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2072432</commentid>
    <comment_count>7</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2021-10-26 15:40:02 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfigwidgets/-/merge_requests/83</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2076334</commentid>
    <comment_count>8</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2021-11-09 17:23:04 +0000</bug_when>
    <thetext>Git commit 82c40f18709484fd462643aa113a8ccf961b646a by Nate Graham, on behalf of Felix Ernst.
Committed on 09/11/2021 at 17:22.
Pushed by ngraham into branch &apos;master&apos;.

Fix hamburger menu opening as a window on Wayland

Before this commit, if an app window is unfocused and the first
click on the window is the hamburger menu button, the menu would
appear displaced as a separate window on Wayland.

This commit fixes this by setting a sane transientParent for the
menu. This is slightly difficult because there can be any number
of hamburger buttons in any number of different windows so we need
to figure out spontaneously which button was pressed to open the
menu.

M  +24   -2    src/khamburgermenuhelpers.cpp
M  +1    -1    src/khamburgermenuhelpers_p.h

https://invent.kde.org/frameworks/kconfigwidgets/commit/82c40f18709484fd462643aa113a8ccf961b646a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2169949</commentid>
    <comment_count>9</comment_count>
    <who name="Felix Ernst">felixernst</who>
    <bug_when>2022-11-06 23:27:01 +0000</bug_when>
    <thetext>*** Bug 444355 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>