[Xfce4-commits] [xfce/xfce4-settings] 02/03: display: Always draw active display last so it's on top

noreply at xfce.org noreply at xfce.org
Wed Mar 14 02:36:01 CET 2018


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 1ffd6776e26df39f61646540164db0cab6d2f819
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Mar 12 23:20:38 2018 +0100

    display: Always draw active display last so it's on top
    
    This is especially useful when multiple displays overlay and ensures
    that the currently active output's name is clearly readable and
    therefore distinguishable.
    Also tweaked the alpha values of both displays as a result.
    
    Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
 dialogs/display-settings/main.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 6c20959..629b27d 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -2496,7 +2496,7 @@ paint_output (cairo_t *cr, int i, double *snap_x, double *snap_y)
     /* Make overlapping displays ('mirrored') more transparent so both displays can
        be recognized more easily */
     if (output->id != active_output && mirrored == 2)
-        alpha = 0.3;
+        alpha = 0.5;
     /* When displays are mirrored it makes no sense to make them semi-transparent
        because they overlay each other completely */
     else if (mirrored == 1)
@@ -2504,7 +2504,7 @@ paint_output (cairo_t *cr, int i, double *snap_x, double *snap_y)
     /* the inactive display should be more transparent and the overlapping one as
        well */
     else if (output->id != active_output || mirrored == 2)
-        alpha = 0.8;
+        alpha = 0.7;
 
     if (output->on)
     {
@@ -2653,11 +2653,21 @@ on_area_paint (FooScrollArea  *area,
 
     for (list = connected_outputs; list != NULL; list = list->next)
     {
-        paint_output (cr, g_list_position (connected_outputs, list), &x, &y);
+        gint i;
+
+        i = g_list_position (connected_outputs, list);
+        /* Always paint the currently selected display last, i.e. on top, so it's
+           visible and the name is readable */
+        if (i == active_output) {
+            continue;
+        }
+        paint_output (cr, i, &x, &y);
 
         if (get_mirrored_configuration() == 1)
             break;
     }
+    /* Finally also paint the active output */
+    paint_output (cr, active_output, &x, &y);
 }
 
 static XfceOutputInfo *

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


More information about the Xfce4-commits mailing list