aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-17 16:04:18 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-05-17 16:04:18 +0200
commit8dd317d9572ce879b62bb311863b7c08a2547fe7 (patch)
treec89152b8d3ee07ba76676729aac43919a2032ae4 /src
parentc9f0793b67d2eea7f95f83211e4a9d729fbcc024 (diff)
downloadarctica-greeter-8dd317d9572ce879b62bb311863b7c08a2547fe7.tar.gz
arctica-greeter-8dd317d9572ce879b62bb311863b7c08a2547fe7.tar.bz2
arctica-greeter-8dd317d9572ce879b62bb311863b7c08a2547fe7.zip
Silence GTK 3.22 warnings relating to deprecation in Gdk.Screen.
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala4
-rw-r--r--src/main-window.vala38
-rw-r--r--src/menubar.vala6
3 files changed, 30 insertions, 18 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 73d6650..25cf962 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -185,7 +185,9 @@ public class ArcticaGreeter
{
/* Explicitly set the right scale before closing window */
var screen = Gdk.Screen.get_default ();
- var scale = screen.get_monitor_scale_factor (screen.get_number ());
+ var display = Gdk.Display.get_default();
+ var monitor = display.get_primary_monitor();
+ var scale = monitor.get_scale_factor ();
background_surface.set_device_scale (scale, scale);
/* Paint our background onto the root window before we close our own window */
diff --git a/src/main-window.vala b/src/main-window.vala
index b7c59bb..b818968 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -181,24 +181,30 @@ public class MainWindow : Gtk.Window
private void monitors_changed_cb (Gdk.Screen screen)
{
- int primary = screen.get_primary_monitor ();
- debug ("Screen is %dx%d pixels", screen.get_width (), screen.get_height ());
+ Gdk.Display display;
+ display = screen.get_display();
+
+ Gdk.Rectangle geometry;
+ Gdk.Monitor primary = display.get_primary_monitor();
+ geometry = primary.get_geometry();
+ debug ("Screen is %dx%d pixels", geometry.width, geometry.height);
+
monitors = new List<Monitor> ();
primary_monitor = null;
- for (var i = 0; i < screen.get_n_monitors (); i++)
+ for (var i = 0; i < display.get_n_monitors (); i++)
{
- Gdk.Rectangle geometry;
- screen.get_monitor_geometry (i, out geometry);
+ Gdk.Monitor monitor = display.get_monitor(i);
+ geometry = monitor.get_geometry ();
debug ("Monitor %d is %dx%d pixels at %d,%d", i, geometry.width, geometry.height, geometry.x, geometry.y);
- if (monitor_is_unique_position (screen, i))
+ if (monitor_is_unique_position (display, i))
{
- var monitor = new Monitor (geometry.x, geometry.y, geometry.width, geometry.height);
- monitors.append (monitor);
+ var greeter_monitor = new Monitor (geometry.x, geometry.y, geometry.width, geometry.height);
+ monitors.append (greeter_monitor);
- if (primary_monitor == null || i == primary)
- primary_monitor = monitor;
+ if (primary_monitor == null || primary == monitor)
+ primary_monitor = greeter_monitor;
}
}
@@ -209,15 +215,19 @@ public class MainWindow : Gtk.Window
}
/* Check if a monitor has a unique position */
- private bool monitor_is_unique_position (Gdk.Screen screen, int n)
+ private bool monitor_is_unique_position (Gdk.Display display, int n)
{
Gdk.Rectangle g0;
- screen.get_monitor_geometry (n, out g0);
+ Gdk.Monitor mon0;
+ mon0 = display.get_monitor(n);
+ g0 = mon0.get_geometry ();
- for (var i = n + 1; i < screen.get_n_monitors (); i++)
+ for (var i = n + 1; i < display.get_n_monitors (); i++)
{
Gdk.Rectangle g1;
- screen.get_monitor_geometry (i, out g1);
+ Gdk.Monitor mon1;
+ mon1 = display.get_monitor(i);
+ g1 = mon1.get_geometry();
if (g0.x == g1.x && g0.y == g1.y)
return false;
diff --git a/src/menubar.vala b/src/menubar.vala
index 9735a38..edc6563 100644
--- a/src/menubar.vala
+++ b/src/menubar.vala
@@ -418,10 +418,10 @@ public class MenuBar : Gtk.MenuBar
keyboard_socket.add_id (id);
/* Put keyboard at the bottom of the screen */
- var screen = get_screen ();
- var monitor = screen.get_monitor_at_window (get_window ());
+ var display = get_display ();
+ var monitor = display.get_monitor_at_window (get_window ());
Gdk.Rectangle geom;
- screen.get_monitor_geometry (monitor, out geom);
+ geom = monitor.get_geometry ();
keyboard_window.move (geom.x, geom.y + geom.height - 200);
keyboard_window.resize (geom.width, 200);
}