Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h borders.c focus.c menus.c pager.c 


Log Message:
Enable configuring no-input windows using menus + cosmetics.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.293
retrieving revision 1.294
diff -u -3 -r1.293 -r1.294
--- E.h 28 Jun 2004 18:21:57 -0000      1.293
+++ E.h 28 Jun 2004 23:37:45 -0000      1.294
@@ -1333,7 +1333,7 @@
    char                justclicked;
    char                click_focus_grabbed;
    EWin               *focuswin;
-   EWin               *mouse_over_win;
+   EWin               *mouse_over_ewin;
    int                 px, py, x, y;
    char                doingslide;
    int                 server_grabbed;
@@ -2186,7 +2186,6 @@
 Dialog             *FindDialogButton(Window win, int *bnum);
 Dialog             *FindDialog(Window win);
 int                 FindADialog(void);
-EWin               *FindEwinSpawningMenu(Menu * m);
 Pager              *FindPager(Window win);
 DItem              *FindDialogItem(Window win, Dialog ** dret);
 
@@ -2410,8 +2409,6 @@
 MenuStyle          *MenuStyleCreate(void);
 Menu               *MenuCreate(const char *name);
 void                MenuDestroy(Menu * m);
-void                MenuHide(Menu * m);
-void                MenuShow(Menu * m, char noshow);
 MenuItem           *MenuItemCreate(const char *text, ImageClass * iclass,
                                   int action_id, const char *action_params,
                                   Menu * child);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -3 -r1.201 -r1.202
--- borders.c   28 Jun 2004 19:14:48 -0000      1.201
+++ borders.c   28 Jun 2004 23:37:55 -0000      1.202
@@ -171,7 +171,7 @@
    EDBUG(4, "GetContextEwin");
 
 #if 0
-   ewin = Mode.mouse_over_win;
+   ewin = Mode.mouse_over_ewin;
    if (ewin && !ewin->menu)
       EDBUG_RETURN(ewin);
 #endif
@@ -1536,8 +1536,8 @@
 
    if (ewin == Mode.focuswin)
       FocusToEWin(ewin, FOCUS_EWIN_GONE);
-   if (ewin == Mode.mouse_over_win)
-      Mode.mouse_over_win = NULL;
+   if (ewin == Mode.mouse_over_ewin)
+      Mode.mouse_over_ewin = NULL;
 
    /* hide any menus this ewin has brought up if they are still up when we */
    /* destroy this ewin */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- focus.c     7 Jun 2004 16:46:07 -0000       1.72
+++ focus.c     28 Jun 2004 23:37:55 -0000      1.73
@@ -308,7 +308,7 @@
    if ((Conf.focus.warp_on_next_focus && (why == FOCUS_NEXT)) ||
        (Conf.focus.warp_after_next_focus && (why == FOCUS_WARP_DONE)))
      {
-       if (ewin != Mode.mouse_over_win)
+       if (ewin != Mode.mouse_over_ewin)
           XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2,
                        ewin->h / 2);
      }
@@ -363,7 +363,7 @@
 
    /* Set the mouse-over window */
    ewin = GetEwinByCurrentPointer();
-   Mode.mouse_over_win = ewin;
+   Mode.mouse_over_ewin = ewin;
 
    ewin = FocusEwinSelect();
    if (ewin)
@@ -396,7 +396,7 @@
      }
 
    ewin = GetEwinByCurrentPointer();
-   Mode.mouse_over_win = ewin;
+   Mode.mouse_over_ewin = ewin;
 
    switch (Conf.focus.mode)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -3 -r1.140 -r1.141
--- menus.c     26 Jun 2004 17:49:01 -0000      1.140
+++ menus.c     28 Jun 2004 23:37:55 -0000      1.141
@@ -110,7 +110,7 @@
    EDBUG_RETURN(menu);
 }
 
-EWin               *
+static EWin        *
 FindEwinSpawningMenu(Menu * m)
 {
    EWin               *ewin = NULL;
@@ -129,7 +129,7 @@
    EDBUG_RETURN(ewin);
 }
 
-void
+static void
 MenuHide(Menu * m)
 {
    EWin               *ewin;
@@ -195,7 +195,7 @@
    ewin->Close = MenuEwinClose;
 }
 
-void
+static void
 MenuShow(Menu * m, char noshow)
 {
    EWin               *ewin;
@@ -2370,6 +2370,18 @@
    return NULL;
 }
 
+static EWin        *
+MenuFindContextEwin(Menu * m)
+{
+   while (m && m->parent)
+      m = m->parent;
+
+   if (!m)
+      return NULL;
+
+   return FindEwinSpawningMenu(m);
+}
+
 int
 MenusEventKeyPress(XEvent * ev)
 {
@@ -2440,8 +2452,9 @@
           break;
        if (!mi->act_id)
           break;
+       ewin = MenuFindContextEwin(m);
        MenusHide();
-       ActionsCall(mi->act_id, NULL, mi->params);
+       ActionsCall(mi->act_id, ewin, mi->params);
        break;
      }
 
@@ -2513,6 +2526,7 @@
 {
    Menu               *m;
    MenuItem           *mi;
+   EWin               *ewin;
 
    m = FindMenuItem(ev->xbutton.window, &mi);
    if ((m) && (mi->state))
@@ -2521,8 +2535,9 @@
        MenuDrawItem(m, mi, 1);
        if ((mi->act_id) && (!Mode.justclicked))
          {
+            ewin = MenuFindContextEwin(m);
             MenusHide();
-            ActionsCall(mi->act_id, NULL, mi->params);
+            ActionsCall(mi->act_id, ewin, mi->params);
             return 1;
          }
      }
@@ -2531,7 +2546,6 @@
      {
        if (!m)
          {
-            EWin               *ewin;
             Window              ww;
 
             ww = WindowAtXY(Mode.x, Mode.y);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- pager.c     26 Jun 2004 18:24:39 -0000      1.97
+++ pager.c     28 Jun 2004 23:37:55 -0000      1.98
@@ -982,7 +982,7 @@
        mi = MenuItemCreate(_("Stick / Unstick"), NULL, ACTION_STICK, s, NULL);
        MenuAddItem(pw_menu, mi);
 
-       ActionsCall(ACTION_SHOW_MENU, NULL, "named __DESK_WIN_MENU");
+       ActionsCall(ACTION_SHOW_MENU, ewin, "named __DESK_WIN_MENU");
        return;
      }
 




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to