[Xfce4-commits] [xfce/xfce4-settings] 01/01: display: Leave the monitor where it was if possible (Bug #14096)

noreply at xfce.org noreply at xfce.org
Tue Dec 19 11:08:18 CET 2017


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-settings.

commit 1c7b5098fecac187048e7c8b01020ddf7ead8d50
Author: Florian Schüller <florian.schueller at gmail.com>
Date:   Sun Dec 17 20:56:23 2017 +0100

    display: Leave the monitor where it was if possible (Bug #14096)
    
    If a monitor is known and re-attaching it would not lead to a gap don't
    move it to (x=0, y=0)
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
 xfsettingsd/displays.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c
index a035450..146014b 100644
--- a/xfsettingsd/displays.c
+++ b/xfsettingsd/displays.c
@@ -506,7 +506,9 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent,
                         {
                             crtc->mode = output->preferred_mode;
                             crtc->rotation = RR_Rotate_0;
-                            crtc->x = crtc->y = 0;
+                            if ((crtc->x > gdk_screen_width() + 1) || (crtc->y > gdk_screen_height() + 1)) {
+                                crtc->x = crtc->y = 0;
+                            } /* else - leave values from last time we saw the monitor */
                             /* set width and height */
                             for (j = 0; j < helper->resources->nmode; ++j)
                             {
@@ -1406,7 +1408,9 @@ xfce_displays_helper_toggle_internal (gpointer           *power,
                 return;
             crtc->mode = lvds->preferred_mode;
             crtc->rotation = RR_Rotate_0;
-            crtc->x = crtc->y = 0;
+            if ((crtc->x > gdk_screen_width() + 1) || (crtc->y > gdk_screen_height() + 1)) {
+                crtc->x = crtc->y = 0;
+            } /* else - leave values from last time we saw the monitor */
             /* set width and height */
             for (m = 0; m < helper->resources->nmode; ++m)
             {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list