Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
Tag: branch-exp
E.h buttons.c desktops.c ewins.c focus.c grabs.c ipc.c
menus-misc.c menus.c moveresize.c
Log Message:
Merge+fixups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.60
retrieving revision 1.314.2.61
diff -u -3 -r1.314.2.60 -r1.314.2.61
--- E.h 19 Nov 2004 21:02:23 -0000 1.314.2.60
+++ E.h 20 Nov 2004 20:48:55 -0000 1.314.2.61
@@ -1314,7 +1314,7 @@
void ButtonToggle(Button * b);
void ButtonDraw(Button * b);
void ButtonDrawWithState(Button * b, int state);
-void ButtonMoveToDesktop(Button * b, int num);
+void ButtonMoveToDesktop(Button * b, int desk);
void ButtonMoveToCoord(Button * b, int x, int y);
void ButtonMoveRelative(Button * b, int dx, int dy);
void ButtonIncRefcount(Button * b);
@@ -1331,8 +1331,9 @@
int ButtonGetWidth(const Button * b);
int ButtonGetHeight(const Button * b);
int ButtonIsFixed(const Button * b);
-int ButtonIsSticky(const Button * b);
+int ButtonIsInternal(const Button * b);
int ButtonIsAbove(const Button * b, int desk);
+int ButtonIsNormal(const Button * b, int desk);
int ButtonIsBelow(const Button * b, int desk);
int ButtonDoShowDefault(const Button * b);
int ButtonEmbedWindow(Button * ButtonToUse,
@@ -1407,6 +1408,7 @@
Window DeskGetCurrentRoot(void);
void DeskSetCurrentArea(int ax, int ay);
int DesksGetNumber(void);
+int DesksGetTotal(void);
int DesksGetCurrent(void);
void DesksSetCurrent(int desk);
@@ -1575,11 +1577,11 @@
#define EDBUG_TYPE_SESSION 134
#define EDBUG_TYPE_SNAPS 135
#define EDBUG_TYPE_DESKS 136
-#define EDBUG_TYPE_DISPATCH 137
-#define EDBUG_TYPE_MODULES 138
-#define EDBUG_TYPE_CONFIG 139
-#define EDBUG_TYPE_IPC 140
-#define EDBUG_TYPE_GRABS 141
+#define EDBUG_TYPE_GRABS 137
+#define EDBUG_TYPE_DISPATCH 138
+#define EDBUG_TYPE_MODULES 139
+#define EDBUG_TYPE_CONFIG 140
+#define EDBUG_TYPE_IPC 141
#define EDBUG_TYPE_EVENTS 142
int EventDebug(unsigned int type);
#else
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.36.2.16
retrieving revision 1.36.2.17
diff -u -3 -r1.36.2.16 -r1.36.2.17
--- buttons.c 19 Nov 2004 21:02:25 -0000 1.36.2.16
+++ buttons.c 20 Nov 2004 20:48:56 -0000 1.36.2.17
@@ -111,6 +111,8 @@
EoSetLayer(b, ontop);
b->flags = flags;
EoSetSticky(b, sticky);
+ if (sticky && ontop == 1)
+ desk = 0;
b->o.desk = desk;
b->visible = 0;
b->geom.width.min = minw;
@@ -300,6 +302,8 @@
EDBUG(3, "ButtonMoveToDesktop");
+ if (EoIsSticky(b) && EoGetLayer(b) == 1)
+ desk = 0;
pdesk = EoGetDesk(b);
desk = EoSetDesk(b, desk);
@@ -529,23 +533,27 @@
}
int
-ButtonIsSticky(const Button * b)
+ButtonIsInternal(const Button * b)
{
- return !b->internal && EoIsSticky(b);
+ return b->internal;
}
int
ButtonIsAbove(const Button * b, int desk)
{
- return !b->internal && !EoIsSticky(b) && EoGetDesk(b) == desk
- && EoGetLayer(b) > 0;
+ return !b->internal && EoGetDesk(b) == desk && EoGetLayer(b) > 0;
+}
+
+int
+ButtonIsNormal(const Button * b, int desk)
+{
+ return !b->internal && EoGetDesk(b) == desk && EoGetLayer(b) == 0;
}
int
ButtonIsBelow(const Button * b, int desk)
{
- return !b->internal && !EoIsSticky(b) && EoGetDesk(b) == desk
- && EoGetLayer(b) < 0;
+ return !b->internal && EoGetDesk(b) == desk && EoGetLayer(b) < 0;
}
int
@@ -993,8 +1001,9 @@
break;
case BUTTON_DESK:
desk = atoi(s2);
+ desk = ((unsigned int)desk) % DesksGetTotal();
if (pbt)
- EoSetDesk(pbt, desk);
+ ButtonMoveToDesktop(pbt, desk);
break;
case BUTTON_STICKY:
sticky = atoi(s2);
@@ -1224,8 +1233,8 @@
for (i = 0; i < num; i++)
{
b = lst[i];
- IpcPrintf("%2d %2d %2d %5d+%5d %5dx%5d %s\n",
- EoGetDesk(b), EoIsSticky(b), EoGetLayer(b),
+ IpcPrintf("%#lx %2d %2d %2d %5d+%5d %5dx%5d %s\n",
+ EoGetWin(b), EoGetDesk(b), EoIsSticky(b), EoGetLayer(b),
EoGetX(b), EoGetY(b), EoGetW(b), EoGetH(b),
ButtonGetName(lst[i]));
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.95.2.27
retrieving revision 1.95.2.28
diff -u -3 -r1.95.2.27 -r1.95.2.28
--- desktops.c 19 Nov 2004 21:02:26 -0000 1.95.2.27
+++ desktops.c 20 Nov 2004 20:48:56 -0000 1.95.2.28
@@ -130,6 +130,12 @@
}
int
+DesksGetTotal(void)
+{
+ return ENLIGHTENMENT_CONF_NUM_DESKTOPS;
+}
+
+int
DesksGetCurrent(void)
{
return desks.current;
@@ -757,11 +763,10 @@
static void
MoveStickyWindowsToCurrentDesk(void)
{
- EWin *const *lst, *ewin, *last_ewin;
+ EWin *const *lst, *ewin;
int i, num;
lst = EwinListGetStacking(&num);
- last_ewin = NULL;
for (i = 0; i < num; i++)
{
ewin = lst[i];
@@ -774,7 +779,23 @@
EMoveWindow(disp, EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin));
HintsSetWindowArea(ewin);
HintsSetWindowDesktop(ewin);
- last_ewin = ewin;
+ }
+}
+
+static void
+MoveStickyButtonsToCurrentDesk(void)
+{
+ Button **lst, *btn;
+ int i, num;
+
+ lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
+ for (i = 0; i < num; i++)
+ {
+ btn = lst[i];
+ if (ButtonIsInternal(btn) || !EoIsSticky((EWin *) btn))
+ continue;
+
+ ButtonMoveToDesktop(btn, desks.current);
}
}
@@ -1004,6 +1025,7 @@
StackDesktops();
desks.current = desk;
MoveStickyWindowsToCurrentDesk();
+ MoveStickyButtonsToCurrentDesk();
StackDesktop(DesksGetCurrent());
FocusNewDesk();
#if 0 /* FIXME - TBD */
@@ -1032,6 +1054,7 @@
StackDesktops();
desks.current = desks.order[0];
MoveStickyWindowsToCurrentDesk();
+ MoveStickyButtonsToCurrentDesk();
StackDesktop(DesksGetCurrent());
#if 0 /* FIXME - TBD */
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
@@ -1127,67 +1150,64 @@
*/
#if 1 /* FIXME - Somehow */
- wl2 = ProgressbarsListWindows(&wnum);
- if (wl2)
- {
- for (i = 0; i < wnum; i++)
- _APPEND_TO_WIN_LIST(wl2[i]);
- Efree(wl2);
- }
- if (init_win_ext)
- {
- _APPEND_TO_WIN_LIST(init_win_ext);
- }
- if (init_win1)
+ if (desk == 0)
{
- _APPEND_TO_WIN_LIST(init_win1);
- _APPEND_TO_WIN_LIST(init_win2);
+ wl2 = ProgressbarsListWindows(&wnum);
+ if (wl2)
+ {
+ for (i = 0; i < wnum; i++)
+ _APPEND_TO_WIN_LIST(wl2[i]);
+ Efree(wl2);
+ }
+ if (init_win_ext)
+ {
+ _APPEND_TO_WIN_LIST(init_win_ext);
+ }
+ if (init_win1)
+ {
+ _APPEND_TO_WIN_LIST(init_win1);
+ _APPEND_TO_WIN_LIST(init_win2);
+ }
}
#endif
lst = EwinListGetStacking(&wnum);
blst = (Button **) ListItemType(&bnum, LIST_TYPE_BUTTON);
- /* Sticky buttons */
- for (i = 0; i < bnum; i++)
- {
- if (ButtonIsSticky(blst[i]))
- _APPEND_TO_WIN_LIST(ButtonGetWindow(blst[i]));
- }
-
/* Floating EWins */
- if (lst)
- {
- for (i = 0; i < wnum; i++)
- {
- if (!EoIsFloating(lst[i]))
- continue;
-
- _APPEND_TO_WIN_LIST(EoGetWin(lst[i]));
- }
- }
-
- /* The virtual desktop windows */
- for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
+ for (i = 0; i < wnum; i++)
{
- if (desks.order[i] == 0)
- break;
+ ewin = lst[i];
+ if (!EoIsFloating(lst[i]) || EoGetDesk(ewin) != desk)
+ continue;
- _APPEND_TO_WIN_LIST(desks.desk[desks.order[i]].win);
+ _APPEND_TO_WIN_LIST(EoGetWin(lst[i]));
}
- /* Non-sticky, "above" buttons */
+ /* "Above" buttons */
for (i = 0; i < bnum; i++)
{
if (ButtonIsAbove(blst[i], desk))
_APPEND_TO_WIN_LIST(ButtonGetWindow(blst[i]));
}
+ if (desk == 0)
+ {
+ /* The virtual desktop windows */
+ for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
+ {
+ if (desks.order[i] == 0)
+ break;
+
+ _APPEND_TO_WIN_LIST(desks.desk[desks.order[i]].win);
+ }
+ }
+
/* Normal EWins on this desk */
for (i = 0; i < wnum; i++)
{
ewin = lst[i];
- if (EoGetDesk(ewin) != desk || EoIsFloating(ewin))
+ if (EoIsFloating(ewin) || EoGetDesk(ewin) != desk)
continue;
_APPEND_TO_WIN_LIST(EoGetWin(ewin));
@@ -1197,15 +1217,19 @@
#endif
}
- /* Non-sticky, "below" buttons */
+ /* "Normal" buttons */
for (i = 0; i < bnum; i++)
{
- if (ButtonIsBelow(blst[i], desk))
+ if (ButtonIsNormal(blst[i], desk))
_APPEND_TO_WIN_LIST(ButtonGetWindow(blst[i]));
}
- /* The current (virtual) root window */
- _APPEND_TO_WIN_LIST(desks.desk[desk].win);
+ /* "Below" buttons */
+ for (i = 0; i < bnum; i++)
+ {
+ if (ButtonIsBelow(blst[i], desk))
+ _APPEND_TO_WIN_LIST(ButtonGetWindow(blst[i]));
+ }
if (EventDebug(EDBUG_TYPE_STACKING))
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewins.c,v
retrieving revision 1.1.2.27
retrieving revision 1.1.2.28
diff -u -3 -r1.1.2.27 -r1.1.2.28
--- ewins.c 13 Nov 2004 10:41:56 -0000 1.1.2.27
+++ ewins.c 20 Nov 2004 20:48:56 -0000 1.1.2.28
@@ -618,7 +618,6 @@
EWin **lst;
int i, k, num, speed, fx, fy, x, y;
char doslide, manplace;
- char cangrab = 0;
EDBUG(3, "AddToFamily");
@@ -762,18 +761,11 @@
if ((!ewin->client.transient) && (Conf.place.manual)
&& (!ewin->client.already_placed) && (!Mode.wm.startup) &&
(!Mode.place))
{
+ char cangrab;
+
cangrab = GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
- if ((cangrab == GrabNotViewable) || (cangrab == AlreadyGrabbed)
- || (cangrab == GrabFrozen))
- {
- XUngrabPointer(disp, CurrentTime);
- cangrab = 0;
- }
- else
- {
- manplace = 1;
- cangrab = 1;
- }
+ if (cangrab == GrabSuccess)
+ manplace = 1;
}
/* if it hasn't been placed yet.... find a spot for it */
@@ -794,10 +786,8 @@
/* the window there */
GotoDesktop(EoGetDesk(ewin));
- GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx,
&wy, &mask);
- XUngrabPointer(disp, CurrentTime);
Mode.x = rx;
Mode.y = ry;
ewin->client.already_placed = 1;
@@ -833,6 +823,7 @@
EwinBorderDraw(ewin, 1, 0);
MoveEwinToDesktopAt(ewin, EoGetDesk(ewin), x, y);
ecore_x_ungrab();
+ ewin->state = EWIN_STATE_MAPPED;
EwinIconify(ewin);
ewin->state = EWIN_STATE_ICONIC;
EDBUG_RETURN_;
@@ -1897,6 +1888,9 @@
{
switch (ev->type)
{
+ case EnterNotify:
+ FocusHandleEnter(NULL, ev);
+ break;
case LeaveNotify:
FocusHandleLeave(NULL, ev);
break;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.81.2.9
retrieving revision 1.81.2.10
diff -u -3 -r1.81.2.9 -r1.81.2.10
--- focus.c 13 Nov 2004 10:41:56 -0000 1.81.2.9
+++ focus.c 20 Nov 2004 20:48:57 -0000 1.81.2.10
@@ -246,7 +246,7 @@
case FOCUS_DESK_ENTER:
ewin = FocusEwinSelect();
if (!ewin)
- EDBUG_RETURN_;
+ goto done;
break;
case FOCUS_NONE:
@@ -355,7 +355,8 @@
/* Set new focus window (if any) highlighting */
if (Mode.focuswin)
FocusEwinSetActive(Mode.focuswin, 1);
- ICCCM_Focus(ewin);
+ if (why != FOCUS_DESK_LEAVE)
+ ICCCM_Focus(ewin);
EDBUG_RETURN_;
}
@@ -406,6 +407,8 @@
{
Window win = ev->xcrossing.window;
+ Mode.mouse_over_ewin = ewin;
+
if (!ewin)
{
/* Entering root may mean entering this screen */
@@ -414,9 +417,8 @@
ev->xcrossing.detail != NotifyInferior))
{
FocusToEWin(NULL, FOCUS_DESK_ENTER);
+ return;
}
- Mode.mouse_over_ewin = ewin;
- return;
}
Mode.mouse_over_ewin = ewin;
@@ -448,7 +450,7 @@
if (win == VRoot.win &&
(ev->xcrossing.mode == NotifyNormal &&
ev->xcrossing.detail != NotifyInferior))
- FocusToEWin(NULL, FOCUS_SET);
+ FocusToEWin(NULL, FOCUS_DESK_LEAVE);
}
void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/grabs.c,v
retrieving revision 1.17.2.5
retrieving revision 1.17.2.6
diff -u -3 -r1.17.2.5 -r1.17.2.6
--- grabs.c 10 Oct 2004 11:17:38 -0000 1.17.2.5
+++ grabs.c 20 Nov 2004 20:48:57 -0000 1.17.2.6
@@ -22,6 +22,7 @@
*/
#include "E.h"
+#if 0 /* Unused */
void
GrabButtonsSet(Window win, unsigned int csr)
{
@@ -34,15 +35,16 @@
Mode.grabs.pointer_grab_window = win;
Mode.grabs.pointer_grab_active = 1;
}
+#endif
int
GrabPointerSet(Window win, unsigned int csr, int confine)
{
- int ret;
+ int ret = -1;
Window confine_to = (confine) ? win : None;
if (Mode.grabs.pointer_grab_active)
- return 1;
+ goto done;
ret = XGrabPointer(disp, win, False,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
@@ -52,8 +54,11 @@
Mode.grabs.pointer_grab_window = win;
Mode.grabs.pointer_grab_active = 1;
+
+ done:
if (EventDebug(EDBUG_TYPE_GRABS))
- Eprintf("GrabPointerSet %#lx ok=%d\n", win, ret);
+ Eprintf("GrabPointerSet: %#lx, ret=%d\n", Mode.grabs.pointer_grab_window,
+ ret);
return ret;
}
@@ -62,14 +67,16 @@
GrabPointerRelease(void)
{
if (!Mode.grabs.pointer_grab_active)
- return;
+ goto done;
XUngrabPointer(disp, CurrentTime);
+ done:
+ if (EventDebug(EDBUG_TYPE_GRABS))
+ Eprintf("GrabPointerRelease: %#lx\n", Mode.grabs.pointer_grab_window);
+
Mode.grabs.pointer_grab_active = 0;
Mode.grabs.pointer_grab_window = None;
- if (EventDebug(EDBUG_TYPE_GRABS))
- Eprintf("GrabPointerRelease\n");
}
void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.34
retrieving revision 1.174.2.35
diff -u -3 -r1.174.2.34 -r1.174.2.35
--- ipc.c 19 Nov 2004 21:02:26 -0000 1.174.2.34
+++ ipc.c 20 Nov 2004 20:48:57 -0000 1.174.2.35
@@ -914,17 +914,16 @@
{
if (!strcmp(param1, "?"))
{
- if (ewin == GetFocusEwin())
- {
- IpcPrintf("focused: yes");
- }
- else
- {
- IpcPrintf("focused: no");
- }
+ IpcPrintf("focused: %s", (ewin == GetFocusEwin())? "yes" : "no");
}
else
{
+ GotoDesktopByEwin(ewin);
+ if (ewin->iconified)
+ EwinOpIconify(ewin, 0);
+ if (ewin->shaded)
+ EwinOpShade(ewin, 0);
+ EwinOpRaise(ewin);
FocusToEWin(ewin, FOCUS_SET);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/menus-misc.c,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -3 -r1.1.2.13 -r1.1.2.14
--- menus-misc.c 13 Nov 2004 10:41:56 -0000 1.1.2.13
+++ menus-misc.c 20 Nov 2004 20:48:58 -0000 1.1.2.14
@@ -608,7 +608,7 @@
if (lst[i]->skipwinlist || !EwinGetTitle(lst[i]))
continue;
- Esnprintf(s, sizeof(s), "focus %lu", lst[i]->client.win);
+ Esnprintf(s, sizeof(s), "wop %#lx focus", lst[i]->client.win);
mi = MenuItemCreate(EwinGetTitle(lst[i]), NULL, s, NULL);
MenuAddItem(m, mi);
}
@@ -674,7 +674,7 @@
EoGetDesk(lst[i]) != j)
continue;
- Esnprintf(s, sizeof(s), "focus %lu", lst[i]->client.win);
+ Esnprintf(s, sizeof(s), "wop %#lx focus", lst[i]->client.win);
mi = MenuItemCreate(EwinGetTitle(lst[i]), NULL, s, NULL);
MenuAddItem(mm, mi);
}
@@ -742,7 +742,7 @@
for (j = 0; j < lst[i]->num_members; j++)
{
- Esnprintf(s, sizeof(s), "focus %lu",
+ Esnprintf(s, sizeof(s), "wop %#lx focus",
lst[i]->members[j]->client.win);
mi = MenuItemCreate(EwinGetTitle(lst[i]->members[j]), NULL,
s, NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.147.2.19
retrieving revision 1.147.2.20
diff -u -3 -r1.147.2.19 -r1.147.2.20
--- menus.c 19 Nov 2004 21:02:43 -0000 1.147.2.19
+++ menus.c 20 Nov 2004 20:48:58 -0000 1.147.2.20
@@ -1027,7 +1027,6 @@
m = FindItem(name, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU);
if (m)
{
- XUngrabPointer(disp, CurrentTime);
if (!FindEwinByMenu(m)) /* Don't show if already shown */
MenuShow(m, 0);
Mode_menus.list[0] = m;
@@ -1157,8 +1156,6 @@
EDBUG(5, "ShowInternalMenu");
- XUngrabPointer(disp, CurrentTime);
-
if (!ms)
{
ms = FindItem(style, 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE);
@@ -1411,7 +1408,6 @@
Mode_menus.list[0] = m;
Mode_menus.current_depth = 1;
MenuShowMasker(m);
- XUngrabPointer(disp, CurrentTime);
ewin = FindEwinByMenu(m);
if (ewin)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.22.2.12
retrieving revision 1.22.2.13
diff -u -3 -r1.22.2.12 -r1.22.2.13
--- moveresize.c 13 Nov 2004 10:41:56 -0000 1.22.2.12
+++ moveresize.c 20 Nov 2004 20:48:58 -0000 1.22.2.13
@@ -166,12 +166,7 @@
Conf.movemode = move_mode_real;
Mode.nogroup = 0;
Mode.move.swap = 0;
-
- if (Mode.have_place_grab)
- {
- Mode.have_place_grab = 0;
- XUngrabPointer(disp, CurrentTime);
- }
+ Mode.have_place_grab = 0;
ModulesSignal(ESIGNAL_MOVE_DONE, NULL);
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs