Bug 366255 - Add "Operations Menu" option to Window Actions list
Summary: Add "Operations Menu" option to Window Actions list
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.7.3
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2016-07-29 18:16 UTC by Jonathan Sambrook
Modified: 2021-01-22 02:25 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Provisory patch for the implementation (1.81 KB, patch)
2017-10-07 14:00 UTC, Marcos Luiz Cassarini Taranta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Sambrook 2016-07-29 18:16:30 UTC
I'd like to be able to trigger the "Operation Menu" on windows I've set to "No titlebar and frame". 

The most natural way is with my preferred meta key and a right click.

Please consider adding an "Operation Menu"  option to the "Window Actions" "Inner window, titlebar and frame" dropdowns.

Thanks.


Reproducible: Always
Comment 1 Kai Uwe Broulik 2016-08-03 12:49:56 UTC
You can press Alt+F3 to open said menu. Re-assigning to kwin as it is responsible for window decorations.
Comment 2 Marcos Luiz Cassarini Taranta 2017-10-07 14:00:11 UTC
Created attachment 108221 [details]
Provisory patch for the implementation

I've done the implementation.
The problem is that as soon as you activate the operations menu using the mouse, you'll get a SIGSEGV for some weird painting reason.
Comment 3 Martin Flöser 2017-10-07 16:02:16 UTC
@Marcos: could you add the backtrace? Then I might be able to give you a hint where the problem is.
Comment 4 Marcos Luiz Cassarini Taranta 2017-10-09 23:32:49 UTC
(In reply to Martin Flöser from comment #3)
> @Marcos: could you add the backtrace? Then I might be able to give you a
> hint where the problem is.

My bad, I don't get the SIGSEGV, maybe it was something that happened one time for whatever reason

But when you invoke the operations menu by the mouse, you are stuck with the menu open but can't click anywhere outside the menu, also you can't close it by pressing esc or invoking another operations menu. The way that I use to get back to control my DE by mouse, is by invoking the krunner using alt+f2.

I'm looking at the code in the meantime to figure out what is the problem here.
Comment 5 Martin Flöser 2017-10-10 04:16:48 UTC
It's a problem with the grab. Probably KWin holds a grab from the moment when you click. Then Qt tries to perform a grab when the menu opens, that fails and so Qt doesn't listen for the release.
Comment 6 Marcos Luiz Cassarini Taranta 2017-10-10 11:54:01 UTC
(In reply to Martin Flöser from comment #5)
> It's a problem with the grab. Probably KWin holds a grab from the moment
> when you click. Then Qt tries to perform a grab when the menu opens, that
> fails and so Qt doesn't listen for the release.

Yesterday I've done some debugging and found that in the show method of the operations menu instance, there's a check if wayland is being used, if it is the QMenu::popup is called, if it isn't the QMenu::exec method is called, the popup method works perfectly (I'm using Xorg) while the exec doesn't.
But the interesting part is that this show method is called from the mouse and from the keyboard, and just acts strange with the QMenu::exec by mouse.
Comment 7 Thiago Sueto 2021-01-22 02:25:19 UTC
Hello Marcos, any progress on this patch?
From what I gather, under System Settings > Window management > Window behavior > Window actions > Modifier key Meta + Right click, there's still no option for this, so it wasn't merged yet.
Since the patch was mostly done at that time, you could work on it again and create a WIP merge request over invent.kde.org for proper code review.