Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h arrange.c borders.c conf.h config.c ewmh.c icccm.c screen.c settings.c size.c warp.c Log Message: Handle struts, optionally ignore. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.301 retrieving revision 1.302 diff -u -3 -r1.301 -r1.302 --- E.h 3 Jul 2004 00:30:48 -0000 1.301 +++ E.h 3 Jul 2004 00:58:18 -0000 1.302 @@ -984,6 +984,10 @@ int head; struct { + int left, right, top, bottom; + } strut; + struct + { unsigned vroot:1; /* Virtual root window */ } props; struct @@ -1230,6 +1234,7 @@ { char manual; char manual_mouse_pointer; + char ignore_struts; } place; struct { @@ -2543,8 +2548,12 @@ void ScreenInit(void); int ScreenGetGeometry(int x, int y, int *px, int *py, int *pw, int *ph); +int ScreenGetAvailableArea(int x, int y, int *px, int *py, + int *pw, int *ph); int GetPointerScreenGeometry(int *px, int *py, int *pw, int *ph); +int GetPointerScreenAvailableArea(int *px, int *py, + int *pw, int *ph); /* session.c */ void SessionInit(void); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/arrange.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -3 -r1.70 -r1.71 --- arrange.c 19 May 2004 21:41:03 -0000 1.70 +++ arrange.c 3 Jul 2004 00:58:19 -0000 1.71 @@ -93,7 +93,7 @@ { int xx1, yy1, xx2, yy2; - GetPointerScreenGeometry(&xx1, &yy1, &xx2, &yy2); + GetPointerScreenAvailableArea(&xx1, &yy1, &xx2, &yy2); xx2 += xx1; yy2 += yy1; if (startx < xx1) @@ -597,8 +597,8 @@ EDBUG_RETURN_; } - ScreenGetGeometry(ewin->shape_x, ewin->shape_y, &left_bound, &top_bound, &w, - &h); + ScreenGetAvailableArea(ewin->shape_x, ewin->shape_y, + &left_bound, &top_bound, &w, &h); right_bound = left_bound + w; bottom_bound = top_bound + h; screen_snap_dist = Mode.constrained ? (w + h) : Conf.snap.screen_snap_dist; @@ -941,7 +941,7 @@ { int x, y, w, h; - GetPointerScreenGeometry(&x, &y, &w, &h); + GetPointerScreenAvailableArea(&x, &y, &w, &h); *px = (w - ewin->w) / 2 + x; *py = (h - ewin->h) / 2 + y; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v retrieving revision 1.209 retrieving revision 1.210 diff -u -3 -r1.209 -r1.210 --- borders.c 3 Jul 2004 00:30:48 -0000 1.209 +++ borders.c 3 Jul 2004 00:58:19 -0000 1.210 @@ -3215,7 +3215,7 @@ ewin->lw = ewin->client.w; ewin->lh = ewin->client.h; ewin->ll = ewin->layer; - ScreenGetGeometry(ewin->x, ewin->y, &x, &y, &w, &h); + ScreenGetAvailableArea(ewin->x, ewin->y, &x, &y, &w, &h); #if 0 ewin->layer = 10; #endif =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/conf.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -3 -r1.33 -r1.34 --- conf.h 14 Jun 2004 17:02:29 -0000 1.33 +++ conf.h 3 Jul 2004 00:58:19 -0000 1.34 @@ -101,6 +101,8 @@ #define CONTROL_NEW_TRANSIENTS_GET_FOCUS 341 #define CONTROL_NEW_TRANSIENTS_GET_FOCUS_IF_GROUP 342 #define CONTROL_MANUAL_PLACEMENT 343 +#define CONTROL_MANUAL_PLACEMENT_MOUSE_POINTER 3360 +#define CONTROL_PLACE_IGNORE_STRUTS 3361 #define CONTROL_RAISE_ON_NEXT_FOCUS 344 #define CONTROL_WARP_ON_NEXT_FOCUS 345 #define CONTROL_EDGE_FLIP_RESISTANCE 346 @@ -112,7 +114,6 @@ #define CONTROL_AREA_WRAPAROUND 352 #define CONTROL_DIALOG_HEADERS 353 #define CONTROL_DESKTOP_WRAPAROUND 354 -#define CONTROL_MANUAL_PLACEMENT_MOUSE_POINTER 3360 #define CONTROL_WARPMENUS 666 #define CONTROL_USER_BG 1350 #define CONTROL_PAGER_ZOOM 1351 =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v retrieving revision 1.106 retrieving revision 1.107 diff -u -3 -r1.106 -r1.107 --- config.c 3 Jul 2004 00:30:49 -0000 1.106 +++ config.c 3 Jul 2004 00:58:19 -0000 1.107 @@ -755,6 +755,9 @@ case CONTROL_MANUAL_PLACEMENT_MOUSE_POINTER: Conf.place.manual_mouse_pointer = i2; break; + case CONTROL_PLACE_IGNORE_STRUTS: + Conf.place.ignore_struts = i2; + break; case CONTROL_RAISE_ON_NEXT_FOCUS: Conf.focus.raise_on_next_focus = i2; break; @@ -3896,6 +3899,7 @@ fprintf(autosavefile, "343 %i\n", (int)Conf.place.manual); fprintf(autosavefile, "3360 %i\n", (int)Conf.place.manual_mouse_pointer); + fprintf(autosavefile, "3361 %i\n", (int)Conf.place.ignore_struts); fprintf(autosavefile, "344 %i\n", (int)Conf.focus.raise_on_next_focus); fprintf(autosavefile, "345 %i\n", (int)Conf.focus.warp_on_next_focus); fprintf(autosavefile, "346 %i\n", (int)Conf.edge_flip_resistance); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- ewmh.c 1 Jul 2004 21:04:42 -0000 1.53 +++ ewmh.c 3 Jul 2004 00:58:19 -0000 1.54 @@ -68,6 +68,10 @@ /* Misc window ops */ Atom _NET_CLOSE_WINDOW; +#if 0 /* Not yet implemented */ +Atom _NET_MOVERESIZE_WINDOW; +#endif + /* * _NET_WM_MOVERESIZE * @@ -93,6 +97,11 @@ */ Atom _NET_WM_NAME; Atom _NET_WM_ICON_NAME; + +#if 0 /* Not yet implemented */ +Atom _NET_WM_VISIBLE_NAME; +Atom _NET_WM_VISIBLE_ICON_NAME; +#endif Atom _NET_WM_DESKTOP; /* _NET_WM_WINDOW_TYPE (window property) */ @@ -127,6 +136,22 @@ #define _NET_WM_STATE_ADD 1 #define _NET_WM_STATE_TOGGLE 2 +Atom _NET_WM_STRUT; + +#if 0 /* Not yet implemented */ +Atom _NET_WM_ALLOWED_ACTIONS; +Atom _NET_WM_ICON_GEOMETRY; +Atom _NET_WM_ICON; +Atom _NET_WM_PID; +Atom _NET_WM_HANDLED_ICONS; + +Atom _NET_WM_PING; +#endif + +#ifndef ENABLE_HINTS_GNOME +Atom _G_WIN_LAUER; +#endif + /* * Set/clear Atom in list */ @@ -219,6 +244,8 @@ _ATOM_INIT(_NET_WM_STATE_ABOVE); _ATOM_INIT(_NET_WM_STATE_BELOW); + _ATOM_INIT(_NET_WM_STRUT); + _ATOM_SET_ATOM(_NET_SUPPORTED, VRoot.win, atom_list, atom_count); /* Set WM info properties */ @@ -715,6 +742,30 @@ EDBUG_RETURN_; } +static void +EWMH_GetWindowStrut(EWin * ewin) +{ + CARD32 *val; + int size; + + EDBUG(6, "EWMH_GetWindowStrut"); + + val = AtomGet(ewin->client.win, _NET_WM_STRUT, XA_CARDINAL, &size); + if (val) + { + if (size > 4) + { + ewin->strut.left = val[0]; + ewin->strut.right = val[1]; + ewin->strut.top = val[2]; + ewin->strut.bottom = val[3]; + } + Efree(val); + } + + EDBUG_RETURN_; +} + void EWMH_GetWindowHints(EWin * ewin) { @@ -726,6 +777,7 @@ EWMH_GetWindowState(ewin); EWMH_GetWindowType(ewin); /* EWMH_GetWindowIcons(ewin); TBD */ + EWMH_GetWindowStrut(ewin); EDBUG_RETURN_; } @@ -959,6 +1011,8 @@ EWMH_GetWindowName(ewin); else if (atom_change == _NET_WM_ICON_NAME) EWMH_GetWindowIconName(ewin); + else if (atom_change == _NET_WM_STRUT) + EWMH_GetWindowStrut(ewin); EDBUG_RETURN_; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -3 -r1.72 -r1.73 --- icccm.c 2 Jul 2004 17:36:58 -0000 1.72 +++ icccm.c 3 Jul 2004 00:58:19 -0000 1.73 @@ -41,6 +41,7 @@ static Atom E_XA_WM_HINTS = 0; static Atom E_XA_WM_CLIENT_LEADER = 0; static Atom E_XA_WM_TRANSIENT_FOR = 0; +static Atom E_XA_WM_ICON_SIZE = 0; void ICCCM_Init(void) @@ -62,6 +63,7 @@ E_XA_WM_HINTS = XInternAtom(disp, "WM_HINTS", False); E_XA_WM_CLIENT_LEADER = XInternAtom(disp, "WM_CLIENT_LEADER", False); E_XA_WM_TRANSIENT_FOR = XInternAtom(disp, "WM_TRANSIENT_FOR", False); + E_XA_WM_ICON_SIZE = XInternAtom(disp, "WM_ICON_SIZE", False); if (Mode.wm.window) { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/screen.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- screen.c 30 Jun 2004 13:04:18 -0000 1.7 +++ screen.c 3 Jul 2004 00:58:19 -0000 1.8 @@ -90,6 +90,62 @@ return head; } +static void +VRootGetAvailableArea(int *px, int *py, int *pw, int *ph) +{ + EWin *const *lst, *ewin; + int i, num, l, r, t, b; + + l = r = t = b = 0; + lst = EwinListGetAll(&num); + for (i = 0; i < num; i++) + { + ewin = lst[i]; + + if (l < ewin->strut.left) + l = ewin->strut.left; + if (r < ewin->strut.right) + r = ewin->strut.right; + if (t < ewin->strut.top) + t = ewin->strut.top; + if (b < ewin->strut.bottom) + b = ewin->strut.bottom; + } + + *px = l; + *py = t; + *pw = VRoot.w - (l + r); + *ph = VRoot.h - (t + b); +} + +int +ScreenGetAvailableArea(int xi, int yi, int *px, int *py, int *pw, int *ph) +{ + int x1, y1, w1, h1, x2, y2, w2, h2, head; + + head = ScreenGetGeometry(xi, yi, &x1, &y1, &w1, &h1); + + if (!Conf.place.ignore_struts) + { + VRootGetAvailableArea(&x2, &y2, &w2, &h2); + if (x1 < x2) + x1 = x2; + if (y1 < y2) + y1 = y2; + if (w1 > w2) + w1 = w2; + if (h1 > h2) + h1 = h2; + } + + *px = x1; + *py = y1; + *pw = w1; + *ph = h1; + + return head; +} + int GetPointerScreenGeometry(int *px, int *py, int *pw, int *ph) { @@ -103,3 +159,17 @@ return ScreenGetGeometry(pointer_x, pointer_y, px, py, pw, ph); } + +int +GetPointerScreenAvailableArea(int *px, int *py, int *pw, int *ph) +{ + Window rt, ch; + int pointer_x, pointer_y; + int d; + unsigned int ud; + + XQueryPointer(disp, VRoot.win, &rt, &ch, &pointer_x, &pointer_y, &d, &d, + &ud); + + return ScreenGetAvailableArea(pointer_x, pointer_y, px, py, pw, ph); +} =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -3 -r1.115 -r1.116 --- settings.c 3 Jul 2004 00:30:50 -0000 1.115 +++ settings.c 3 Jul 2004 00:58:19 -0000 1.116 @@ -1450,6 +1450,7 @@ static char tmp_switch_popup; static char tmp_manual_placement; static char tmp_manual_placement_mouse_pointer; +static char tmp_place_ignore_struts; #ifdef HAS_XINERAMA static char tmp_extra_head; @@ -1464,6 +1465,7 @@ Conf.focus.switchfortransientmap = tmp_switch_popup; Conf.place.manual = tmp_manual_placement; Conf.place.manual_mouse_pointer = tmp_manual_placement_mouse_pointer; + Conf.place.ignore_struts = tmp_place_ignore_struts; #ifdef HAS_XINERAMA if (xinerama_active) Conf.extra_head = tmp_extra_head; @@ -1492,6 +1494,7 @@ tmp_switch_popup = Conf.focus.switchfortransientmap; tmp_manual_placement = Conf.place.manual; tmp_manual_placement_mouse_pointer = Conf.place.manual_mouse_pointer; + tmp_place_ignore_struts = Conf.place.ignore_struts; #ifdef HAS_XINERAMA tmp_extra_head = Conf.extra_head; #endif @@ -1557,6 +1560,14 @@ DialogItemCheckButtonSetState(di, tmp_manual_placement_mouse_pointer); DialogItemCheckButtonSetPtr(di, &tmp_manual_placement_mouse_pointer); + di = DialogAddItem(table, DITEM_CHECKBUTTON); + DialogItemSetPadding(di, 2, 2, 2, 2); + DialogItemSetFill(di, 1, 0); + DialogItemSetColSpan(di, 2); + DialogItemCheckButtonSetText(di, _("Ignore struts")); + DialogItemCheckButtonSetState(di, tmp_place_ignore_struts); + DialogItemCheckButtonSetPtr(di, &tmp_place_ignore_struts); + #ifdef HAS_XINERAMA if (xinerama_active) { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/size.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- size.c 31 May 2004 20:30:12 -0000 1.37 +++ size.c 3 Jul 2004 00:58:19 -0000 1.38 @@ -92,7 +92,7 @@ case MAX_ABSOLUTE: case MAX_AVAILABLE: case MAX_CONSERVATIVE: - ScreenGetGeometry(ewin->x, ewin->y, &x1, &y1, &x2, &y2); + ScreenGetAvailableArea(ewin->x, ewin->y, &x1, &y1, &x2, &y2); x2 += x1; y2 += y1; =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/warp.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- warp.c 8 Jun 2004 22:16:14 -0000 1.46 +++ warp.c 3 Jul 2004 00:58:19 -0000 1.47 @@ -228,7 +228,7 @@ } w += (ic->padding.left + ic->padding.right); h += (ic->padding.top + ic->padding.bottom); - GetPointerScreenGeometry(&x, &y, &ww, &hh); + GetPointerScreenAvailableArea(&x, &y, &ww, &hh); x += (ww - w) / 2; y += (hh - h * warplist_num) / 2; mw = w; ------------------------------------------------------- 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