[Xfce4-commits] [xfce/xfwm4] 03/05: display: get screen from the output window

noreply at xfce.org noreply at xfce.org
Thu Jan 19 09:33:58 CET 2017


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

olivier pushed a commit to branch master
in repository xfce/xfwm4.

commit b9a64020b7d7b5616e282ea8186b3e69035d9bc9
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Wed Jan 18 15:34:37 2017 +0100

    display: get screen from the output window
    
    Add an API to retrieve the screen from the output window.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/display.c | 21 +++++++++++++++++++++
 src/display.h |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/src/display.c b/src/display.c
index ed9b502..adc961d 100644
--- a/src/display.c
+++ b/src/display.c
@@ -600,6 +600,27 @@ myDisplayGetScreenFromRoot (DisplayInfo *display, Window root)
 }
 
 ScreenInfo *
+myDisplayGetScreenFromOutput (DisplayInfo *display, Window output)
+{
+    GSList *list;
+
+    g_return_val_if_fail (display != NULL, NULL);
+
+    for (list = display->screens; list; list = g_slist_next (list))
+    {
+        ScreenInfo *screen = (ScreenInfo *) list->data;
+        if (screen->output == output)
+        {
+            return screen;
+        }
+    }
+    TRACE ("myDisplayGetScreenFromOutput: no screen found for output window %p", output);
+
+    return NULL;
+}
+
+
+ScreenInfo *
 myDisplayGetScreenFromNum (DisplayInfo *display, int num)
 {
     GSList *list;
diff --git a/src/display.h b/src/display.h
index 8c21f28..c1a8adb 100644
--- a/src/display.h
+++ b/src/display.h
@@ -389,6 +389,8 @@ void                     myDisplayRemoveScreen                  (DisplayInfo *,
                                                                  ScreenInfo *);
 ScreenInfo              *myDisplayGetScreenFromRoot             (DisplayInfo *,
                                                                  Window);
+ScreenInfo              *myDisplayGetScreenFromOutput           (DisplayInfo *,
+                                                                 Window);
 ScreenInfo              *myDisplayGetScreenFromNum              (DisplayInfo *,
                                                                  int);
 Window                   myDisplayGetRootFromWindow             (DisplayInfo *,

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


More information about the Xfce4-commits mailing list