2003-03-23 19:48:09 -08:00
|
|
|
/*
|
2006-01-06 23:20:58 -08:00
|
|
|
* Copyright (C) 2003-2006 Kim Woelders
|
2003-03-23 19:48:09 -08:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Feeble attempt to collect hint stuff in one place
|
|
|
|
*/
|
|
|
|
#include "E.h"
|
2005-12-22 10:43:15 -08:00
|
|
|
#include "borders.h" /* FIXME - Should not be here */
|
|
|
|
#include "desktops.h" /* FIXME - Should not be here */
|
2006-02-18 01:50:17 -08:00
|
|
|
#include "e16-ecore_hints.h"
|
2005-07-16 09:57:45 -07:00
|
|
|
#include "ewins.h"
|
2005-10-27 16:18:35 -07:00
|
|
|
#include "hints.h"
|
2005-07-16 09:57:45 -07:00
|
|
|
#include "xwin.h"
|
2003-03-23 19:48:09 -08:00
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
/* Misc atoms */
|
|
|
|
Atom E_XROOTPMAP_ID;
|
|
|
|
Atom E_XROOTCOLOR_PIXEL;
|
|
|
|
|
|
|
|
/* E16 atoms */
|
|
|
|
static Ecore_X_Atom ENL_INTERNAL_AREA_DATA;
|
|
|
|
static Ecore_X_Atom ENL_INTERNAL_DESK_DATA;
|
|
|
|
static Ecore_X_Atom ENL_WIN_DATA;
|
|
|
|
static Ecore_X_Atom ENL_WIN_BORDER;
|
2005-10-29 08:35:39 -07:00
|
|
|
|
2003-03-23 19:48:09 -08:00
|
|
|
/*
|
|
|
|
* Functions that set X11-properties from E-internals
|
|
|
|
*/
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsInit(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
2003-07-12 07:06:37 -07:00
|
|
|
Atom atom;
|
|
|
|
Window win;
|
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
E_XROOTPMAP_ID = XInternAtom(disp, "_XROOTPMAP_ID", False);
|
|
|
|
E_XROOTCOLOR_PIXEL = XInternAtom(disp, "_XROOTCOLOR_PIXEL", False);
|
|
|
|
|
|
|
|
ENL_INTERNAL_AREA_DATA = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
|
|
|
|
ENL_INTERNAL_DESK_DATA = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
|
|
|
|
ENL_WIN_DATA = XInternAtom(disp, "ENL_WIN_DATA", False);
|
|
|
|
ENL_WIN_BORDER = XInternAtom(disp, "ENL_WIN_BORDER", False);
|
|
|
|
|
2004-05-04 12:04:42 -07:00
|
|
|
win = ECreateWindow(VRoot.win, -200, -200, 5, 5, 0);
|
2004-05-31 13:14:50 -07:00
|
|
|
|
2003-06-14 05:03:09 -07:00
|
|
|
ICCCM_Init();
|
2005-10-27 16:18:35 -07:00
|
|
|
MWM_SetInfo();
|
2003-03-23 19:48:09 -08:00
|
|
|
#if ENABLE_GNOME
|
2003-07-12 07:06:37 -07:00
|
|
|
GNOME_SetHints(win);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-07-12 07:06:37 -07:00
|
|
|
EWMH_Init(win);
|
|
|
|
atom = XInternAtom(disp, "ENLIGHTENMENT_VERSION", False);
|
2005-03-06 03:17:04 -08:00
|
|
|
ecore_x_window_prop_string_set(VRoot.win, atom, e_wm_version);
|
2005-06-02 10:30:07 -07:00
|
|
|
|
|
|
|
if (Mode.wm.window)
|
|
|
|
{
|
|
|
|
HintsSetWindowName(VRoot.win, "Enlightenment");
|
|
|
|
HintsSetWindowClass(VRoot.win, "Virtual-Root", "Enlightenment");
|
|
|
|
}
|
2005-08-13 01:50:28 -07:00
|
|
|
|
2006-02-27 11:14:25 -08:00
|
|
|
Mode.root.ext_pmap = HintsGetRootPixmap(VRoot.win);
|
|
|
|
Mode.root.ext_pmap_valid = EDrawableCheck(Mode.root.ext_pmap, 0);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2005-03-18 13:43:43 -08:00
|
|
|
void
|
|
|
|
HintsSetRootHints(Window win __UNUSED__)
|
|
|
|
{
|
|
|
|
/* Nothing done here for now */
|
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsSetClientList(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetClientList();
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_SetClientList();
|
2004-04-30 13:05:22 -07:00
|
|
|
EWMH_SetClientStacking();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HintsSetClientStacking(void)
|
|
|
|
{
|
|
|
|
EWMH_SetClientStacking();
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsSetDesktopConfig(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetDeskCount();
|
|
|
|
GNOME_SetDeskNames();
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_SetDesktopCount();
|
2004-12-28 15:46:49 -08:00
|
|
|
EWMH_SetDesktopRoots();
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_SetDesktopNames();
|
2003-08-18 15:03:10 -07:00
|
|
|
EWMH_SetWorkArea();
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsSetViewportConfig(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetAreaCount();
|
2003-04-03 08:34:48 -08:00
|
|
|
#endif
|
|
|
|
EWMH_SetDesktopSize();
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsSetCurrentDesktop(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetCurrentDesk();
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_SetCurrentDesktop();
|
|
|
|
HintsSetDesktopViewport();
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsSetDesktopViewport(void)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetCurrentArea();
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_SetDesktopViewport();
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2004-05-22 12:31:13 -07:00
|
|
|
HintsSetActiveWindow(Window win)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
2004-05-22 12:31:13 -07:00
|
|
|
EWMH_SetActiveWindow(win);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2004-05-22 12:31:13 -07:00
|
|
|
void
|
|
|
|
HintsSetWindowName(Window win, const char *name)
|
|
|
|
{
|
2005-10-30 11:40:49 -08:00
|
|
|
ecore_x_icccm_title_set(win, name);
|
2004-05-22 12:31:13 -07:00
|
|
|
|
|
|
|
EWMH_SetWindowName(win, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
HintsSetWindowClass(Window win, const char *name, const char *clss)
|
|
|
|
{
|
|
|
|
XClassHint *xch;
|
|
|
|
|
|
|
|
xch = XAllocClassHint();
|
|
|
|
xch->res_name = (char *)name;
|
|
|
|
xch->res_class = (char *)clss;
|
|
|
|
XSetClassHint(disp, win, xch);
|
|
|
|
XFree(xch);
|
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsSetWindowDesktop(const EWin * ewin)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetEwinDesk(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2005-02-22 09:40:15 -08:00
|
|
|
EWMH_SetWindowDesktop(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsSetWindowArea(const EWin * ewin __UNUSED__)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetEwinArea(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsSetWindowState(const EWin * ewin)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_SetHint(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2005-02-22 09:40:15 -08:00
|
|
|
EWMH_SetWindowState(ewin);
|
2005-07-08 09:48:19 -07:00
|
|
|
EWMH_SetWindowActions(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2004-08-20 14:13:56 -07:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsSetWindowOpacity(const EWin * ewin)
|
2004-08-20 14:13:56 -07:00
|
|
|
{
|
2005-03-24 15:38:12 -08:00
|
|
|
EWMH_SetWindowOpacity(ewin);
|
2004-08-20 14:13:56 -07:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsSetWindowBorder(const EWin * ewin)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
2005-06-30 05:09:34 -07:00
|
|
|
EWMH_SetWindowBorder(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Functions that set E-internals from X11-properties
|
|
|
|
*/
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsGetWindowHints(EWin * ewin)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_GetHints(ewin, 0);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_GetWindowHints(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Functions that delete X11-properties
|
|
|
|
*/
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
2005-06-30 05:09:34 -07:00
|
|
|
HintsDelWindowHints(const EWin * ewin)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
|
|
|
#if ENABLE_GNOME
|
2003-03-27 21:16:21 -08:00
|
|
|
GNOME_DelHints(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-03-27 21:16:21 -08:00
|
|
|
EWMH_DelWindowHints(ewin);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Functions processing received X11 messages
|
|
|
|
*/
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsProcessPropertyChange(EWin * ewin, Atom atom_change)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
2004-07-04 01:47:28 -07:00
|
|
|
char *name;
|
|
|
|
|
|
|
|
name = XGetAtomName(disp, atom_change);
|
|
|
|
if (name == NULL)
|
2005-01-22 03:32:58 -08:00
|
|
|
return;
|
2004-07-04 01:47:28 -07:00
|
|
|
|
|
|
|
if (!memcmp(name, "WM_", 3))
|
|
|
|
ICCCM_ProcessPropertyChange(ewin, atom_change);
|
|
|
|
else if (!memcmp(name, "_NET_", 5))
|
|
|
|
EWMH_ProcessPropertyChange(ewin, atom_change);
|
|
|
|
#if 0 /* No! - ENABLE_GNOME */
|
|
|
|
else if (!memcmp(name, "_WIN_", 5))
|
|
|
|
GNOME_GetHints(ewin, atom_change);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2004-07-04 01:47:28 -07:00
|
|
|
XFree(name);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
|
|
|
|
2003-03-27 21:16:21 -08:00
|
|
|
void
|
|
|
|
HintsProcessClientMessage(XClientMessageEvent * event)
|
2003-03-23 19:48:09 -08:00
|
|
|
{
|
2003-06-21 01:14:31 -07:00
|
|
|
char *name;
|
2003-06-14 05:03:09 -07:00
|
|
|
|
2003-06-21 01:14:31 -07:00
|
|
|
name = XGetAtomName(disp, event->message_type);
|
|
|
|
if (name == NULL)
|
2005-01-22 03:32:58 -08:00
|
|
|
return;
|
2003-06-21 01:14:31 -07:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
if (!memcmp(name, "WM_", 3))
|
2003-06-14 05:03:09 -07:00
|
|
|
ICCCM_ProcessClientMessage(event);
|
|
|
|
else if (!memcmp(name, "_NET_", 5))
|
|
|
|
EWMH_ProcessClientMessage(event);
|
2003-03-23 19:48:09 -08:00
|
|
|
#if ENABLE_GNOME
|
2003-06-14 05:03:09 -07:00
|
|
|
else if (!memcmp(name, "_WIN_", 5))
|
|
|
|
GNOME_ProcessClientMessage(event);
|
2003-03-23 19:48:09 -08:00
|
|
|
#endif
|
2003-06-21 01:14:31 -07:00
|
|
|
XFree(name);
|
2003-03-23 19:48:09 -08:00
|
|
|
}
|
2003-11-21 16:15:41 -08:00
|
|
|
|
2005-08-13 01:50:28 -07:00
|
|
|
Pixmap
|
|
|
|
HintsGetRootPixmap(Window win)
|
|
|
|
{
|
|
|
|
Ecore_X_Pixmap pm;
|
|
|
|
int num;
|
|
|
|
|
|
|
|
pm = None;
|
2006-02-13 11:15:56 -08:00
|
|
|
num = ecore_x_window_prop_xid_get(win, E_XROOTPMAP_ID, XA_PIXMAP, &pm, 1);
|
2005-08-13 01:50:28 -07:00
|
|
|
|
|
|
|
return pm;
|
|
|
|
}
|
|
|
|
|
2003-11-21 16:15:41 -08:00
|
|
|
void
|
2005-04-23 01:28:04 -07:00
|
|
|
HintsSetRootInfo(Window win, Pixmap pmap, unsigned int color)
|
2003-11-21 16:15:41 -08:00
|
|
|
{
|
2005-03-06 03:17:04 -08:00
|
|
|
Ecore_X_Pixmap pm;
|
2003-11-21 16:15:41 -08:00
|
|
|
|
2005-03-06 03:17:04 -08:00
|
|
|
pm = pmap;
|
2006-02-13 11:15:56 -08:00
|
|
|
ecore_x_window_prop_xid_set(win, E_XROOTPMAP_ID, XA_PIXMAP, &pm, 1);
|
2003-11-21 16:15:41 -08:00
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
ecore_x_window_prop_card32_set(win, E_XROOTCOLOR_PIXEL, &color, 1);
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
typedef union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned version:8;
|
|
|
|
unsigned rsvd:22;
|
|
|
|
unsigned docked:1;
|
|
|
|
unsigned iconified:1;
|
|
|
|
} b;
|
|
|
|
int all:32;
|
|
|
|
} EWinInfoFlags;
|
|
|
|
|
|
|
|
#define ENL_DATA_ITEMS 8
|
|
|
|
#define ENL_DATA_VERSION 0
|
|
|
|
|
2005-01-22 03:32:58 -08:00
|
|
|
void
|
|
|
|
EHintsSetInfo(const EWin * ewin)
|
|
|
|
{
|
2005-11-02 15:03:03 -08:00
|
|
|
int c[ENL_DATA_ITEMS];
|
|
|
|
EWinInfoFlags f;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
|
|
|
if (EwinIsInternal(ewin))
|
|
|
|
return;
|
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
f.all = 0;
|
|
|
|
f.b.version = ENL_DATA_VERSION;
|
|
|
|
f.b.docked = ewin->state.docked;
|
|
|
|
f.b.iconified = ewin->state.iconified;
|
|
|
|
c[0] = f.all;
|
|
|
|
|
2005-11-18 23:39:30 -08:00
|
|
|
c[1] = EwinFlagsEncode(ewin);
|
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
c[2] = 0;
|
2005-03-04 16:30:46 -08:00
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
c[3] = ewin->lx;
|
|
|
|
c[4] = ewin->ly;
|
|
|
|
c[5] = ewin->lw;
|
|
|
|
c[6] = ewin->lh;
|
|
|
|
c[7] = ewin->ll;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
ecore_x_window_prop_card32_set(_EwinGetClientXwin(ewin), ENL_WIN_DATA,
|
|
|
|
(unsigned int *)c, ENL_DATA_ITEMS);
|
|
|
|
|
|
|
|
ecore_x_window_prop_string_set(_EwinGetClientXwin(ewin), ENL_WIN_BORDER,
|
2005-03-06 03:17:04 -08:00
|
|
|
ewin->normal_border->name);
|
2005-01-22 03:32:58 -08:00
|
|
|
|
|
|
|
if (EventDebug(EDBUG_TYPE_SNAPS))
|
|
|
|
Eprintf("Snap set einf %#lx: %4d+%4d %4dx%4d: %s\n",
|
2005-08-04 09:02:02 -07:00
|
|
|
_EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
|
2005-01-22 03:32:58 -08:00
|
|
|
ewin->client.w, ewin->client.h, EwinGetName(ewin));
|
|
|
|
}
|
|
|
|
|
2005-10-29 08:35:39 -07:00
|
|
|
void
|
2005-01-22 03:32:58 -08:00
|
|
|
EHintsGetInfo(EWin * ewin)
|
|
|
|
{
|
|
|
|
char *str;
|
2005-03-06 03:17:04 -08:00
|
|
|
int num;
|
2005-11-02 15:03:03 -08:00
|
|
|
int c[ENL_DATA_ITEMS + 1];
|
|
|
|
EWinInfoFlags f;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
|
|
|
if (EwinIsInternal(ewin))
|
2005-10-29 08:35:39 -07:00
|
|
|
return;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
num = ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), ENL_WIN_DATA,
|
|
|
|
(unsigned int *)c, ENL_DATA_ITEMS + 1);
|
|
|
|
if (num != ENL_DATA_ITEMS)
|
2006-02-13 11:15:56 -08:00
|
|
|
return;
|
2005-11-02 15:03:03 -08:00
|
|
|
|
|
|
|
ewin->state.identified = 1;
|
|
|
|
ewin->client.grav = StaticGravity;
|
2005-07-08 09:48:19 -07:00
|
|
|
ewin->state.placed = 1;
|
2005-03-04 16:30:46 -08:00
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
f.all = c[0];
|
|
|
|
if (f.b.version != ENL_DATA_VERSION)
|
|
|
|
return;
|
|
|
|
ewin->icccm.start_iconified = f.b.iconified;
|
|
|
|
ewin->state.docked = f.b.docked;
|
|
|
|
|
2005-11-18 23:39:30 -08:00
|
|
|
EwinFlagsDecode(ewin, c[1]);
|
|
|
|
|
2005-11-02 15:03:03 -08:00
|
|
|
ewin->lx = c[3];
|
|
|
|
ewin->ly = c[4];
|
|
|
|
ewin->lw = c[5];
|
|
|
|
ewin->lh = c[6];
|
|
|
|
ewin->ll = c[7];
|
|
|
|
|
2005-10-29 08:35:39 -07:00
|
|
|
str =
|
2005-11-02 15:03:03 -08:00
|
|
|
ecore_x_window_prop_string_get(_EwinGetClientXwin(ewin), ENL_WIN_BORDER);
|
2005-03-06 03:17:04 -08:00
|
|
|
if (str)
|
2005-06-12 06:09:11 -07:00
|
|
|
EwinSetBorderByName(ewin, str);
|
2005-03-06 03:17:04 -08:00
|
|
|
Efree(str);
|
|
|
|
|
2005-03-04 16:30:46 -08:00
|
|
|
if (EventDebug(EDBUG_TYPE_SNAPS))
|
|
|
|
Eprintf("Snap get einf %#lx: %4d+%4d %4dx%4d: %s\n",
|
2005-08-04 09:02:02 -07:00
|
|
|
_EwinGetClientXwin(ewin), ewin->client.x, ewin->client.y,
|
2005-03-04 16:30:46 -08:00
|
|
|
ewin->client.w, ewin->client.h, EwinGetName(ewin));
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-03-30 14:51:02 -08:00
|
|
|
EHintsSetDeskInfo(void)
|
2005-01-22 03:32:58 -08:00
|
|
|
{
|
|
|
|
int i, ax, ay, n_desks;
|
2005-03-06 03:17:04 -08:00
|
|
|
unsigned int *c;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
|
|
|
n_desks = DesksGetNumber();
|
2005-01-23 10:23:04 -08:00
|
|
|
if (n_desks <= 0)
|
|
|
|
return;
|
|
|
|
|
2005-03-06 03:17:04 -08:00
|
|
|
c = Emalloc(2 * n_desks * sizeof(unsigned int));
|
|
|
|
if (!c)
|
2005-01-22 03:32:58 -08:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < n_desks; i++)
|
|
|
|
{
|
2005-09-04 00:27:20 -07:00
|
|
|
DeskGetArea(DeskGet(i), &ax, &ay);
|
2005-03-06 03:17:04 -08:00
|
|
|
c[(i * 2)] = ax;
|
|
|
|
c[(i * 2) + 1] = ay;
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
ecore_x_window_prop_card32_set(VRoot.win, ENL_INTERNAL_AREA_DATA,
|
|
|
|
c, 2 * n_desks);
|
2005-01-22 03:32:58 -08:00
|
|
|
|
2005-09-04 01:10:11 -07:00
|
|
|
c[0] = DesksGetCurrentNum();
|
2006-02-13 11:15:56 -08:00
|
|
|
ecore_x_window_prop_card32_set(VRoot.win, ENL_INTERNAL_DESK_DATA, c, 1);
|
2005-01-22 03:32:58 -08:00
|
|
|
|
2005-03-06 03:17:04 -08:00
|
|
|
Efree(c);
|
2006-02-27 11:14:25 -08:00
|
|
|
|
|
|
|
if (Mode.root.ext_pmap_valid)
|
|
|
|
{
|
|
|
|
HintsSetRootInfo(VRoot.win, Mode.root.ext_pmap, 0);
|
|
|
|
ESetWindowBackgroundPixmap(VRoot.win, Mode.root.ext_pmap);
|
|
|
|
}
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-03-30 14:51:02 -08:00
|
|
|
EHintsGetDeskInfo(void)
|
2005-01-22 03:32:58 -08:00
|
|
|
{
|
2005-03-06 03:17:04 -08:00
|
|
|
unsigned int *c;
|
|
|
|
int num, i, n_desks;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
|
|
|
n_desks = DesksGetNumber();
|
2005-03-06 03:17:04 -08:00
|
|
|
c = Emalloc(2 * n_desks * sizeof(unsigned int));
|
|
|
|
if (!c)
|
|
|
|
return;
|
2005-01-22 03:32:58 -08:00
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
num = ecore_x_window_prop_card32_get(VRoot.win, ENL_INTERNAL_AREA_DATA,
|
|
|
|
c, 2 * n_desks);
|
2005-03-06 03:17:04 -08:00
|
|
|
if (num > 0)
|
2005-01-22 03:32:58 -08:00
|
|
|
{
|
|
|
|
for (i = 0; i < (num / 2); i++)
|
2005-09-04 00:27:20 -07:00
|
|
|
DeskSetArea(DeskGet(i), c[(i * 2)], c[(i * 2) + 1]);
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
2006-02-13 11:15:56 -08:00
|
|
|
num = ecore_x_window_prop_card32_get(VRoot.win, ENL_INTERNAL_DESK_DATA,
|
|
|
|
c, 1);
|
2005-03-06 03:17:04 -08:00
|
|
|
if (num > 0)
|
2005-01-22 03:32:58 -08:00
|
|
|
{
|
2005-09-04 00:27:20 -07:00
|
|
|
DesksSetCurrent(DeskGet(c[0]));
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
2005-02-07 15:44:59 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Used to test if we should run cmd_init */
|
|
|
|
Mode.wm.session_start = 1;
|
|
|
|
}
|
2005-03-06 03:17:04 -08:00
|
|
|
|
|
|
|
Efree(c);
|
2005-01-22 03:32:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
EHintsSetInfoOnAll(void)
|
|
|
|
{
|
|
|
|
int i, num;
|
|
|
|
EWin *const *lst;
|
|
|
|
|
|
|
|
if (EventDebug(EDBUG_TYPE_SESSION))
|
|
|
|
Eprintf("SetEInfoOnAll\n");
|
|
|
|
|
|
|
|
lst = EwinListGetAll(&num);
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
if (!EwinIsInternal(lst[i]))
|
|
|
|
EHintsSetInfo(lst[i]);
|
|
|
|
|
2005-03-30 14:51:02 -08:00
|
|
|
EHintsSetDeskInfo();
|
2003-11-21 16:15:41 -08:00
|
|
|
}
|