This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  389a0a252cb88ddb4692480adcf261f670bd1597 (commit)
       via  6fe23037ef1cd0d545baf20a3f29307425ca5d7d (commit)
       via  b9e8bbbdc75f285551c4beb45b6a65741ba8ad4d (commit)
       via  052efedd93fef8358ae2ad6f764aea9a0dafbb00 (commit)
      from  a401dcbdf66f7e993fb7409dc71aa9c693c3489d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/389a0a252cb88ddb4692480adcf261f670bd1597

commit 389a0a252cb88ddb4692480adcf261f670bd1597
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Apr 3 20:01:48 2013 +0200

    New file placement.h
    
    The file placement.h hold the definitions for placement.c

diff --git a/src/Makefile.am b/src/Makefile.am
index 9c77bb4..a205c4d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -56,6 +56,7 @@ wmaker_SOURCES =              pixmap.c        pixmap.h        
placement.c +   placement.h     properties.c    properties.h    resources.c 
diff --git a/src/actions.c b/src/actions.c
index 6521870..207ce4f 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -46,6 +46,7 @@
 #include "workspace.h"
 #include "xinerama.h"
 #include "usermenu.h"
+#include "placement.h"
 
 /****** Global Variables ******/
 
@@ -55,7 +56,6 @@ extern Time LastFocusChange;
 extern WPreferences wPreferences;
 extern Atom _XA_WM_TAKE_FOCUS;
 extern void ProcessPendingEvents();
-extern int calcIntersectionLength(int p1, int l1, int p2, int l2);
 
 static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, 
int *new_y,
                                  unsigned int *new_width, unsigned int 
*new_height);
diff --git a/src/appicon.c b/src/appicon.c
index 573344c..322ee61 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -47,6 +47,7 @@
 #include "dialog.h"
 #include "xinerama.h"
 #include "client.h"
+#include "placement.h"
 #ifdef XDND
 #include "xdnd.h"
 #endif
diff --git a/src/dock.c b/src/dock.c
index 21d6aee..0140bd1 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -54,6 +54,7 @@
 #include "framewin.h"
 #include "superfluous.h"
 #include "xinerama.h"
+#include "placement.h"
 
 /**** Local variables ****/
 #define CLIP_REWIND       1
diff --git a/src/funcs.h b/src/funcs.h
index 0d063b0..3902d0b 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -40,12 +40,9 @@ void OpenWindowMenu2(WWindow *wwin, int x, int y, int 
keyboard);
 void OpenMiniwindowMenu(WWindow *wwin, int x, int y);
 void CloseWindowMenu(WScreen *scr);
 void DestroyWindowMenu(WScreen *scr);
-void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
 void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool 
class_only);
 void SendHelperMessage(WScreen *scr, char type, int workspace, char *msg);
 void UnescapeWM_CLASS(char *str, char **name, char **class);
-void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
-                 unsigned int width, unsigned int height);
 
 void ParseWindowName(WMPropList *value, char **winstance, char **wclass,
                      char *where);
@@ -60,9 +57,6 @@ WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler 
*callback, void *cdata);
 Pixmap LoadIcon(WScreen *scr, char *path, char *mask, int title_height);
 
 
-int calcIntersectionArea(int x1, int y1, int w1, int h1,
-                         int x2, int y2, int w2, int h2);
-
 char * StrConcatDot(char *a, char *b);
 char * ExpandOptions(WScreen *scr, char *cmdline);
 char * ShrinkString(WMFont *font, char *string, int width);
