=?UTF-8?Q?Mikl=C3=B3s=20M=C3=A1t=C3=A9=20?=: winex11: Improve the desktop resolution list.

Alexandre Julliard julliard at winehq.org
Mon Aug 28 14:05:16 CDT 2017


Module: wine
Branch: master
Commit: cd4139df3c3cf4eb55143d81c9a7b499bb519712
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cd4139df3c3cf4eb55143d81c9a7b499bb519712

Author: Miklós Máté <mtmkls at gmail.com>
Date:   Fri Aug 25 21:25:40 2017 +0200

winex11: Improve the desktop resolution list.

Signed-off-by: Miklós Máté <mtmkls at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/desktop.c | 48 +++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c
index bf2c463..4df8784 100644
--- a/dlls/winex11.drv/desktop.c
+++ b/dlls/winex11.drv/desktop.c
@@ -37,9 +37,43 @@ static unsigned int dd_mode_count;
 static unsigned int max_width;
 static unsigned int max_height;
 
-static const unsigned int widths[]  = {320, 320, 400, 512, 640, 640, 800, 1024, 1152, 1280, 1280, 1400, 1600};
-static const unsigned int heights[] = {200, 240, 300, 384, 400, 480, 600,  768,  864,  960, 1024, 1050, 1200};
-#define NUM_DESKTOP_MODES (sizeof(widths) / sizeof(widths[0]))
+static struct screen_size {
+    unsigned int width;
+    unsigned int height;
+} screen_sizes[] = {
+    /* 4:3 */
+    { 320,  240},
+    { 400,  300},
+    { 512,  384},
+    { 640,  480},
+    { 768,  576},
+    { 800,  600},
+    {1024,  768},
+    {1152,  864},
+    {1280,  960},
+    {1400, 1050},
+    {1600, 1200},
+    {2048, 1536},
+    /* 5:4 */
+    {1280, 1024},
+    {2560, 2048},
+    /* 16:9 */
+    {1280,  720},
+    {1366,  768},
+    {1600,  900},
+    {1920, 1080},
+    {2560, 1440},
+    {3840, 2160},
+    /* 16:10 */
+    { 320,  200},
+    { 640,  400},
+    {1280,  800},
+    {1440,  900},
+    {1680, 1050},
+    {1920, 1200},
+    {2560, 1600}
+};
+#define NUM_DESKTOP_MODES (sizeof(screen_sizes) / sizeof(struct screen_size))
 
 #define _NET_WM_STATE_REMOVE 0
 #define _NET_WM_STATE_ADD 1
@@ -56,13 +90,13 @@ static void make_modes(void)
     X11DRV_Settings_AddOneMode(screen_width, screen_height, 0, 60);
     for (i=0; i<NUM_DESKTOP_MODES; i++)
     {
-        if ( (widths[i] <= max_width) && (heights[i] <= max_height) )
+        if ( (screen_sizes[i].width <= max_width) && (screen_sizes[i].height <= max_height) )
         {
-            if ( ( (widths[i] != max_width) || (heights[i] != max_height) ) &&
-                 ( (widths[i] != screen_width) || (heights[i] != screen_height) ) )
+            if ( ( (screen_sizes[i].width != max_width) || (screen_sizes[i].height != max_height) ) &&
+                 ( (screen_sizes[i].width != screen_width) || (screen_sizes[i].height != screen_height) ) )
             {
                 /* only add them if they are smaller than the root window and unique */
-                X11DRV_Settings_AddOneMode(widths[i], heights[i], 0, 60);
+                X11DRV_Settings_AddOneMode(screen_sizes[i].width, screen_sizes[i].height, 0, 60);
             }
         }
     }




More information about the wine-cvs mailing list