Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions compositor/PantheonShell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,27 @@ namespace GreeterCompositor {
focus (panel_surface.wayland_surface);
}

internal static void focus_extended_behavior (Wl.Client client, Wl.Resource resource) {
unowned ExtendedBehaviorSurface? extended_behavior_surface = resource.get_user_data<ExtendedBehaviorSurface> ();
if (extended_behavior_surface.wayland_surface == null) {
warning ("Window tried to focus but wayland surface is null.");
return;
}

focus (extended_behavior_surface.wayland_surface);
}

internal static void focus (Object wayland_surface) {
Meta.Window? window;
wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to focus but wayland surface had no associated window.");
return;
}

window.focus (window.get_display ().get_current_time ());
}

internal static void set_size (Wl.Client client, Wl.Resource resource, int width, int height) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
Expand Down Expand Up @@ -370,27 +391,6 @@ namespace GreeterCompositor {
ShellClientsManager.get_instance ().init_greeter (window);
}

internal static void focus_extended_behavior (Wl.Client client, Wl.Resource resource) {
unowned ExtendedBehaviorSurface? extended_behavior_surface = resource.get_user_data<ExtendedBehaviorSurface> ();
if (extended_behavior_surface.wayland_surface == null) {
warning ("Window tried to focus but wayland surface is null.");
return;
}

focus (extended_behavior_surface.wayland_surface);
}

internal static void focus (Object wayland_surface) {
Meta.Window? window;
wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to focus but wayland surface had no associated window.");
return;
}

window.focus (window.get_display ().get_current_time ());
}

internal static void set_keep_above (Wl.Client client, Wl.Resource resource) {
unowned ExtendedBehaviorSurface? eb_surface = resource.get_user_data<ExtendedBehaviorSurface> ();
if (eb_surface.wayland_surface == null) {
Expand Down
Loading