[gnome-shell] layout: Protect against broken monitor size reports
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] layout: Protect against broken monitor size reports
- Date: Mon, 17 Feb 2014 12:39:09 +0000 (UTC)
commit 3ba49b0a508f44378c85ab0e577650ed1b32981b
Author: Adel Gadllah <adel gadllah gmail com>
Date: Mon Feb 17 13:34:42 2014 +0100
layout: Protect against broken monitor size reports
VNC / XRDP reports nonsensial (i.e 0) monitor dimensions causing us to
end up with a dpi of "Infinity" and thus scale even though we shouldn't.
https://bugzilla.redhat.com/show_bug.cgi?id=1065788
js/ui/layout.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 4a4c94f..3f66147 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -491,6 +491,12 @@ const LayoutManager = new Lang.Class({
_updateScaling: function() {
let primary = this.monitors[this.primaryIndex];
+ let width_mm = global.gdk_screen.get_monitor_width_mm(this.primaryIndex);
+ let height_mm = global.gdk_screen.get_monitor_height_mm(this.primaryIndex);
+ if (width_mm == 0 || height_mm == 0) {
+ St.ThemeContext.get_for_stage(global.stage).scale_factor = 1;
+ return;
+ }
let dpi_x = primary.width / (global.gdk_screen.get_monitor_width_mm(this.primaryIndex) / 25.4);
let dpi_y = primary.height / (global.gdk_screen.get_monitor_height_mm(this.primaryIndex) / 25.4);
if (dpi_x > HIGH_DPI_LIMIT && dpi_y > HIGH_DPI_LIMIT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]