[gnome-games/wip/exalm/gtk4: 9/28] ui: Replace GdkWindow with GdkSurface



commit 9c0c10434add598f71b606b2bdc680f16aefe5c0
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Jul 29 01:16:22 2018 +0500

    ui: Replace GdkWindow with GdkSurface

 src/ui/application-window.vala |  6 +++---
 src/ui/fullscreen-box.vala     | 14 +++++++-------
 src/ui/game-thumbnail.vala     |  8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index f952e45e..e24305c7 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -535,11 +535,11 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (display == null)
                        return null;
 
-               var window = get_window ();
-               if (window == null)
+               var surface = get_surface ();
+               if (surface == null)
                        return null;
 
-               var monitor = display.get_monitor_at_window (window);
+               var monitor = display.get_monitor_at_surface (surface);
                if (monitor == null)
                        return null;
 
diff --git a/src/ui/fullscreen-box.vala b/src/ui/fullscreen-box.vala
index 0c0a45ad..4f86b83d 100644
--- a/src/ui/fullscreen-box.vala
+++ b/src/ui/fullscreen-box.vala
@@ -109,19 +109,19 @@ private class Games.FullscreenBox : Gtk.Bin, Gtk.Buildable {
        }
 
        private void show_cursor (bool show) {
-               var window = get_window ();
-               if (window == null)
+               var surface = get_surface ();
+               if (surface == null)
                        return;
 
-               if ((show && window.cursor == null) ||
-                   (!show && window.cursor != null))
+               if ((show && surface.cursor == null) ||
+                   (!show && surface.cursor != null))
                        return;
 
                if (!show) {
-                       var display = window.get_display ();
-                       window.cursor = new Gdk.Cursor.for_display (display, Gdk.CursorType.BLANK_CURSOR);
+                       var display = surface.get_display ();
+                       surface.cursor = new Gdk.Cursor.for_display (display, Gdk.CursorType.BLANK_CURSOR);
                }
                else
-                       window.cursor = null;
+                       surface.cursor = null;
        }
 }
diff --git a/src/ui/game-thumbnail.vala b/src/ui/game-thumbnail.vala
index bfd69177..d5960fb9 100644
--- a/src/ui/game-thumbnail.vala
+++ b/src/ui/game-thumbnail.vala
@@ -60,7 +60,7 @@ private class Games.GameThumbnail : Gtk.DrawingArea {
 
        public struct DrawingContext {
                Cairo.Context cr;
-               Gdk.Window? window;
+               Gdk.Surface? surface;
                Gtk.StyleContext style;
                Gtk.StateFlags state;
                int width;
@@ -80,14 +80,14 @@ private class Games.GameThumbnail : Gtk.DrawingArea {
        }
 
        public override bool draw (Cairo.Context cr) {
-               var window = get_window ();
+               var surface = get_surface ();
                var style = get_style_context ();
                var state = get_state_flags ();
                var width = get_allocated_width ();
                var height = get_allocated_height ();
 
                DrawingContext context = {
-                       cr, window, style, state, width, height
+                       cr, surface, style, state, width, height
                };
 
                if (icon == null)
@@ -297,7 +297,7 @@ private class Games.GameThumbnail : Gtk.DrawingArea {
        }
 
        private void draw_pixbuf (DrawingContext context, Gdk.Pixbuf pixbuf) {
-               var surface = Gdk.cairo_surface_create_from_pixbuf (pixbuf, 1, context.window);
+               var surface = Gdk.cairo_surface_create_from_pixbuf (pixbuf, 1, context.surface);
 
                var mask = get_mask (context);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]