|
|
776610 |
From b5ea81b0356884dca6d362d61df4f68e9e84e0b3 Mon Sep 17 00:00:00 2001
|
|
|
776610 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
776610 |
Date: Tue, 15 Jan 2019 10:29:55 -0500
|
|
|
776610 |
Subject: [PATCH 7/9] backends/native: update cursor on resume
|
|
|
776610 |
|
|
|
776610 |
As mentioned in a previous commit, the proprietary NVIDIA
|
|
|
776610 |
driver garbles memory on suspend. That behavior, means that
|
|
|
776610 |
the cursor gets corrupted on suspend.
|
|
|
776610 |
|
|
|
776610 |
This commit forces the cursor to redraw itself when the
|
|
|
776610 |
logind session becomes active (on VT switch and resume).
|
|
|
776610 |
---
|
|
|
776610 |
src/backends/native/meta-backend-native.c | 1 +
|
|
|
776610 |
src/core/screen-private.h | 2 --
|
|
|
776610 |
src/meta/screen.h | 3 +++
|
|
|
776610 |
3 files changed, 4 insertions(+), 2 deletions(-)
|
|
|
776610 |
|
|
|
776610 |
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
|
|
|
776610 |
index 0730a4acb..fd95dfc11 100644
|
|
|
776610 |
--- a/src/backends/native/meta-backend-native.c
|
|
|
776610 |
+++ b/src/backends/native/meta-backend-native.c
|
|
|
776610 |
@@ -628,44 +628,45 @@ meta_backend_native_pause (MetaBackendNative *native)
|
|
|
776610 |
{
|
|
|
776610 |
MetaBackend *backend = META_BACKEND (native);
|
|
|
776610 |
MetaMonitorManager *monitor_manager =
|
|
|
776610 |
meta_backend_get_monitor_manager (backend);
|
|
|
776610 |
MetaMonitorManagerKms *monitor_manager_kms =
|
|
|
776610 |
META_MONITOR_MANAGER_KMS (monitor_manager);
|
|
|
776610 |
|
|
|
776610 |
clutter_evdev_release_devices ();
|
|
|
776610 |
clutter_egl_freeze_master_clock ();
|
|
|
776610 |
|
|
|
776610 |
meta_monitor_manager_kms_pause (monitor_manager_kms);
|
|
|
776610 |
}
|
|
|
776610 |
|
|
|
776610 |
void meta_backend_native_resume (MetaBackendNative *native)
|
|
|
776610 |
{
|
|
|
776610 |
MetaBackend *backend = META_BACKEND (native);
|
|
|
776610 |
MetaMonitorManager *monitor_manager =
|
|
|
776610 |
meta_backend_get_monitor_manager (backend);
|
|
|
776610 |
MetaMonitorManagerKms *monitor_manager_kms =
|
|
|
776610 |
META_MONITOR_MANAGER_KMS (monitor_manager);
|
|
|
776610 |
MetaDisplay *display = meta_get_display ();
|
|
|
776610 |
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
|
|
776610 |
CoglContext *cogl_context =
|
|
|
776610 |
clutter_backend_get_cogl_context (clutter_backend);
|
|
|
776610 |
ClutterActor *stage;
|
|
|
776610 |
MetaIdleMonitor *idle_monitor;
|
|
|
776610 |
|
|
|
776610 |
if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
|
|
|
776610 |
{
|
|
|
776610 |
clutter_clear_glyph_cache ();
|
|
|
776610 |
+ meta_screen_update_cursor (display->screen);
|
|
|
776610 |
g_signal_emit_by_name (display, "gl-video-memory-purged");
|
|
|
776610 |
}
|
|
|
776610 |
|
|
|
776610 |
meta_monitor_manager_kms_resume (monitor_manager_kms);
|
|
|
776610 |
|
|
|
776610 |
clutter_evdev_reclaim_devices ();
|
|
|
776610 |
clutter_egl_thaw_master_clock ();
|
|
|
776610 |
|
|
|
776610 |
stage = meta_backend_get_stage (backend);
|
|
|
776610 |
clutter_actor_queue_redraw (stage);
|
|
|
776610 |
|
|
|
776610 |
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
|
|
|
776610 |
meta_idle_monitor_reset_idletime (idle_monitor);
|
|
|
776610 |
}
|
|
|
776610 |
diff --git a/src/core/screen-private.h b/src/core/screen-private.h
|
|
|
776610 |
index ff796f01a..37f2a01a1 100644
|
|
|
776610 |
--- a/src/core/screen-private.h
|
|
|
776610 |
+++ b/src/core/screen-private.h
|
|
|
776610 |
@@ -95,62 +95,60 @@ struct _MetaScreen
|
|
|
776610 |
int closing;
|
|
|
776610 |
|
|
|
776610 |
/* Instead of unmapping withdrawn windows we can leave them mapped
|
|
|
776610 |
* and restack them below a guard window. When using a compositor
|
|
|
776610 |
* this allows us to provide live previews of unmapped windows */
|
|
|
776610 |
Window guard_window;
|
|
|
776610 |
|
|
|
776610 |
Window composite_overlay_window;
|
|
|
776610 |
};
|
|
|
776610 |
|
|
|
776610 |
struct _MetaScreenClass
|
|
|
776610 |
{
|
|
|
776610 |
GObjectClass parent_class;
|
|
|
776610 |
|
|
|
776610 |
void (*restacked) (MetaScreen *);
|
|
|
776610 |
void (*workareas_changed) (MetaScreen *);
|
|
|
776610 |
void (*monitors_changed) (MetaScreen *);
|
|
|
776610 |
};
|
|
|
776610 |
|
|
|
776610 |
MetaScreen* meta_screen_new (MetaDisplay *display,
|
|
|
776610 |
guint32 timestamp);
|
|
|
776610 |
void meta_screen_free (MetaScreen *screen,
|
|
|
776610 |
guint32 timestamp);
|
|
|
776610 |
void meta_screen_init_workspaces (MetaScreen *screen);
|
|
|
776610 |
void meta_screen_manage_all_windows (MetaScreen *screen);
|
|
|
776610 |
void meta_screen_foreach_window (MetaScreen *screen,
|
|
|
776610 |
MetaListWindowsFlags flags,
|
|
|
776610 |
MetaScreenWindowFunc func,
|
|
|
776610 |
gpointer data);
|
|
|
776610 |
|
|
|
776610 |
-void meta_screen_update_cursor (MetaScreen *screen);
|
|
|
776610 |
-
|
|
|
776610 |
void meta_screen_update_tile_preview (MetaScreen *screen,
|
|
|
776610 |
gboolean delay);
|
|
|
776610 |
void meta_screen_hide_tile_preview (MetaScreen *screen);
|
|
|
776610 |
|
|
|
776610 |
MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
|
|
|
776610 |
MetaWindow *not_this_one);
|
|
|
776610 |
|
|
|
776610 |
void meta_screen_update_workspace_layout (MetaScreen *screen);
|
|
|
776610 |
void meta_screen_update_workspace_names (MetaScreen *screen);
|
|
|
776610 |
void meta_screen_queue_workarea_recalc (MetaScreen *screen);
|
|
|
776610 |
void meta_screen_queue_check_fullscreen (MetaScreen *screen);
|
|
|
776610 |
|
|
|
776610 |
|
|
|
776610 |
Window meta_create_offscreen_window (Display *xdisplay,
|
|
|
776610 |
Window parent,
|
|
|
776610 |
long valuemask);
|
|
|
776610 |
|
|
|
776610 |
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
|
|
|
776610 |
|
|
|
776610 |
struct MetaWorkspaceLayout
|
|
|
776610 |
{
|
|
|
776610 |
int rows;
|
|
|
776610 |
int cols;
|
|
|
776610 |
int *grid;
|
|
|
776610 |
int grid_area;
|
|
|
776610 |
int current_row;
|
|
|
776610 |
int current_col;
|
|
|
776610 |
};
|
|
|
776610 |
|
|
|
776610 |
void meta_screen_calc_workspace_layout (MetaScreen *screen,
|
|
|
776610 |
diff --git a/src/meta/screen.h b/src/meta/screen.h
|
|
|
776610 |
index 13c92516e..36c397418 100644
|
|
|
776610 |
--- a/src/meta/screen.h
|
|
|
776610 |
+++ b/src/meta/screen.h
|
|
|
776610 |
@@ -98,31 +98,34 @@ int meta_screen_get_monitor_neighbor_index (MetaScreen *screen,
|
|
|
776610 |
int which_monitor,
|
|
|
776610 |
MetaScreenDirection dir);
|
|
|
776610 |
|
|
|
776610 |
void meta_screen_focus_default_window (MetaScreen *screen,
|
|
|
776610 |
guint32 timestamp);
|
|
|
776610 |
|
|
|
776610 |
/**
|
|
|
776610 |
* MetaScreenCorner:
|
|
|
776610 |
* @META_SCREEN_TOPLEFT: top-left corner
|
|
|
776610 |
* @META_SCREEN_TOPRIGHT: top-right corner
|
|
|
776610 |
* @META_SCREEN_BOTTOMLEFT: bottom-left corner
|
|
|
776610 |
* @META_SCREEN_BOTTOMRIGHT: bottom-right corner
|
|
|
776610 |
*/
|
|
|
776610 |
typedef enum
|
|
|
776610 |
{
|
|
|
776610 |
META_SCREEN_TOPLEFT,
|
|
|
776610 |
META_SCREEN_TOPRIGHT,
|
|
|
776610 |
META_SCREEN_BOTTOMLEFT,
|
|
|
776610 |
META_SCREEN_BOTTOMRIGHT
|
|
|
776610 |
} MetaScreenCorner;
|
|
|
776610 |
|
|
|
776610 |
void meta_screen_override_workspace_layout (MetaScreen *screen,
|
|
|
776610 |
MetaScreenCorner starting_corner,
|
|
|
776610 |
gboolean vertical_layout,
|
|
|
776610 |
int n_rows,
|
|
|
776610 |
int n_columns);
|
|
|
776610 |
|
|
|
776610 |
void meta_screen_set_cursor (MetaScreen *screen,
|
|
|
776610 |
MetaCursor cursor);
|
|
|
776610 |
|
|
|
776610 |
+void meta_screen_update_cursor (MetaScreen *screen);
|
|
|
776610 |
+
|
|
|
776610 |
+
|
|
|
776610 |
#endif
|
|
|
776610 |
--
|
|
|
776610 |
2.18.1
|
|
|
776610 |
|