Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add window-menu plugin #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add window-menu plugin #65

wants to merge 1 commit into from

Conversation

soreau
Copy link
Member

@soreau soreau commented Nov 30, 2020

No description provided.

@soreau soreau force-pushed the window-menu branch 2 times, most recently from 2f19520 to 157baa2 Compare November 30, 2020 10:20
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few suggestions

src/window-menu.cpp Outdated Show resolved Hide resolved
src/window-menu.cpp Outdated Show resolved Hide resolved
src/window-menu.cpp Outdated Show resolved Hide resolved
src/window-menu.cpp Outdated Show resolved Hide resolved
@AdrianVovk
Copy link

Doesn't the window menu depend on which view triggers it? For example, some views aren't maximizable. Or views might be maximized already and so the menu should show "restore" instead of maximize. And it's "always on top" state also depends on if it's set to be always on top or not

@soreau
Copy link
Member Author

soreau commented Nov 30, 2020

Doesn't the window menu depend on which view triggers it? For example, some views aren't maximizable. Or views might be maximized already and so the menu should show "restore" instead of maximize. And it's "always on top" state also depends on if it's set to be always on top or not

I imagine there would be some initial communication, either via command line arguments or protocol/dbus, so the menu knows what initial state to put items and what items to show.

@soreau soreau force-pushed the window-menu branch 5 times, most recently from e4a2f9b to cf93fb4 Compare December 1, 2020 00:09
@AdrianVovk
Copy link

@soreau Ping me when/how that's implemented?

This plugin handles the xdg.show_window_menu signal. It launches a menu
and positions it on screen. Additionally, it undecorates the menu, so that
set_decorated(false) works for gtk clients. (Currently gtk3 has a bug such
that disabling the decorations tells the compositor to decorate it.)
@soreau
Copy link
Member Author

soreau commented Dec 5, 2020

There are a few issues with this plugin, namely crashes related to this bug, which should be fixed first. Also, a menu application is needed that communicates with wayfire, either through dbus or native protocol. This would be used to facilitate functionality such as minimize/maximize/close/switch workspaces/show desktop/scale views/etc.

Basic steps to use this plugin with nwgcc:

  • Install nwgcc and make sure a menu shows when calling nwgcc
  • Install the window-menu branch of this PR
  • Enable the Window Menu plugin

You should be able to right-click on a gtk titlebar and the menu will show.

@nwg-piotr
Copy link

@soreau In case you're interested: I've coded the alternative nwgocc command in Go. For now it won't work standalone (needs nwgcc installed), but it executes twice as fast as the python version. See https://github.com/nwg-piotr/nwgocc.

@soreau
Copy link
Member Author

soreau commented Dec 31, 2020

@soreau In case you're interested: I've coded the alternative nwgocc command in Go. For now it won't work standalone (needs nwgcc installed), but it executes twice as fast as the python version. See https://github.com/nwg-piotr/nwgocc.

That's nice! I have experimented with writing my own menu using native wayland protocol here. The menu is gtkmm4 and I intend to move it to its own repository, but the rest is window-menu plugin merged with another plugin to enable and disable protocols. So far it only supports Minimize, Maximize and Close but it has potential to call any action within wayfire.

@nwg-piotr
Copy link

Fingers crossed! The damned gtkmm still gives me a headache. ;)

In the meantime I developed a full GUI, and merged all the stuff from the preferences branch a minute ago. nwgocc should now work fully standalone, but needs testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants