aboutsummaryrefslogtreecommitdiff
path: root/src/shutdown-dialog.vala
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-05-05 05:19:44 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-05-07 20:52:12 +0200
commit0718f264357a13b1a55cadcb7eb6a5774b7dd7eb (patch)
tree9c44342564d431dfaf24cd8f61d5d63c44171eed /src/shutdown-dialog.vala
parentc9b2de2b43d1575a85b5d0344c4a0bd1eb9f93fa (diff)
downloadarctica-greeter-0718f264357a13b1a55cadcb7eb6a5774b7dd7eb.tar.gz
arctica-greeter-0718f264357a13b1a55cadcb7eb6a5774b7dd7eb.tar.bz2
arctica-greeter-0718f264357a13b1a55cadcb7eb6a5774b7dd7eb.zip
Fix casting issues
Diffstat (limited to 'src/shutdown-dialog.vala')
-rw-r--r--src/shutdown-dialog.vala18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/shutdown-dialog.vala b/src/shutdown-dialog.vala
index c30ea0e..9c5be6e 100644
--- a/src/shutdown-dialog.vala
+++ b/src/shutdown-dialog.vala
@@ -363,19 +363,26 @@ public class ShutdownDialog : Gtk.Fixed
public void focus_next ()
{
- (get_toplevel () as Gtk.Window).move_focus (Gtk.DirectionType.TAB_FORWARD);
+ Gtk.Window pWindow = (Gtk.Window) get_toplevel ();
+ pWindow.move_focus (Gtk.DirectionType.TAB_FORWARD);
}
public void focus_prev ()
{
- (get_toplevel () as Gtk.Window).move_focus (Gtk.DirectionType.TAB_BACKWARD);
+ Gtk.Window pWindow = (Gtk.Window) get_toplevel ();
+ pWindow.move_focus (Gtk.DirectionType.TAB_BACKWARD);
}
public void cancel ()
{
- var widget = (get_toplevel () as Gtk.Window).get_focus ();
+ Gtk.Window pWindow = (Gtk.Window) get_toplevel ();
+ var widget = pWindow.get_focus ();
+
if (widget is DialogButton)
- (get_toplevel () as Gtk.Window).set_focus (null);
+ {
+ pWindow = (Gtk.Window) get_toplevel ();
+ pWindow.set_focus (null);
+ }
else
close ();
}
@@ -628,7 +635,8 @@ private class DialogButton : Gtk.Button
public override bool leave_notify_event (Gdk.EventCrossing event)
{
- (get_toplevel () as Gtk.Window).set_focus (null);
+ Gtk.Window pWindow = (Gtk.Window) get_toplevel ();
+ pWindow.set_focus (null);
return base.leave_notify_event (event);
}