diff --git a/lib/PositionManager.vala b/lib/PositionManager.vala index e1dfa447..a430cd1a 100644 --- a/lib/PositionManager.vala +++ b/lib/PositionManager.vala @@ -65,7 +65,7 @@ namespace Plank screen.composited_changed.connect (screen_composited_changed); // NOTE don't call update_monitor_geo to avoid a double-call of dockwindow.set_size on startup - if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU)) { + if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU | XdgSessionDesktop.MATE)) { screen.get_monitor_geometry (find_monitor_number (screen, controller.prefs.Monitor), out monitor_geo); } else { monitor_geo = screen.get_monitor_workarea (find_monitor_number (screen, controller.prefs.Monitor)); @@ -137,10 +137,14 @@ namespace Plank void screen_changed (Gdk.Screen screen) { var old_monitor_geo = monitor_geo; + + Logger.verbose ("screen_changed()"); - if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU)) { + if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU | XdgSessionDesktop.MATE)) { + Logger.verbose ("Gnome, Ubuntu or Mate."); screen.get_monitor_geometry (find_monitor_number (screen, controller.prefs.Monitor), out monitor_geo); } else { + Logger.verbose ("Another XdgSessionDesktop env."); monitor_geo = screen.get_monitor_workarea (find_monitor_number (screen, controller.prefs.Monitor)); } diff --git a/lib/Services/Environment.vala b/lib/Services/Environment.vala index e7f7db29..0544795f 100644 --- a/lib/Services/Environment.vala +++ b/lib/Services/Environment.vala @@ -154,7 +154,7 @@ namespace Plank public static bool environment_is_session_desktop (XdgSessionDesktop type) { - return (type in session_desktop); + return (type & session_desktop) > 0; } public static bool environment_is_session_type (XdgSessionType type) diff --git a/lib/Widgets/HoverWindow.vala b/lib/Widgets/HoverWindow.vala index 47b747d0..02c88f00 100644 --- a/lib/Widgets/HoverWindow.vala +++ b/lib/Widgets/HoverWindow.vala @@ -76,7 +76,7 @@ namespace Plank { unowned Gdk.Screen screen = get_screen (); Gdk.Rectangle monitor; - if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU)) { + if (environment_is_session_desktop (XdgSessionDesktop.GNOME | XdgSessionDesktop.UBUNTU | XdgSessionDesktop.MATE)) { screen.get_monitor_geometry (screen.get_monitor_at_point (x, y), out monitor); } else { monitor = screen.get_monitor_workarea (screen.get_monitor_at_point (x, y));