diff --git a/src/placement.h b/src/placement.h
new file mode 100644
index 0000000..5f7a907
--- /dev/null
+++ b/src/placement.h
@@ -0,0 +1,34 @@
+/* placement.h - window and icon placement on screen
+ *
+ *  Window Maker window manager
+ *
+ *  Copyright (c) 1997-2003 Alfredo K. Kojima
+ *  Copyright (c) 2013 Window Maker Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head);
+
+/* Computes the intersecting length of two line sections */
+int calcIntersectionLength(int p1, int l1, int p2, int l2);
+
+/* Computes the intersecting area of two rectangles */
+int calcIntersectionArea(int x1, int y1, int w1, int h1, int x2, int y2, int 
w2, int h2);
+
+void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, unsigned width, 
unsigned height);
+
+/* Set the points x and y inside the screen */
+void get_right_position_on_screen(WScreen *scr, int *x, int *y, int size_x, 
int size_y);
diff --git a/src/window.c b/src/window.c
index affafcf..c227b4c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -60,6 +60,7 @@
 #include "appicon.h"
 #include "superfluous.h"
 #include "rootmenu.h"
+#include "placement.h"
 
 #ifdef MWM_HINTS
 # include "motif.h"
diff --git a/src/xinerama.c b/src/xinerama.c
index 4bd9ca4..f9fe31e 100644
--- a/src/xinerama.c
+++ b/src/xinerama.c
@@ -25,7 +25,7 @@
 #include "screen.h"
 #include "window.h"
 #include "framewin.h"
-#include "funcs.h"
+#include "placement.h"
 
 #ifdef XINERAMA
 # ifdef SOLARIS_XINERAMA       /* sucks */

http://repo.or.cz/w/wmaker-crm.git/commit/6fe23037ef1cd0d545baf20a3f29307425ca5d7d

commit 6fe23037ef1cd0d545baf20a3f29307425ca5d7d
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Apr 3 20:01:47 2013 +0200

    wGetRectForHead moved to where used
    
    The definition and call for wGetRectForHead is moved inside the
    if block where is used. This code adds a WScreen pointer to make
    the line shorter.
    
    If menu->frame is NULL, then was NULL before this patch, so this
    code doesn't include an error about this.
    
    This patch will used with next patch to move the code inside the
    block to an specific function.

diff --git a/src/menu.c b/src/menu.c
index b770d4c..696daa0 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1062,15 +1062,16 @@ static int keyboardMenu(WMenu * menu)
 
 void wMenuMapAt(WMenu * menu, int x, int y, int keyboard)
 {
-       WMRect rect = wGetRectForHead(menu->frame->screen_ptr,
-                                     
wGetHeadForPointerLocation(menu->frame->screen_ptr));
-
        if (!menu->flags.realized) {
                menu->flags.realized = 1;
                wMenuRealize(menu);
        }
+
        if (!menu->flags.mapped) {
                if (wPreferences.wrap_menus) {
+                       WScreen *scr = menu->frame->screen_ptr;
+                       WMRect rect = wGetRectForHead(scr, 
wGetHeadForPointerLocation(scr));
+
                        if (x < rect.pos.x)
                                x = rect.pos.x;
                        if (y < rect.pos.y)

http://repo.or.cz/w/wmaker-crm.git/commit/b9e8bbbdc75f285551c4beb45b6a65741ba8ad4d

commit b9e8bbbdc75f285551c4beb45b6a65741ba8ad4d
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Apr 3 20:01:46 2013 +0200

    code clean at startup.c
    
    Small code clean at startup.c

diff --git a/src/startup.c b/src/startup.c
index e0249ee..f9d4e52 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -415,16 +415,12 @@ WScreen *wScreenForRootWindow(Window window)
        if (wScreenCount == 1)
                return wScreen[0];
 
-       /*
-        * Since the number of heads will probably be small (normally 2),
+       /* Since the number of heads will probably be small (normally 2),
         * it should be faster to use this than a hash table, because
-        * of the overhead.
-        */
-       for (i = 0; i < wScreenCount; i++) {
-               if (wScreen[i]->root_win == window) {
+        * of the overhead. */
+       for (i = 0; i < wScreenCount; i++)
+               if (wScreen[i]->root_win == window)
                        return wScreen[i];
-               }
-       }
 
        return wScreenForWindow(window);
 }
@@ -436,9 +432,9 @@ WScreen *wScreenForWindow(Window window)
        if (wScreenCount == 1)
                return wScreen[0];
 
-       if (XGetWindowAttributes(dpy, window, &attr)) {
+       if (XGetWindowAttributes(dpy, window, &attr))
                return wScreenForRootWindow(attr.root);
-       }
+
        return NULL;
 }
 

http://repo.or.cz/w/wmaker-crm.git/commit/052efedd93fef8358ae2ad6f764aea9a0dafbb00

commit 052efedd93fef8358ae2ad6f764aea9a0dafbb00
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Wed Apr 3 20:01:45 2013 +0200

    Removed dup function wScreenSearchForRootWindow
    
    The function wScreenSearchForRootWindow is exactly like wScreenForRootWindow
    so can be removed swapping the function call.

diff --git a/src/event.c b/src/event.c
index 2da0988..302497b 100644
--- a/src/event.c
+++ b/src/event.c
@@ -944,7 +944,7 @@ static void handleClientMessage(XEvent * event)
                if (!wwin->flags.miniaturized)
                        wIconifyWindow(wwin);
        } else if (event->xclient.message_type == _XA_WM_COLORMAP_NOTIFY && 
event->xclient.format == 32) {
-               WScreen *scr = 
wScreenSearchForRootWindow(event->xclient.window);
+               WScreen *scr = wScreenForRootWindow(event->xclient.window);
 
                if (!scr)
                        return;
@@ -1034,7 +1034,7 @@ static void handleClientMessage(XEvent * event)
                        break;
                }
        } else if (event->xclient.message_type == _XA_WM_IGNORE_FOCUS_EVENTS) {
-               WScreen *scr = 
wScreenSearchForRootWindow(event->xclient.window);
+               WScreen *scr = wScreenForRootWindow(event->xclient.window);
                if (!scr)
                        return;
                scr->flags.ignore_focus_events = event->xclient.data.l[0] ? 1 : 
0;
diff --git a/src/screen.h b/src/screen.h
index b2c2f42..5bf508e 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -313,7 +313,6 @@ int wScreenKeepInside(WScreen *scr, int *x, int *y, int 
width, int height);
 /* in startup.c */
 WScreen *wScreenWithNumber(int i);
 WScreen *wScreenForRootWindow(Window window);   /* window must be valid */
-WScreen *wScreenSearchForRootWindow(Window window);
 WScreen *wScreenForWindow(Window window);   /* slower than above functions */
 
 void wScreenFinish(WScreen *scr);
diff --git a/src/startup.c b/src/startup.c
index 93b5fe7..e0249ee 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -429,27 +429,6 @@ WScreen *wScreenForRootWindow(Window window)
        return wScreenForWindow(window);
 }
 
-WScreen *wScreenSearchForRootWindow(Window window)
-{
-       int i;
-
-       if (wScreenCount == 1)
-               return wScreen[0];
-
-       /*
-        * Since the number of heads will probably be small (normally 2),
-        * it should be faster to use this than a hash table, because
-        * of the overhead.
-        */
-       for (i = 0; i < wScreenCount; i++) {
-               if (wScreen[i]->root_win == window) {
-                       return wScreen[i];
-               }
-       }
-
-       return wScreenForWindow(window);
-}
-
 WScreen *wScreenForWindow(Window window)
 {
        XWindowAttributes attr;

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

Summary of changes:
 src/Makefile.am                |    1 +
 src/actions.c                  |    2 +-
 src/appicon.c                  |    1 +
 src/dock.c                     |    1 +
 src/event.c                    |    4 ++--
 src/funcs.h                    |    6 ------
 src/menu.c                     |    7 ++++---
 src/{appmenu.h => placement.h} |   18 ++++++++++--------
 src/screen.h                   |    1 -
 src/startup.c                  |   37 ++++++-------------------------------
 src/window.c                   |    1 +
 src/xinerama.c                 |    2 +-
 12 files changed, 28 insertions(+), 53 deletions(-)
 copy src/{appmenu.h => placement.h} (55%)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to