[PATCH] Set mainWindow size request to current res reported by xrandr (#694760)

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

 



Certain displays do not respond well to the maximize() calls on the mainWindow.
On these particular Xen guest installs, the user is unable to see the entire
anaconda window because the xrandr reported current resolution is 800x600, but
we're still trying to size it up to 1024x768 or higher.

When we scrape the current resolution from xrandr -q, and pass the width and
height to set_size_request(), the main anaconda window fills the whole display
the user is looking at.  I've tested it on various install methods at different
screen resolutions and it seems to work fine.  The only downside I see to this
is scraping the output of xrandr.  In the event that the output of xrandr -q is
empty or contains unexpected values, we don't do set_size_request().  The
default width and height on mainWindow is set to 800x600 anyway, so most
install cases will still work fine without a set_size_request() call.
---
 gui.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/gui.py b/gui.py
index 11264d4..a4480d1 100755
--- a/gui.py
+++ b/gui.py
@@ -1566,8 +1566,24 @@ class InstallControlWindow:
             if gtk.gdk.screen_height() < 600:
                 i.hide()
 
+            width = None
+            height = None
+            lines = iutil.execWithCapture("xrandr", ["-q"]).splitlines()
+            xrandr = filter(lambda x: "current" in x, lines)
+            if xrandr and len(xrandr) == 1:
+                fields = xrandr[0].split()
+                pos = fields.index('current')
+                if len(fields) > pos + 3:
+                    width = int(fields[pos + 1])
+                    height = int(fields[pos + 3].replace(',', ''))
+
+            if width and height:
+                self.window.set_size_request(width, height)
+
             self.window.maximize()
 
+        self.window.show()
+
         if flags.debug:
             self.mainxml.get_widget("debugButton").show_now()
         self.installFrame = self.mainxml.get_widget("installFrame")
-- 
1.7.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux