mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
npopupcontextmenu: smart positioning?
This commit is contained in:
@@ -64,7 +64,8 @@ Singleton {
|
||||
}
|
||||
|
||||
// Show a context menu with proper handling for all compositors
|
||||
function showContextMenu(contextMenu, anchorItem, screen) {
|
||||
// Optional targetItem: if provided, menu will be horizontally centered on this item instead of anchorItem
|
||||
function showContextMenu(contextMenu, anchorItem, screen, targetItem) {
|
||||
if (!contextMenu || !anchorItem)
|
||||
return;
|
||||
|
||||
@@ -74,7 +75,7 @@ Singleton {
|
||||
var popupMenuWindow = getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
contextMenu.openAtItem(anchorItem, screen);
|
||||
contextMenu.openAtItem(anchorItem, screen, targetItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user