Skip to content

can i popup a menu to center of screen #272

Answered by Consolatis
knm100 asked this question in Q&A
Discussion options

You must be logged in to vote

The question is also what menu refers to. If you mean something like a context menu then no as explained above. If you mean a bigger surface with buttons and the like that might be possible. See this python snippet:

#!/usr/bin/env python3

import gi
gi.require_version("Gtk", "3.0")
gi.require_version('GtkLayerShell', '0.1')
from gi.repository import Gtk, GtkLayerShell

if __name__ == '__main__':
	win = Gtk.Window()
	GtkLayerShell.init_for_window(win)
	GtkLayerShell.set_layer(win, GtkLayerShell.Layer.TOP)
	win.set_size_request(640, 480)
	win.show()
	Gtk.main()

This uses the fact that the wlr-layershell protocol states that layershell surfaces without anchors are centered.

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@knm100
Comment options

Answer selected by knm100
Comment options

You must be logged in to vote
1 reply
@Consolatis
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@knm100
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants