@@ -22,7 +22,6 @@ namespace Gala {
22
22
[DBus (name = "org .pantheon .gala .daemon ")]
23
23
public interface Daemon: GLib.Object {
24
24
public abstract async void show_window_menu (WindowFlags flags, int x, int y) throws Error ;
25
- public abstract async void show_desktop_menu (int x, int y) throws Error ;
26
25
}
27
26
28
27
public class WindowManagerGala : Meta .Plugin , WindowManager {
@@ -982,53 +981,48 @@ namespace Gala {
982
981
public override void show_window_menu (Meta .Window window , Meta .WindowMenuType menu , int x , int y ) {
983
982
switch (menu) {
984
983
case Meta . WindowMenuType . WM:
985
- warning (" CREATE MENU" );
986
- var window_menu = new BackgroundMenu (this );
987
- ui_group. add_child (window_menu);
988
- window_menu. set_position (x, y);
989
- window_menu. open_menu ();
990
- // if (daemon_proxy == null || window.get_window_type () == Meta.WindowType.NOTIFICATION) {
991
- // return;
992
- // }
993
-
994
- // WindowFlags flags = WindowFlags.NONE;
995
- // if (window.can_minimize ())
996
- // flags |= WindowFlags.CAN_HIDE;
997
-
998
- // if (window.can_maximize ())
999
- // flags |= WindowFlags.CAN_MAXIMIZE;
1000
-
1001
- // var maximize_flags = window.get_maximized ();
1002
- // if (maximize_flags > 0) {
1003
- // flags |= WindowFlags.IS_MAXIMIZED;
1004
-
1005
- // if (Meta.MaximizeFlags.VERTICAL in maximize_flags && !(Meta.MaximizeFlags.HORIZONTAL in maximize_flags)) {
1006
- // flags |= WindowFlags.IS_TILED;
1007
- // }
1008
- // }
1009
-
1010
- // if (window.allows_move ())
1011
- // flags |= WindowFlags.ALLOWS_MOVE;
1012
-
1013
- // if (window.allows_resize ())
1014
- // flags |= WindowFlags.ALLOWS_RESIZE;
1015
-
1016
- // if (window.is_above ())
1017
- // flags |= WindowFlags.ALWAYS_ON_TOP;
1018
-
1019
- // if (window.on_all_workspaces)
1020
- // flags |= WindowFlags.ON_ALL_WORKSPACES;
1021
-
1022
- // if (window.can_close ())
1023
- // flags |= WindowFlags.CAN_CLOSE;
1024
-
1025
- // daemon_proxy.show_window_menu.begin (flags, x, y, (obj, res) => {
1026
- // try {
1027
- // ((Daemon) obj).show_window_menu.end (res);
1028
- // } catch (Error e) {
1029
- // message ("Error invoking MenuManager: %s", e.message);
1030
- // }
1031
- // });
984
+ if (daemon_proxy == null || window. get_window_type () == Meta . WindowType . NOTIFICATION ) {
985
+ return ;
986
+ }
987
+
988
+ WindowFlags flags = WindowFlags . NONE ;
989
+ if (window. can_minimize ())
990
+ flags |= WindowFlags . CAN_HIDE ;
991
+
992
+ if (window. can_maximize ())
993
+ flags |= WindowFlags . CAN_MAXIMIZE ;
994
+
995
+ var maximize_flags = window. get_maximized ();
996
+ if (maximize_flags > 0 ) {
997
+ flags |= WindowFlags . IS_MAXIMIZED ;
998
+
999
+ if (Meta . MaximizeFlags . VERTICAL in maximize_flags && ! (Meta . MaximizeFlags . HORIZONTAL in maximize_flags)) {
1000
+ flags |= WindowFlags . IS_TILED ;
1001
+ }
1002
+ }
1003
+
1004
+ if (window. allows_move ())
1005
+ flags |= WindowFlags . ALLOWS_MOVE ;
1006
+
1007
+ if (window. allows_resize ())
1008
+ flags |= WindowFlags . ALLOWS_RESIZE ;
1009
+
1010
+ if (window. is_above ())
1011
+ flags |= WindowFlags . ALWAYS_ON_TOP ;
1012
+
1013
+ if (window. on_all_workspaces)
1014
+ flags |= WindowFlags . ON_ALL_WORKSPACES ;
1015
+
1016
+ if (window. can_close ())
1017
+ flags |= WindowFlags . CAN_CLOSE ;
1018
+
1019
+ daemon_proxy. show_window_menu. begin (flags, x, y, (obj, res) = > {
1020
+ try {
1021
+ ((Daemon ) obj). show_window_menu. end (res);
1022
+ } catch (Error e) {
1023
+ message (" Error invoking MenuManager: %s " , e. message);
1024
+ }
1025
+ });
1032
1026
break ;
1033
1027
case Meta . WindowMenuType . APP:
1034
1028
// FIXME we don't have any sort of app menus
0 commit comments