Accepting request 255665 from home:michalsrb:branches:X11:XOrg

- u_tigervnc-use_preferred_mode.patch
  * Mark user chosen resolution as preferred. (bnc#896540)

OBS-URL: https://build.opensuse.org/request/show/255665
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=40
This commit is contained in:
Michal Srb 2014-10-13 12:16:17 +00:00 committed by Git OBS Bridge
parent 1b1ae80b8a
commit 8493eddf3d
3 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 13 11:51:03 UTC 2014 - msrb@suse.com
- u_tigervnc-use_preferred_mode.patch
* Mark user chosen resolution as preferred. (bnc#896540)
-------------------------------------------------------------------
Mon Aug 18 13:58:30 UTC 2014 - sndirsch@suse.com

View File

@ -112,6 +112,7 @@ Patch7: u_tigervnc-ignore-epipe-on-write.patch
Patch8: n_tigervnc-date-time.patch
Patch9: U_include-vencrypt-only-if-any-subtype-present.patch
Patch10: u_tigervnc-check-shm-harder.patch
Patch11: u_tigervnc-use_preferred_mode.patch
# Xserver patches
Patch20: tigervnc-1.2.80-fix-int-to-pointer.patch
@ -155,6 +156,7 @@ fi
%patch8 -p1
%patch9 -p0
%patch10 -p0
%patch11 -p0
pushd unix/xserver
patch -p1 < ../xserver114.patch

View File

@ -0,0 +1,48 @@
Author: Michal Srb <msrb@suse.com>
Subject: Use preferred mode.
Patch-Mainline: To be upstreamed
References: bnc#896540
If there is any resolution specified with -geometry or -screen parameters,
report this resolution as preferred one. That way desktop environments won't
change it immediately after start.
Index: unix/xserver/hw/vnc/xvnc.cc
===================================================================
--- unix/xserver/hw/vnc/xvnc.cc (revision 5186)
+++ unix/xserver/hw/vnc/xvnc.cc (working copy)
@@ -1319,12 +1319,22 @@
/* Make sure the CRTC has this output set */
vncRandRCrtcSet(pScreen, crtc, NULL, 0, 0, RR_Rotate_0, 1, &output);
- /* Populate a list of default modes */
- RRModePtr modes[sizeof(vncRandRWidths)/sizeof(*vncRandRWidths)];
- int num_modes;
+ /* Populate a list of modes */
+ RRModePtr modes[sizeof(vncRandRWidths)/sizeof(*vncRandRWidths) + 1];
+ int num_modes = 0;
- num_modes = 0;
+ /* Start with requested mode */
+ mode = vncRandRModeGet(pScreen->width, pScreen->height);
+ if(mode != NULL) {
+ modes[num_modes] = mode;
+ num_modes++;
+ }
+
+ /* Add default modes */
for (int i = 0;i < sizeof(vncRandRWidths)/sizeof(*vncRandRWidths);i++) {
+ if (vncRandRWidths[i] == pScreen->width && vncRandRHeights[i] == pScreen->height)
+ continue;
+
mode = vncRandRModeGet(vncRandRWidths[i], vncRandRHeights[i]);
if (mode != NULL) {
modes[num_modes] = mode;
@@ -1332,7 +1342,7 @@
}
}
- RROutputSetModes(output, modes, num_modes, 0);
+ RROutputSetModes(output, modes, num_modes, 1);
return crtc;
}