PantheonShell: Add more warnings (#1929)

This commit is contained in:
Leonhard 2024-05-28 19:59:39 +02:00 committed by GitHub
parent 8e361c31c2
commit 3a40014d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -228,12 +228,14 @@ namespace Gala {
internal static void set_anchor (Wl.Client client, Wl.Resource resource, [CCode (type = "uint32_t")] Pantheon.Desktop.Anchor anchor) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
warning ("Window tried to set anchor but wayland surface is null.");
return;
}
Meta.Window? window;
panel_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to set anchor but wayland surface had no associated window.");
return;
}
@ -261,12 +263,14 @@ namespace Gala {
internal static void focus (Wl.Client client, Wl.Resource resource) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
warning ("Window tried to focus but wayland surface is null.");
return;
}
Meta.Window? window;
panel_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to focus but wayland surface had no associated window.");
return;
}
@ -276,12 +280,14 @@ namespace Gala {
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) {
warning ("Window tried to set size but wayland surface is null.");
return;
}
Meta.Window? window;
panel_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to set size but wayland surface had no associated window.");
return;
}
@ -291,12 +297,14 @@ namespace Gala {
internal static void set_hide_mode (Wl.Client client, Wl.Resource resource, [CCode (type = "uint32_t")] Pantheon.Desktop.HideMode hide_mode) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
warning ("Window tried to set hide mode but wayland surface is null.");
return;
}
Meta.Window? window;
panel_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to set hide mode but wayland surface had no associated window.");
return;
}