Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
Tag: branch-exp
E.h actions.c borders.c buttons.c ecompmgr.c ecore-e16.c
ecore-e16.h events.c ewmh.c focus.c ipc.c menus.c mod-misc.c
warp.c
Log Message:
Bits and pieces.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.57
retrieving revision 1.314.2.58
diff -u -3 -r1.314.2.57 -r1.314.2.58
--- E.h 23 Oct 2004 14:23:38 -0000 1.314.2.57
+++ E.h 27 Oct 2004 23:32:47 -0000 1.314.2.58
@@ -1072,7 +1072,6 @@
int mode;
char place;
char flipp;
- Button *button;
int resize_detail;
int win_x, win_y, win_w, win_h;
int start_x, start_y;
@@ -1098,9 +1097,10 @@
char keybinds_changed;
Window button_proxy_win;
const XEvent *current_event;
+ Time last_time;
Window last_bpress;
unsigned int last_button;
- Time last_time;
+ unsigned int last_keycode;
char double_click;
char queue_up;
}
@@ -2218,6 +2218,9 @@
int x, int y, const char *text, Efont * f,
Visual * vis, Colormap cm);
+/* warp.c */
+void WarpFocus(int delta);
+
/* windowmatch.c */
int WindowMatchConfigLoad(FILE * fs);
Border *MatchEwinBorder(EWin * ewin, WindowMatch * b);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.174.2.20
retrieving revision 1.174.2.21
diff -u -3 -r1.174.2.20 -r1.174.2.21
--- actions.c 20 Oct 2004 21:04:02 -0000 1.174.2.20
+++ actions.c 27 Oct 2004 23:32:49 -0000 1.174.2.21
@@ -155,8 +155,6 @@
void
ActionsHandleMotion(void)
{
- int dx, dy;
-
switch (Mode.mode)
{
case MODE_MOVE_PENDING:
@@ -174,39 +172,6 @@
DeskDragMotion();
break;
- case MODE_BUTTONDRAG:
- dx = Mode.x - Mode.px;
- dy = Mode.y - Mode.py;
-#if 0
- if (Mode.button_move_pending)
- {
- int x, y;
-
- x = Mode.x - Mode.start_x;
- y = Mode.y - Mode.start_y;
- if (x < 0)
- x = -x;
- if (y < 0)
- y = -y;
- if ((x > Conf.button_move_resistance)
- || (y > Conf.button_move_resistance))
- Mode.button_move_pending = 0;
- }
- if (!Mode.button_move_pending)
- {
- if (Mode.button)
- {
- ButtonMoveRelative(Mode.button, dx, dy);
- if (Conf.deskmode == MODE_DESKRAY)
- {
- MoveDesktop(Mode.deskdrag, desks.desk[Mode.deskdrag].x,
- desks.desk[Mode.deskdrag].y + dy);
- }
- }
- }
-#endif
- break;
-
default:
break;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.221.2.15
retrieving revision 1.221.2.16
diff -u -3 -r1.221.2.15 -r1.221.2.16
--- borders.c 17 Oct 2004 08:47:24 -0000 1.221.2.15
+++ borders.c 27 Oct 2004 23:32:50 -0000 1.221.2.16
@@ -988,14 +988,16 @@
wbit->state = STATE_HILITED;
else
wbit->state = STATE_NORMAL;
- wbit->left = 0;
#if DEBUG_BORDER_EVENTS
Eprintf("BorderWinpartEventMouseUp %#lx %d\n", wbit->win, wbit->state);
#endif
BorderWinpartChange(ewin, part, 0);
- if (wbit->win == Mode.last_bpress && ewin->border->part[part].aclass)
+ if (wbit->win == Mode.last_bpress && !wbit->left &&
+ ewin->border->part[part].aclass)
EventAclass(ev, ewin, ewin->border->part[part].aclass);
+
+ wbit->left = 0;
}
static void
@@ -1027,9 +1029,9 @@
#if DEBUG_BORDER_EVENTS
Eprintf("BorderWinpartEventLeave %#lx %d\n", wbit->win, wbit->state);
#endif
-#if 0
if (wbit->state == STATE_CLICKED)
wbit->left = 1;
+#if 0
else
{
wbit->state = STATE_NORMAL;
@@ -1038,10 +1040,13 @@
EventAclass(ev, ewin, ewin->border->part[part].aclass);
}
#else
- wbit->left = 0;
+ else
+ {
+ if (ewin->border->part[part].aclass)
+ EventAclass(ev, ewin, ewin->border->part[part].aclass);
+ }
wbit->state = STATE_NORMAL;
BorderWinpartChange(ewin, part, 0);
- ev = NULL;
#endif
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.36.2.13
retrieving revision 1.36.2.14
diff -u -3 -r1.36.2.13 -r1.36.2.14
--- buttons.c 20 Oct 2004 21:04:05 -0000 1.36.2.13
+++ buttons.c 27 Oct 2004 23:32:51 -0000 1.36.2.14
@@ -22,6 +22,11 @@
*/
#include "E.h"
+#define BUTTON_EVENT_MASK \
+ (ExposureMask | KeyPressMask | KeyReleaseMask | \
+ ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask)
+/* PointerMotionMask */
+
typedef struct _bgeometry
{
Constraints width, height;
@@ -59,6 +64,11 @@
unsigned int ref_count;
};
+static struct
+{
+ Button *button;
+} Mode_button;
+
static void ButtonHandleEvents(XEvent * ev, void *btn);
Button *
@@ -126,10 +136,7 @@
b->used = 0;
b->left = 0;
EoSetWin(b, ECreateWindow(DeskGetWin(desk), -100, -100, 50, 50, 0));
- XSelectInput(disp, EoGetWin(b),
- ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask |
- ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
+ XSelectInput(disp, EoGetWin(b), BUTTON_EVENT_MASK);
EventCallbackRegister(EoGetWin(b), 0, ButtonHandleEvents, b);
EoSetX(b, -1);
EoSetY(b, -1);
@@ -571,43 +578,25 @@
EDBUG_RETURN(0);
}
-#if 0 /* FIXME - Fix */
-
-static int
-doDragButtonStart(EWin * edummy __UNUSED__, const char *params __UNUSED__)
+static void
+ButtonDragStart(Button * b)
{
- Button *b;
-
- b = Mode.button;
- if (!b)
- return 0;
-
if (ButtonIsFixed(b))
- {
- Mode.button = NULL;
- return 0;
- }
+ return;
- GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
+ GrabPointerSet(EoGetWin(b), ECSR_GRAB, 0);
Mode.mode = MODE_BUTTONDRAG;
Mode.button_move_pending = 1;
Mode.start_x = Mode.x;
Mode.start_y = Mode.y;
ButtonGetGeometry(b, &Mode.win_x, &Mode.win_y, NULL, NULL);
-
- return 0;
}
-int
-doDragButtonEnd(const char *params __UNUSED__)
+static void
+ButtonDragEnd(Button * b)
{
- Button *b;
int d;
- b = Mode.button;
- if (!b)
- return 0;
-
Mode.mode = MODE_NONE;
GrabPointerRelease();
if (!Mode.button_move_pending)
@@ -615,16 +604,13 @@
d = DesktopAt(Mode.x, Mode.y);
ButtonMoveToDesktop(b, d);
d = ButtonGetDesktop(b);
- ButtonMoveRelative(b, -desks.desk[d].x, -desks.desk[d].y);
+ ButtonMoveRelative(b, -DeskGetX(d), -DeskGetY(d));
}
else
Mode.button_move_pending = 0;
autosave();
-
- return 0;
}
-#endif
/*
* Functions operating on all buttons
@@ -675,6 +661,8 @@
Window win = ev->xbutton.window;
ActionClass *ac;
+ Mode_button.button = b;
+
GrabPointerSet(win, ECSR_GRAB, 0);
if (b->inside_win)
@@ -684,7 +672,6 @@
ev->xbutton.window = win;
}
- Mode.button = b;
b->state = STATE_CLICKED;
ButtonDraw(b);
@@ -707,22 +694,64 @@
ev->xbutton.window = win;
}
- Mode.button = b;
if ((b->state == STATE_CLICKED) && (!b->left))
b->state = STATE_HILITED;
else
b->state = STATE_NORMAL;
- b->left = 0;
ButtonDraw(b);
- if (b->aclass)
+ if (b->aclass && !b->left)
EventAclass(ev, NULL, b->aclass);
+
+ b->left = 0;
+
+ if (Mode.mode == MODE_BUTTONDRAG)
+ ButtonDragEnd(Mode_button.button);
+ Mode_button.button = NULL;
+}
+
+static void
+ButtonEventMotion(Button * b, XEvent * ev __UNUSED__)
+{
+ int dx, dy;
+
+ if (Mode.mode != MODE_BUTTONDRAG)
+ return;
+
+ dx = Mode.x - Mode.px;
+ dy = Mode.y - Mode.py;
+
+ if (Mode.button_move_pending)
+ {
+ int x, y;
+
+ x = Mode.x - Mode.start_x;
+ y = Mode.y - Mode.start_y;
+ if (x < 0)
+ x = -x;
+ if (y < 0)
+ y = -y;
+ if ((x > Conf.button_move_resistance) ||
+ (y > Conf.button_move_resistance))
+ Mode.button_move_pending = 0;
+ }
+ if (!Mode.button_move_pending)
+ {
+ if (b)
+ {
+ ButtonMoveRelative(b, dx, dy);
+ if (Conf.deskmode == MODE_DESKRAY)
+ {
+ MoveDesktop(Mode.deskdrag, DeskGetX(Mode.deskdrag),
+ DeskGetY(Mode.deskdrag) + dy);
+ }
+ }
+ }
}
static void
ButtonEventMouseIn(Button * b, XEvent * ev)
{
- Mode.button = b;
if (b->state == STATE_CLICKED)
b->left = 0;
else
@@ -737,7 +766,6 @@
static void
ButtonEventMouseOut(Button * b, XEvent * ev)
{
- Mode.button = NULL;
if (b->state == STATE_CLICKED)
b->left = 1;
else
@@ -762,6 +790,9 @@
case ButtonRelease:
ButtonEventMouseUp(b, ev);
break;
+ case MotionNotify:
+ ButtonEventMotion(b, ev);
+ break;
case EnterNotify:
ButtonEventMouseIn(b, ev);
break;
@@ -1201,6 +1232,11 @@
Efree(lst);
}
+ else if (!strncmp(cmd, "move", 2))
+ {
+ if (Mode_button.button)
+ ButtonDragStart(Mode_button.button);
+ }
}
static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecompmgr.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- ecompmgr.c 25 Oct 2004 22:14:21 -0000 1.1.2.4
+++ ecompmgr.c 27 Oct 2004 23:32:52 -0000 1.1.2.5
@@ -348,6 +348,8 @@
ECompMgrDamageMerge(ERegionCreate(0, 0, VRoot.w, VRoot.h), 1);
desks[desk].bgpict = pict;
+
+ return pict;
}
static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecore-e16.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -3 -r1.1.2.3 -r1.1.2.4
--- ecore-e16.c 23 Oct 2004 15:36:27 -0000 1.1.2.3
+++ ecore-e16.c 27 Oct 2004 23:32:52 -0000 1.1.2.4
@@ -25,6 +25,9 @@
*/
#include "E.h"
+#define _ATOM_GET(name) \
+ XInternAtom(_ecore_x_disp, name, False)
+
#define _ATOM_SET_UTF8_STRING(atom, win, string) \
XChangeProperty(_ecore_x_disp, win, atom, _ecore_x_atom_utf8_string, 8,
PropModeReplace, \
(unsigned char *)string, strlen(string))
@@ -177,6 +180,9 @@
#ifndef USE_ECORE_X
Atom _ecore_x_atom_utf8_string;
+Atom _ecore_x_atom_net_supported;
+Atom _ecore_x_atom_net_supporting_wm_check;
+
Atom _ecore_x_atom_net_number_of_desktops;
Atom _ecore_x_atom_net_virtual_roots;
Atom _ecore_x_atom_net_desktop_names;
@@ -190,38 +196,106 @@
Atom _ecore_x_atom_net_client_list_stacking;
Atom _ecore_x_atom_net_active_window;
+Atom _ecore_x_atom_net_wm_name;
+
void
ecore_x_netwm_init(void)
{
_ecore_x_atom_utf8_string = XInternAtom(_ecore_x_disp, "UTF8_STRING", False);
- _ecore_x_atom_net_number_of_desktops =
- XInternAtom(_ecore_x_disp, "_NET_NUMBER_OF_DESKTOPS", False);
- _ecore_x_atom_net_virtual_roots =
- XInternAtom(_ecore_x_disp, "_NET_VIRTUAL_ROOTS", False);
- _ecore_x_atom_net_desktop_names =
- XInternAtom(_ecore_x_disp, "_NET_DESKTOP_NAMES", False);
- _ecore_x_atom_net_desktop_geometry =
- XInternAtom(_ecore_x_disp, "_NET_DESKTOP_GEOMETRY", False);
- _ecore_x_atom_net_workarea =
- XInternAtom(_ecore_x_disp, "_NET_WORKAREA", False);
- _ecore_x_atom_net_current_desktop =
- XInternAtom(_ecore_x_disp, "_NET_CURRENT_DESKTOP", False);
- _ecore_x_atom_net_desktop_viewport =
- XInternAtom(_ecore_x_disp, "_NET_DESKTOP_VIEWPORT", False);
- _ecore_x_atom_net_showing_desktop =
- XInternAtom(_ecore_x_disp, "_NET_SHOWING_DESKTOP", False);
+ _ecore_x_atom_net_supported = _ATOM_GET("_NET_SUPPORTED");
+ _ecore_x_atom_net_supporting_wm_check =
+ _ATOM_GET("_NET_SUPPORTING_WM_CHECK");
+
+ _ecore_x_atom_net_number_of_desktops = _ATOM_GET("_NET_NUMBER_OF_DESKTOPS");
+ _ecore_x_atom_net_virtual_roots = _ATOM_GET("_NET_VIRTUAL_ROOTS");
+ _ecore_x_atom_net_desktop_geometry = _ATOM_GET("_NET_DESKTOP_GEOMETRY");
+ _ecore_x_atom_net_desktop_names = _ATOM_GET("_NET_DESKTOP_NAMES");
+ _ecore_x_atom_net_current_desktop = _ATOM_GET("_NET_CURRENT_DESKTOP");
+ _ecore_x_atom_net_desktop_viewport = _ATOM_GET("_NET_DESKTOP_VIEWPORT");
+ _ecore_x_atom_net_workarea = _ATOM_GET("_NET_WORKAREA");
- _ecore_x_atom_net_client_list =
- XInternAtom(_ecore_x_disp, "_NET_CLIENT_LIST", False);
+ _ecore_x_atom_net_client_list = _ATOM_GET("_NET_CLIENT_LIST");
_ecore_x_atom_net_client_list_stacking =
- XInternAtom(_ecore_x_disp, "_NET_CLIENT_LIST_STACKING", False);
- _ecore_x_atom_net_active_window =
- XInternAtom(_ecore_x_disp, "_NET_ACTIVE_WINDOW", False);
+ _ATOM_GET("_NET_CLIENT_LIST_STACKING");
+ _ecore_x_atom_net_active_window = _ATOM_GET("_NET_ACTIVE_WINDOW");
+
+#if 0
+ _ecore_x_atom_net_close_window = _ATOM_GET("_NET_CLOSE_WINDOW");
+ _ecore_x_atom_net_wm_moveresize = _ATOM_GET("_NET_WM_MOVERESIZE");
+#endif
+
+ _ecore_x_atom_net_wm_name = _ATOM_GET("_NET_WM_NAME");
+#if 0
+ _ecore_x_atom_net_wm_visible_name = _ATOM_GET("_NET_WM_VISIBLE_NAME");
+ _ecore_x_atom_net_wm_icon_name = _ATOM_GET("_NET_WM_ICON_NAME");
+ _ecore_x_atom_net_wm_visible_icon_name =
+ _ATOM_GET("_NET_WM_VISIBLE_ICON_NAME");
+ _ecore_x_atom_net_wm_desktop = _ATOM_GET("_NET_WM_DESKTOP");
+ _ecore_x_atom_net_wm_window_type = _ATOM_GET("_NET_WM_WINDOW_TYPE");
+ _ecore_x_atom_net_wm_state = _ATOM_GET("_NET_WM_STATE");
+ _ecore_x_atom_net_wm_allowed_actions = _ATOM_GET("_NET_WM_ALLOWED_ACTIONS");
+ _ecore_x_atom_net_wm_strut = _ATOM_GET("_NET_WM_STRUT");
+ _ecore_x_atom_net_wm_strut_partial = _ATOM_GET("_NET_WM_STRUT_PARTIAL");
+ _ecore_x_atom_net_wm_icon_geometry = _ATOM_GET("_NET_WM_ICON_GEOMETRY");
+ _ecore_x_atom_net_wm_icon = _ATOM_GET("_NET_WM_ICON");
+ _ecore_x_atom_net_wm_pid = _ATOM_GET("_NET_WM_PID");
+ _ecore_x_atom_net_wm_user_time = _ATOM_GET("_NET_WM_USER_TIME");
+
+ _ecore_x_atom_net_wm_window_type_desktop =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_DESKTOP");
+ _ecore_x_atom_net_wm_window_type_dock =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_DOCK");
+ _ecore_x_atom_net_wm_window_type_toolbar =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_TOOLBAR");
+ _ecore_x_atom_net_wm_window_type_menu =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_MENU");
+ _ecore_x_atom_net_wm_window_type_utility =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_UTILITY");
+ _ecore_x_atom_net_wm_window_type_splash =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_SPLASH");
+ _ecore_x_atom_net_wm_window_type_dialog =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_DIALOG");
+ _ecore_x_atom_net_wm_window_type_normal =
+ _ATOM_GET("_NET_WM_WINDOW_TYPE_NORMAL");
+
+ _ecore_x_atom_net_wm_state_modal = _ATOM_GET("_NET_WM_STATE_MODAL");
+ _ecore_x_atom_net_wm_state_sticky = _ATOM_GET("_NET_WM_STATE_STICKY");
+ _ecore_x_atom_net_wm_state_maximized_vert =
+ _ATOM_GET("_NET_WM_STATE_MAXIMIZED_VERT");
+ _ecore_x_atom_net_wm_state_maximized_horz =
+ _ATOM_GET("_NET_WM_STATE_MAXIMIZED_HORZ");
+ _ecore_x_atom_net_wm_state_shaded = _ATOM_GET("_NET_WM_STATE_SHADED");
+ _ecore_x_atom_net_wm_state_skip_taskbar =
+ _ATOM_GET("_NET_WM_STATE_SKIP_TASKBAR");
+ _ecore_x_atom_net_wm_state_skip_pager =
+ _ATOM_GET("_NET_WM_STATE_SKIP_PAGER");
+ _ecore_x_atom_net_wm_state_hidden = _ATOM_GET("_NET_WM_STATE_HIDDEN");
+ _ecore_x_atom_net_wm_state_fullscreen =
+ _ATOM_GET("_NET_WM_STATE_FULLSCREEN");
+ _ecore_x_atom_net_wm_state_above = _ATOM_GET("_NET_WM_STATE_ABOVE");
+ _ecore_x_atom_net_wm_state_below = _ATOM_GET("_NET_WM_STATE_BELOW");
+
+ _ecore_x_atom_net_wm_window_opacity = _ATOM_GET("_NET_WM_WINDOW_OPACITY");
+#endif
}
#endif
/*
+ * WM identification
+ */
+void
+ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check,
+ const char *wm_name)
+{
+ _ATOM_SET_WINDOW(_ecore_x_atom_net_supporting_wm_check, root, &check, 1);
+ _ATOM_SET_WINDOW(_ecore_x_atom_net_supporting_wm_check, check, &check, 1);
+ _ATOM_SET_UTF8_STRING(_ecore_x_atom_net_wm_name, check, wm_name);
+ /* This one isn't mandatory */
+ _ATOM_SET_UTF8_STRING(_ecore_x_atom_net_wm_name, root, wm_name);
+}
+
+/*
* Desktop configuration and status
*/
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecore-e16.h,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -3 -r1.1.2.7 -r1.1.2.8
--- ecore-e16.h 23 Oct 2004 15:36:27 -0000 1.1.2.7
+++ ecore-e16.h 27 Oct 2004 23:32:52 -0000 1.1.2.8
@@ -68,6 +68,9 @@
void ecore_x_icccm_init(void);
/* NETWM (EWMH) */
+extern Atom _ecore_x_atom_net_supported;
+extern Atom _ecore_x_atom_net_supporting_wm_check;
+
extern Atom _ecore_x_atom_net_number_of_desktops;
extern Atom _ecore_x_atom_net_virtual_roots;
extern Atom _ecore_x_atom_net_desktop_names;
@@ -79,8 +82,14 @@
extern Atom _ecore_x_atom_net_showing_desktop;
+extern Atom _ecore_x_atom_net_wm_name;
+
void ecore_x_netwm_init(void);
+void ecore_x_netwm_wm_identify(Ecore_X_Window root,
+ Ecore_X_Window check,
+ const char *wm_name);
+
void ecore_x_netwm_desk_count_set(Ecore_X_Window root,
int n_desks);
void ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.69.2.15
retrieving revision 1.69.2.16
diff -u -3 -r1.69.2.15 -r1.69.2.16
--- events.c 25 Oct 2004 22:14:21 -0000 1.69.2.15
+++ events.c 27 Oct 2004 23:32:52 -0000 1.69.2.16
@@ -163,6 +163,7 @@
{
void **lst;
int i, num;
+ Slideout *pslideout = NULL;
EDBUG(7, "HandleEvent");
@@ -175,6 +176,7 @@
switch (ev->type)
{
case KeyPress:
+ Mode.last_keycode = ev->xkey.keycode;
case KeyRelease:
case ButtonPress:
case ButtonRelease:
@@ -212,8 +214,6 @@
switch (ev->type)
{
- Slideout *pslideout;
-
case KeyPress: /* 2 */
case KeyRelease: /* 3 */
break;
@@ -249,9 +249,6 @@
ActionsEnd(NULL);
- if ((Mode.slideout) && (pslideout))
- SlideoutHide(Mode.slideout);
-
Mode.action_inhibit = 0;
break;
case MotionNotify: /* 6 */
@@ -323,6 +320,10 @@
if (MenusActive() && (!Mode.justclicked))
MenusHide();
+
+ if ((Mode.slideout) && (pslideout))
+ SlideoutHide(Mode.slideout);
+
Mode.justclicked = 0;
Mode.last_bpress = 0;
break;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.55.2.13
retrieving revision 1.55.2.14
diff -u -3 -r1.55.2.13 -r1.55.2.14
--- ewmh.c 23 Oct 2004 15:36:27 -0000 1.55.2.13
+++ ewmh.c 27 Oct 2004 23:32:52 -0000 1.55.2.14
@@ -202,6 +202,11 @@
E_XA_UTF8_STRING = XInternAtom(disp, "UTF8_STRING", False);
+#ifndef USE_ECORE_X
+ /* FIXME - TBD */
+ ecore_x_netwm_init();
+#endif
+
atom_count = 0;
_ATOM_INIT(_NET_SUPPORTED);
@@ -257,16 +262,7 @@
_ATOM_SET_ATOM(_NET_SUPPORTED, VRoot.win, atom_list, atom_count);
/* Set WM info properties */
- _ATOM_SET_UTF8_STRING(_NET_WM_NAME, VRoot.win, e_wm_name);
-
- _ATOM_SET_WINDOW(_NET_SUPPORTING_WM_CHECK, VRoot.win, &win_wm_check, 1);
- _ATOM_SET_WINDOW(_NET_SUPPORTING_WM_CHECK, win_wm_check, &win_wm_check, 1);
- _ATOM_SET_UTF8_STRING(_NET_WM_NAME, win_wm_check, e_wm_name);
-
-#ifndef USE_ECORE_X
- /* FIXME - TBD */
- ecore_x_netwm_init();
-#endif
+ ecore_x_netwm_wm_identify(VRoot.win, win_wm_check, e_wm_name);
EWMH_SetDesktopCount();
EWMH_SetDesktopRoots();
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.81.2.7
retrieving revision 1.81.2.8
diff -u -3 -r1.81.2.7 -r1.81.2.8
--- focus.c 17 Oct 2004 08:47:25 -0000 1.81.2.7
+++ focus.c 27 Oct 2004 23:32:52 -0000 1.81.2.8
@@ -482,3 +482,158 @@
FocusToEWin(ewin, FOCUS_CLICK);
}
}
+
+#if 0 /* FIXME - Move elsewhere */
+/* Focus actions */
+
+static int
+doFocusSet(EWin * ewin, const char *params __UNUSED__)
+{
+ GotoDesktopByEwin(ewin);
+
+ if (ewin->iconified)
+ EwinDeIconify(ewin);
+ if (ewin->shaded)
+ EwinUnShade(ewin);
+ RaiseEwin(ewin);
+ FocusToEWin(ewin, FOCUS_SET);
+
+ return 0;
+}
+#endif
+
+static void
+FocusIpc(const char *params, Client * c __UNUSED__)
+{
+ const char *p;
+ char cmd[128], prm[4096];
+ int len;
+
+ cmd[0] = prm[0] = '\0';
+ p = params;
+ if (p)
+ {
+ len = 0;
+ sscanf(p, "%100s %4000s %n", cmd, prm, &len);
+ p += len;
+ }
+
+ if (!p || cmd[0] == '?')
+ {
+ EWin *ewin;
+
+ ewin = GetFocusEwin();
+ if (ewin)
+ IpcPrintf("Focused: %#lx\n", ewin->client.win);
+ else
+ IpcPrintf("Focused: none\n");
+ }
+ else if (!strcmp(prm, "cfg"))
+ {
+ SettingsFocus();
+ }
+ else if (!strncmp(cmd, "mode", 2))
+ {
+ int mode = Conf.focus.mode;
+
+ if (!strcmp(prm, "click"))
+ {
+ mode = MODE_FOCUS_CLICK;
+ Mode.grabs.pointer_grab_active = 1;
+ }
+ else if (!strcmp(prm, "clicknograb"))
+ {
+ mode = MODE_FOCUS_CLICK;
+ Mode.grabs.pointer_grab_active = 0;
+ }
+ else if (!strcmp(prm, "pointer"))
+ {
+ mode = MODE_FOCUS_POINTER;
+ }
+ else if (!strcmp(prm, "sloppy"))
+ {
+ mode = MODE_FOCUS_SLOPPY;
+ }
+ else if (!strcmp(prm, "?"))
+ {
+ if (Conf.focus.mode == MODE_FOCUS_CLICK)
+ {
+ if (Mode.grabs.pointer_grab_active)
+ p = "click";
+ else
+ p = "clicknograb";
+ }
+ else if (Conf.focus.mode == MODE_FOCUS_SLOPPY)
+ p = "sloppy";
+ else if (Conf.focus.mode == MODE_FOCUS_POINTER)
+ p = "pointer";
+ else
+ p = "unknown";
+ IpcPrintf("Focus Mode: %s\n", p);
+ }
+ else
+ {
+ IpcPrintf("Error: unknown focus type\n");
+ }
+ if (Conf.focus.mode != mode)
+ {
+ Conf.focus.mode = mode;
+ FocusFix();
+ autosave();
+ }
+ }
+ else if (!strncmp(cmd, "next", 2))
+ {
+ if (Conf.warplist.enable)
+ WarpFocus(1);
+ else
+ FocusGetNextEwin();
+ }
+ else if (!strncmp(cmd, "prev", 2))
+ {
+ FocusGetPrevEwin();
+ }
+}
+
+IpcItem FocusIpcArray[] = {
+ {
+ FocusIpc,
+ "focus", "sf",
+ "Focus functions",
+ " focus ? Show focus info\n"
+ " focus mode Set focus mode. Modes:\n"
+ " click: The traditional click-to-focus mode.\n"
+ " clicknograb: A similar focus mode, but without the grabbing of the click\n"
+ " (you cannot click anywhere in a window to focus it)\n"
+ " pointer: The focus will follow the mouse pointer\n"
+ " sloppy: The focus follows the mouse, but when over the desktop
background\n"
+ " the last window does not lose the focus\n"}
+ ,
+};
+#define N_IPC_FUNCS (sizeof(FocusIpcArray)/sizeof(IpcItem))
+
+static const CfgItem FocusCfgItems[] = {
+ CFG_ITEM_INT(Conf.focus, mode, MODE_FOCUS_SLOPPY),
+ CFG_ITEM_BOOL(Conf.focus, clickraises, 0),
+ CFG_ITEM_BOOL(Conf.focus, transientsfollowleader, 1),
+ CFG_ITEM_BOOL(Conf.focus, switchfortransientmap, 1),
+ CFG_ITEM_BOOL(Conf.focus, all_new_windows_get_focus, 0),
+ CFG_ITEM_BOOL(Conf.focus, new_transients_get_focus, 0),
+ CFG_ITEM_BOOL(Conf.focus, new_transients_get_focus_if_group_focused, 1),
+ CFG_ITEM_BOOL(Conf.focus, raise_on_next, 1),
+ CFG_ITEM_BOOL(Conf.focus, warp_on_next, 0),
+
+ CFG_ITEM_BOOL(Conf, autoraise.enable, 0),
+ CFG_ITEM_INT(Conf, autoraise.delay, 500),
+};
+#define N_CFG_ITEMS (sizeof(FocusCfgItems)/sizeof(CfgItem))
+
+/*
+ * Module descriptor
+ */
+EModule ModFocus = {
+ "focus", NULL,
+ NULL,
+ {N_IPC_FUNCS, FocusIpcArray},
+ {N_CFG_ITEMS, FocusCfgItems}
+};
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.29
retrieving revision 1.174.2.30
diff -u -3 -r1.174.2.29 -r1.174.2.30
--- ipc.c 17 Oct 2004 08:47:26 -0000 1.174.2.29
+++ ipc.c 27 Oct 2004 23:32:52 -0000 1.174.2.30
@@ -371,94 +371,6 @@
}
static void
-IPC_SetFocus(const char *params, Client * c __UNUSED__)
-{
- char param1[FILEPATH_LEN_MAX];
- EWin *ewin;
-
- if (params == NULL)
- return;
-
- sscanf(params, "%1000s", param1);
-
- if (!strcmp(param1, "?"))
- {
- ewin = GetFocusEwin();
- if (ewin)
- IpcPrintf("focused: %#lx\n", ewin->client.win);
- else
- IpcPrintf("focused: none\n");
- }
- else
- {
- ewin = IpcFindEwin(param1);
- if (ewin)
- FocusToEWin(ewin, FOCUS_SET);
- else
- IpcPrintf("No matching EWin found\n");
- }
-}
-
-#if 0 /* FIXME - Move elsewhere */
-/* Focus actions */
-
-static int
-doFocusNext(EWin * edummy __UNUSED__, const char *params __UNUSED__)
-{
- FocusGetNextEwin();
- return 0;
-}
-
-static int
-doFocusPrev(EWin * edummy __UNUSED__, const char *params __UNUSED__)
-{
- FocusGetPrevEwin();
- return 0;
-}
-
-static int
-doFocusSet(EWin * ewin, const char *params __UNUSED__)
-{
- GotoDesktopByEwin(ewin);
-
- if (ewin->iconified)
- EwinDeIconify(ewin);
- if (ewin->shaded)
- EwinUnShade(ewin);
- RaiseEwin(ewin);
- FocusToEWin(ewin, FOCUS_SET);
-
- return 0;
-}
-
-static int
-doFocusModeSet(EWin * edummy __UNUSED__, const char *params)
-{
- if (params)
- {
- if (!strcmp("pointer", params))
- Conf.focus.mode = MODE_FOCUS_POINTER;
- else if (!strcmp("sloppy", params))
- Conf.focus.mode = MODE_FOCUS_SLOPPY;
- else if (!strcmp("click", params))
- Conf.focus.mode = MODE_FOCUS_CLICK;
- }
- else
- {
- if (Conf.focus.mode == MODE_FOCUS_POINTER)
- Conf.focus.mode = MODE_FOCUS_SLOPPY;
- else if (Conf.focus.mode == MODE_FOCUS_SLOPPY)
- Conf.focus.mode = MODE_FOCUS_CLICK;
- else if (Conf.focus.mode == MODE_FOCUS_CLICK)
- Conf.focus.mode = MODE_FOCUS_POINTER;
- }
- FocusFix();
- autosave();
- return 0;
-}
-#endif
-
-static void
IPC_MoveMode(const char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
@@ -1067,73 +979,6 @@
}
static void
-IPC_FocusMode(const char *params, Client * c)
-{
- char buf[FILEPATH_LEN_MAX];
-
- buf[0] = 0;
- if (params)
- {
- if (!strcmp(params, "click"))
- {
- Conf.focus.mode = MODE_FOCUS_CLICK;
- Mode.grabs.pointer_grab_active = 1;
- }
- else if (!strcmp(params, "pointer"))
- {
- Conf.focus.mode = MODE_FOCUS_POINTER;
- }
- else if (!strcmp(params, "sloppy"))
- {
- Conf.focus.mode = MODE_FOCUS_SLOPPY;
- }
- else if (!strcmp(params, "clicknograb"))
- {
- Conf.focus.mode = MODE_FOCUS_CLICK;
- Mode.grabs.pointer_grab_active = 0;
- }
- else if (!strcmp(params, "?"))
- {
- Esnprintf(buf, sizeof(buf), "Focus Mode: ");
- if (Conf.focus.mode == MODE_FOCUS_CLICK)
- {
- if (Mode.grabs.pointer_grab_active)
- {
- strcat(buf, "click");
- }
- else
- {
- strcat(buf, "clicknograb");
- }
- }
- else if (Conf.focus.mode == MODE_FOCUS_SLOPPY)
- {
- strcat(buf, "sloppy");
- }
- else if (Conf.focus.mode == MODE_FOCUS_POINTER)
- {
- strcat(buf, "pointer");
- }
- else
- {
- strcat(buf, "unknown");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown focus type");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: no focus type given");
- }
-
- if (buf[0])
- CommsSend(c, buf);
-}
-
-static void
IPC_ForceSave(const char *params __UNUSED__, Client * c __UNUSED__)
{
autosave();
@@ -1794,20 +1639,6 @@
"Force Enlightenment to save settings now",
NULL},
{
- IPC_FocusMode,
- "focus_mode", "sf",
- "Change the current focus mode setting",
- "Use \"focus_mode <mode>\" to change the focus mode.\n"
- "Use \"focus_mode ?\" to retrieve the current setting\n" "Focus Types:\n"
- "click: This is the traditional click-to-focus mode.\n"
- "clicknograb: This is a similar focus mode, but without the "
- "grabbing of the click\n "
- "(you cannot click anywhere in a window to focus it)\n"
- "pointer: The focus will follow the mouse pointer\n"
- "sloppy: in sloppy-focus, the focus follows the mouse, "
- "but when over\n "
- "the desktop background the last window does not lose the focus\n"},
- {
IPC_WinOps,
"win_op", "wop",
"Change a property of a specific window",
@@ -1890,12 +1721,6 @@
"use \"geominfo_mode <center/corner/never>\" "
"to set\nuse \"geominfo_mode ?\" to get the current mode\n"},
{
- IPC_SetFocus,
- "set_focus", "wf",
- "Set/Retrieve focused window",
- "use \"set_focus <win_id>\" to focus a new window\n"
- "use \"set_focus ?\" to retrieve the currently focused window\n"},
- {
IPC_DialogOK,
"dialog_ok", "dok",
"Pop up a dialog box with an OK button",
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.147.2.17
retrieving revision 1.147.2.18
diff -u -3 -r1.147.2.17 -r1.147.2.18
--- menus.c 17 Oct 2004 08:47:26 -0000 1.147.2.17
+++ menus.c 27 Oct 2004 23:32:54 -0000 1.147.2.18
@@ -250,12 +250,14 @@
ewin = FindEwinByMenu(m);
if (ewin)
{
+#if 0 /* FIXME - Why? */
if ((Mode.button) &&
FindItem((char *)Mode.button, 0, LIST_FINDBY_POINTER,
LIST_TYPE_BUTTON))
{
ButtonDrawWithState(Mode.button, STATE_NORMAL);
}
+#endif
#if 0 /* ??? */
RaiseEwin(ewin);
ShowEwin(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-misc.c,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -u -3 -r1.1.2.21 -r1.1.2.22
--- mod-misc.c 10 Oct 2004 11:17:39 -0000 1.1.2.21
+++ mod-misc.c 27 Oct 2004 23:32:55 -0000 1.1.2.22
@@ -38,6 +38,7 @@
extern EModule ModDesktops;
extern EModule ModEffects;
extern EModule ModEwins;
+extern EModule ModFocus;
extern EModule ModGroups;
extern EModule ModImageclass;
extern EModule ModIconboxes;
@@ -63,6 +64,7 @@
&ModDesktops,
&ModEwins,
&ModEffects,
+ &ModFocus,
&ModGroups,
&ModIconboxes,
&ModImageclass,
@@ -149,9 +151,6 @@
static const CfgItem cfg_items[] = {
CFG_ITEM_BOOL(Conf_misc, firsttime, 1),
- CFG_ITEM_BOOL(Conf, autoraise.enable, 0),
- CFG_ITEM_INT(Conf, autoraise.delay, 500),
-
CFG_ITEM_INT(Conf, backgrounds.hiquality, 1),
CFG_ITEM_INT(Conf, backgrounds.timeout, 240),
CFG_ITEM_BOOL(Conf, backgrounds.user, 1),
@@ -163,16 +162,6 @@
CFG_ITEM_INT(Conf, dock.startx, 0),
CFG_ITEM_INT(Conf, dock.starty, 0),
- CFG_ITEM_INT(Conf, focus.mode, MODE_FOCUS_SLOPPY),
- CFG_ITEM_BOOL(Conf, focus.clickraises, 0),
- CFG_ITEM_BOOL(Conf, focus.transientsfollowleader, 1),
- CFG_ITEM_BOOL(Conf, focus.switchfortransientmap, 1),
- CFG_ITEM_BOOL(Conf, focus.all_new_windows_get_focus, 0),
- CFG_ITEM_BOOL(Conf, focus.new_transients_get_focus, 0),
- CFG_ITEM_BOOL(Conf, focus.new_transients_get_focus_if_group_focused, 1),
- CFG_ITEM_BOOL(Conf, focus.raise_on_next, 1),
- CFG_ITEM_BOOL(Conf, focus.warp_on_next, 0),
-
CFG_ITEM_BOOL(Conf, groups.dflt.iconify, 1),
CFG_ITEM_BOOL(Conf, groups.dflt.kill, 0),
CFG_ITEM_BOOL(Conf, groups.dflt.mirror, 1),
@@ -243,8 +232,6 @@
{
if (!strncmp(prm, "autoraise", 2))
SettingsAutoRaise();
- else if (!strncmp(prm, "focus", 2))
- SettingsFocus();
else if (!strncmp(prm, "fx", 2))
SettingsSpecialFX();
else if (!strncmp(prm, "misc", 2))
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/warp.c,v
retrieving revision 1.49.2.8
retrieving revision 1.49.2.9
diff -u -3 -r1.49.2.8 -r1.49.2.9
--- warp.c 17 Oct 2004 08:47:26 -0000 1.49.2.8
+++ warp.c 27 Oct 2004 23:32:55 -0000 1.49.2.9
@@ -192,7 +192,7 @@
warpFocusTitleShowing = 0;
}
-static void
+void
WarpFocus(int delta)
{
EWin *const *lst0;
@@ -201,6 +201,10 @@
EDBUG(5, "WarpFocus");
+ /* Remember invoking keycode (ugly hack) */
+ if (!warpFocusTitleShowing)
+ warpFocusKey = Mode.last_keycode;
+
lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING);
if (!lst)
{
@@ -295,11 +299,12 @@
switch (ev->type)
{
+#if 0 /* Not necessary when sampling keycode in events.c */
case KeyPress:
if (warpFocusTitleShowing && ev->xany.window == VRoot.win)
warpFocusKey = ev->xkey.keycode;
break;
-
+#endif
case KeyRelease:
if (warpFocusTitleShowing && ev->xkey.keycode != warpFocusKey)
WarpFocusFinish();
@@ -307,26 +312,13 @@
}
}
-static int
-WarplistAction(EWin * ewin __UNUSED__, const char *params __UNUSED__)
-{
- if (!Conf.warplist.enable)
- return 0;
-
- WarpFocus(1);
-
- return 1;
-}
-
static void
WarplistInit(void)
{
-#if 1 /* FIXME - Fix */
-#define ACTION_FOCUS_NEXT 0
- if (Conf.warplist.enable == 5)
- WarplistAction(NULL, NULL);
-#endif
+#if 0 /* Not necessary when sampling keycode in events.c */
+ /* Ugly hack to get the invoking key press */
EventCallbackRegister(VRoot.win, 0, WarpFocusHandleEvent, NULL);
+#endif
}
/*
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs