The following shows the diffstat and patchsets between
1f90dbc..de95bba^
----------------------------------------------------------------
commit de95bba27b931c41624c0a324010204fc568842e
Author: Thomas Adam <tho...@fvwm.org>
Date:   Fri Oct 17 13:30:09 2014 +0100

    Deprecate FindScreenOfXY()
    
    Move the functionality to monitor_by_xy() instead, and switch over the
    callers of FindScreenOfXY to it.  Reduces the need for a transient function
    serving no purpose.
---
 libs/FScreen.c | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/libs/FScreen.c b/libs/FScreen.c
index c7c5e13..72059ad 100644
--- a/libs/FScreen.c
+++ b/libs/FScreen.c
@@ -47,7 +47,6 @@ static Bool already_initialised;
 static Display *disp;
 static int no_of_screens;
 
-static struct monitor  *FindScreenOfXY(int x, int y);
 static struct monitor  *monitor_new(void);
 static void             init_monitor_contents(struct monitor *);
 static int monitor_should_ignore_global(struct monitor *);
@@ -90,7 +89,7 @@ monitor_get_current(void)
        FQueryPointer(disp, DefaultRootWindow(disp), &JunkRoot, &JunkChild,
                        &JunkX, &JunkY, &x, &y, &JunkMask);
 
-       return (FindScreenOfXY(x, y));
+       return (monitor_by_xy(x, y));
 }
 
 int
@@ -129,7 +128,14 @@ monitor_by_name(const char *name)
 struct monitor *
 monitor_by_xy(int x, int y)
 {
-       return (FindScreenOfXY(x, y));
+       struct monitor  *m;
+
+       TAILQ_FOREACH(m, &monitor_q, entry) {
+               if (x >= m->coord.x && x < m->coord.x + m->coord.w &&
+                   y >= m->coord.y && y < m->coord.y + m->coord.h)
+                       break;
+       }
+       return (m);
 }
 
 void FScreenInit(Display *dpy)
@@ -302,23 +308,6 @@ void FScreenSetDefaultModuleScreen(char *scr_spec)
        return;
 }
 
-
-static struct monitor *
-FindScreenOfXY(int x, int y)
-{
-       struct monitor  *m;
-
-       TAILQ_FOREACH(m, &monitor_q, entry) {
-               if (monitor_should_ignore_global(m))
-                       continue;
-               if (x >= m->coord.x && x < m->coord.x + m->coord.w &&
-                   y >= m->coord.y && y < m->coord.y + m->coord.h)
-                       return (m);
-       }
-
-       return (NULL);
-}
-
 static struct monitor *
 FindScreen(fscreen_scr_arg *arg, fscreen_scr_t screen)
 {
@@ -351,7 +340,7 @@ FindScreen(fscreen_scr_arg *arg, fscreen_scr_t screen)
                        tmp.xypos.y = 0;
                        arg = &tmp;
                }
