Change window restart property to include only state not available elsewhere.

Fix various fullscreen/maximized state bugs wrt. restart and locking.


SVN revision: 18231
This commit is contained in:
Kim Woelders 2005-11-02 23:03:03 +00:00
parent c947f399ac
commit b5ed1b5fe7
5 changed files with 110 additions and 63 deletions

View File

@ -1282,23 +1282,17 @@ EwinSetFullscreen(EWin * ewin, int on)
if (on)
{
ewin->lx = EoGetX(ewin);
ewin->ly = EoGetY(ewin);
ewin->lw = ewin->client.w;
ewin->lh = ewin->client.h;
ewin->ll = EoGetLayer(ewin);
if (on > 1)
if (on == 1)
{
/* Fullscreen at startup */
x = EoGetX(ewin);
y = EoGetY(ewin);
w = ewin->client.w;
h = ewin->client.h;
}
else
{
ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
if (ewin->state.inhibit_fullscreeen)
return;
ewin->lx = EoGetX(ewin);
ewin->ly = EoGetY(ewin);
ewin->lw = ewin->client.w;
ewin->lh = ewin->client.h;
ewin->ll = EoGetLayer(ewin);
}
ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
/* Fixup if available space doesn't match ICCCM size constraints */
ICCCM_SizeMatch(ewin, w, h, &ww, &hh);

View File

@ -176,25 +176,37 @@ EwinManage(EWin * ewin)
Window frame;
XWindowAttributes win_attr;
if (ewin->client.w <= 0)
ewin->client.w = 100;
if (ewin->client.h <= 0)
ewin->client.h = 100;
if (ewin->client.argb && Conf.argb_client_mode > 0)
{
if (!XGetWindowAttributes(disp, _EwinGetClientXwin(ewin), &win_attr))
return;
frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
frame =
ECreateVisualWindow(VRoot.win, ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, 1, &win_attr);
ewin->win_container =
ECreateVisualWindow(frame, 0, 0, 1, 1, 0, &win_attr);
ECreateVisualWindow(frame, ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, 0, &win_attr);
if (Conf.argb_client_mode == 1)
ewin->props.no_border = 1;
}
else
{
frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
ewin->win_container = ECreateWindow(frame, 0, 0, 1, 1, 0);
frame =
ECreateWindow(VRoot.win, ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, 1);
ewin->win_container =
ECreateWindow(frame, ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, 0);
}
EoInit(ewin, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, 1, NULL);
EoInit(ewin, EOBJ_TYPE_EWIN, frame, ewin->client.x, ewin->client.y,
ewin->client.w, ewin->client.h, 1, NULL);
EoSetName(ewin, Estrdup(ewin->icccm.wm_name));
EobjListFocusAdd(&ewin->o, 1);
EobjListOrderAdd(&ewin->o);
@ -260,6 +272,8 @@ EwinSetGeometry(EWin * ewin)
ewin->client.y = y + t;
EoMoveResize(ewin, x, y, ewin->client.w + l + r, ewin->client.h + t + b);
ewin->client.grav = NorthWestGravity;
}
static void
@ -645,6 +659,7 @@ EwinStateUpdate(EWin * ewin)
ewin->state.inhibit_max_ver =
ewin->props.no_resize_v || ewin->state.fullscreen;
ewin->state.inhibit_fullscreeen =
ewin->state.maximized_horz || ewin->state.maximized_vert ||
ewin->state.inhibit_move || ewin->state.inhibit_resize;
ewin->state.inhibit_change_desk = 0;
ewin->state.inhibit_close = 0;

View File

