[gtk+] wayland: Don't ever try to set surface buffer scale when not supported
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Don't ever try to set surface buffer scale when not supported
- Date: Wed, 25 Feb 2015 01:27:53 +0000 (UTC)
commit a70b478a5c1bf631dc1053b8711d3f6b64ea77e6
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Feb 24 15:00:39 2015 +0800
wayland: Don't ever try to set surface buffer scale when not supported
If the compositor is too old for handling surface buffer scales, never
tyr to set change it. This will effectively always leave it to its
initial state, i.e. 1.
https://bugzilla.gnome.org/show_bug.cgi?id=745076
gdk/wayland/gdkwindow-wayland.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index e316a30..76b0729 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -195,10 +195,12 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
int width,
int height)
{
+ GdkWaylandDisplay *wayland_display =
+ GDK_WAYLAND_DISPLAY (gdk_screen_get_display (screen));
GdkWindow *window;
GdkWindowImplWayland *impl;
- window = _gdk_display_create_window (gdk_screen_get_display (screen));
+ window = _gdk_display_create_window (GDK_DISPLAY (wayland_display));
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
window->impl_window = window;
window->visual = gdk_screen_get_system_visual (screen);
@@ -206,10 +208,9 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->wrapper = GDK_WINDOW (window);
- if (gdk_screen_get_n_monitors(screen) > 0)
+ if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
+ gdk_screen_get_n_monitors(screen) > 0)
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
- else
- impl->scale = 1;
/* logical 1x1 fake buffer */
impl->cairo_surface =
@@ -405,7 +406,6 @@ window_update_scale (GdkWindow *window)
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
{
/* We can't set the scale on this surface */
- impl->scale = 1;
return;
}
@@ -446,6 +446,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
GdkWindowAttr *attributes,
gint attributes_mask)
{
+ GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
GdkWindowImplWayland *impl;
GdkFrameClock *frame_clock;
const char *title;
@@ -468,7 +469,8 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
g_object_ref (window);
/* More likely to be right than just assuming 1 */
- impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
+ if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE)
+ impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
impl->title = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]