-               m = FindScreenOfXY(arg->xypos.x, arg->xypos.y);
+               m = monitor_by_xy(arg->xypos.x, arg->xypos.y);
                break;
        case FSCREEN_BY_NAME:
                if (arg == NULL || arg->name == NULL) {
@@ -380,7 +369,7 @@ FScreenOfPointerXY(int x, int y)
 {
        struct monitor  *m;
 
-       m = FindScreenOfXY(x, y);
+       m = monitor_by_xy(x, y);
 
        return (m != NULL) ? m->name : "unknown";
 }

commit f5bf522be6e9fa0fbe4f96d8878002f3ccdd03f7
Merge: 419d387 1f90dbc
Author: Thomas Adam <tho...@fvwm.org>
Date:   Fri Oct 17 09:39:09 2014 +0100

    Merge branch 'ta/various-monitor-fixes' of github.com:ThomasAdam/mvwm into 
ta/various-monitor-fixes

commit 419d3879cc9b1b7c8eacf03943c5838de4dd0ac3
Author: Thomas Adam <tho...@fvwm.org>
Date:   Sun Sep 28 18:25:23 2014 +0100

    Ident:  Print monitor name selected window is on
    
    When using Ident to show information about a window, also print out the name
    of the monitor.
---
 modules/MvwmIdent/MvwmIdent.c | 3 +++
 modules/MvwmIdent/MvwmIdent.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/modules/MvwmIdent/MvwmIdent.c b/modules/MvwmIdent/MvwmIdent.c
index 1b125fc..b35a26d 100644
--- a/modules/MvwmIdent/MvwmIdent.c
+++ b/modules/MvwmIdent/MvwmIdent.c
@@ -394,6 +394,8 @@ void list_configure(unsigned long *body)
        {
                module->window = cfgpacket->frame;
                target.id = cfgpacket->w;
+               free(target.monitor);
+               target.monitor = mvwm_strdup((char *)&cfgpacket->monitor);
                target.frame = cfgpacket->frame;
                target.frame_x = cfgpacket->frame_x;
                target.frame_y = cfgpacket->frame_y;
@@ -1142,6 +1144,7 @@ void MakeList(void)
        AddToList("Class:",         target.class);
        AddToList("Resource:",      target.res);
        AddToList("Window ID:",     id);
+       AddToList("Monitor:",       target.monitor);
        AddToList("Desk:",          desktop);
        AddToList("Layer:",         layer);
        AddToList("Width:",         swidth);
diff --git a/modules/MvwmIdent/MvwmIdent.h b/modules/MvwmIdent/MvwmIdent.h
index e8cdf0c..a14fb1d 100644
--- a/modules/MvwmIdent/MvwmIdent.h
+++ b/modules/MvwmIdent/MvwmIdent.h
@@ -9,6 +9,7 @@ struct target_struct
   char class[256];
   char name[256];
   char icon_name[256];
+  char *monitor;
   unsigned long id;
   unsigned long frame;
   long frame_x;

commit ef87e8383778d99f8f9218a4a0beebd1596fb747
Author: Thomas Adam <tho...@fvwm.org>
Date:   Sun Sep 28 18:20:58 2014 +0100

    CONFIGARGS:  Include the monitor name
    
    Augment the CONFIGARGS macro to also include the monitor name of the
    configured window.
---
 libs/vpacket.h          | 1 +
 mvwm/module_interface.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libs/vpacket.h b/libs/vpacket.h
index 0af7fa7..55d20d7 100644
--- a/libs/vpacket.h
+++ b/libs/vpacket.h
@@ -30,6 +30,7 @@ typedef struct ConfigWinPacket
        unsigned long  frame_width;
        unsigned long  frame_height;
        unsigned long  desk;
+       unsigned long *monitor;
        /*
          Temp word for alignment - old flags used to be here.
          - remove before next release.
diff --git a/mvwm/module_interface.c b/mvwm/module_interface.c
index c98adfc..11cac2c 100644
--- a/mvwm/module_interface.c
+++ b/mvwm/module_interface.c
@@ -300,7 +300,7 @@ action_flags *__get_allowed_actions(const MvwmWindow *fw)
   as a dummy to preserve alignment of the other fields in the
   old packet: we should drop this before the next release.
 */
-#define CONFIGARGS(_fw) 33,                            \
+#define CONFIGARGS(_fw) 34,                            \
                (unsigned long)(-sizeof(Window)),       \
                &FW_W(*(_fw)),                          \
                (unsigned long)(-sizeof(Window)),       \
@@ -317,6 +317,8 @@ action_flags *__get_allowed_actions(const MvwmWindow *fw)
                &(*(_fw))->g.frame.height,              \
                (unsigned long)(0),                     \
                &(*(_fw))->Desk,                        \
+               (unsigned long)(sizeof((*(_fw))->m->name)),     \
+               (*(_fw))->m->name,                      \
                (unsigned long)(0),                     \
                &(*(_fw))->layer,                       \
                (unsigned long)(0),                     \

----------------------------------------------------------------

Diffstat:

----------------------------------------------------------------
 libs/FScreen.c | 33 +++++++++++----------------------
 1 file changed, 11 insertions(+), 22 deletions(-)

----------------------------------------------------------------

Reply via email to