@ -117,6 +117,7 @@ struct _ewin
unsigned autosave:1;
unsigned no_border:1; /* Never apply border */
unsigned never_iconify:1; /* Never iconify */
unsigned no_shadow:1; /* Never apply shadow */
} props;
struct
{

View File

@ -30,8 +30,8 @@
#include "hints.h"
#include "xwin.h"
static Atom E16_WIN_DATA;
static Atom E16_WIN_BORDER;
static Atom ENL_WIN_DATA;
static Atom ENL_WIN_BORDER;
/*
* Functions that set X11-properties from E-internals
@ -62,8 +62,8 @@ HintsInit(void)
Mode.hints.old_root_pmap = HintsGetRootPixmap(VRoot.win);
E16_WIN_DATA = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
E16_WIN_BORDER = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
ENL_WIN_DATA = XInternAtom(disp, "ENL_WIN_DATA", False);
ENL_WIN_BORDER = XInternAtom(disp, "ENL_WIN_BORDER", False);
}
void
@ -300,28 +300,50 @@ HintsSetRootInfo(Window win, Pixmap pmap, unsigned int color)
ecore_x_window_prop_card32_set(win, aa, &color, 1);
}
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
void
EHintsSetInfo(const EWin * ewin)
{
int c[9];
int c[ENL_DATA_ITEMS];
EWinInfoFlags f;
if (EwinIsInternal(ewin))
return;
c[0] = EoGetDeskNum(ewin);
c[1] = EoIsSticky(ewin);
c[2] = EoGetX(ewin);
c[3] = EoGetY(ewin);
c[4] = ewin->state.iconified;
c[5] = ewin->state.shaded;
c[6] = ewin->client.w;
c[7] = ewin->client.h;
c[8] = ewin->state.docked;
f.all = 0;
f.b.version = ENL_DATA_VERSION;
f.b.docked = ewin->state.docked;
f.b.iconified = ewin->state.iconified;
ecore_x_window_prop_card32_set(_EwinGetClientXwin(ewin), E16_WIN_DATA,
(unsigned int *)c, 9);
c[0] = f.all;
ecore_x_window_prop_string_set(_EwinGetClientXwin(ewin), E16_WIN_BORDER,
c[1] = 0;
c[2] = 0;
c[3] = ewin->lx;
c[4] = ewin->ly;
c[5] = ewin->lw;
c[6] = ewin->lh;
c[7] = ewin->ll;
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,
ewin->normal_border->name);
if (EventDebug(EDBUG_TYPE_SNAPS))
@ -335,40 +357,50 @@ EHintsGetInfo(EWin * ewin)
{
char *str;
int num;
int c[9];
int c[ENL_DATA_ITEMS + 1];
EWinInfoFlags f;
if (EwinIsInternal(ewin))
return;
num =
ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), E16_WIN_DATA,
(unsigned int *)c, 9);
if (num < 8)
return;
num = ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), ENL_WIN_DATA,
(unsigned int *)c, ENL_DATA_ITEMS + 1);
if (num != ENL_DATA_ITEMS)
{
#if 1 /* FIXME - Remove this after a while */
num =
ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin),
XInternAtom(disp, "ENL_INTERNAL_DATA",
False),
(unsigned int *)c, 1);
if (num > 0)
{
ewin->state.identified = 1;
ewin->client.grav = StaticGravity;
ewin->state.placed = 1;
}
#endif
return;
}
ewin->state.identified = 1;
EoSetDesk(ewin, DeskGet(c[0]));
EoSetSticky(ewin, c[1]);
ewin->client.x = c[2];
ewin->client.y = c[3];
ewin->state.iconified = c[4];
ewin->state.shaded = c[5];
ewin->client.w = c[6];
ewin->client.h = c[7];
if (num >= 9) /* Compatibility */
ewin->state.docked = c[8];
ewin->client.grav = NorthWestGravity;
if (ewin->state.iconified)
{
ewin->icccm.start_iconified = 1;
ewin->state.iconified = 0;
}
ewin->client.grav = StaticGravity;
ewin->state.placed = 1;
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;
ewin->lx = c[3];
ewin->ly = c[4];
ewin->lw = c[5];
ewin->lh = c[6];
ewin->ll = c[7];
str =
ecore_x_window_prop_string_get(_EwinGetClientXwin(ewin), E16_WIN_BORDER);
ecore_x_window_prop_string_get(_EwinGetClientXwin(ewin), ENL_WIN_BORDER);
if (str)
EwinSetBorderByName(ewin, str);
Efree(str);

View File

@ -55,6 +55,11 @@ MaxSizeHV(EWin * ewin, const char *resize_type, int direction)
goto done;
}
if (ewin->state.inhibit_max_hor && (direction & MAX_HOR))
return;
if (ewin->state.inhibit_max_ver && (direction & MAX_VER))
return;
type = MAX_ABSOLUTE; /* Select default */
if (!resize_type)
;