mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 23:22:30 +01:00
Window Maker 0.20.3
This commit is contained in:
@@ -141,7 +141,7 @@ typedef struct WObjDescriptor {
|
||||
#define WIS_TWIST 1
|
||||
#define WIS_FLIP 2
|
||||
#define WIS_NONE 3
|
||||
|
||||
#define WIS_RANDOM 4 /* secret */
|
||||
|
||||
/* switchmenu actions */
|
||||
#define ACTION_ADD 0
|
||||
@@ -212,7 +212,7 @@ typedef struct WPreferences {
|
||||
|
||||
char use_saveunders; /* turn on SaveUnders for menus,
|
||||
* icons etc. */
|
||||
char no_window_under_dock;
|
||||
char no_window_over_dock;
|
||||
|
||||
char no_window_over_icons;
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ wMaximizeWindow(WWindow *wwin, int directions)
|
||||
|
||||
if (wwin->screen_ptr->dock
|
||||
&& (!wwin->screen_ptr->dock->lowered
|
||||
|| wPreferences.no_window_under_dock)) {
|
||||
|| wPreferences.no_window_over_dock)) {
|
||||
|
||||
new_width -= wPreferences.icon_size + DOCK_EXTRA_SPACE;
|
||||
if (!wwin->screen_ptr->dock->on_right_side)
|
||||
@@ -674,6 +674,10 @@ animateResize(WScreen *scr, int x, int y, int w, int h,
|
||||
if (style == WIS_NONE)
|
||||
return;
|
||||
|
||||
if (style == WIS_RANDOM) {
|
||||
style = rand()%3;
|
||||
}
|
||||
|
||||
k = (hiding ? 2 : 3);
|
||||
switch(style) {
|
||||
case WIS_TWIST:
|
||||
|
||||
@@ -233,12 +233,13 @@ wClientConfigure(WWindow *wwin, XConfigureRequestEvent *xcre)
|
||||
if (!wwin->flags.shaded) {
|
||||
/* If the window is shaded, wrong height will be set for the window */
|
||||
if (xcre->value_mask & CWX)
|
||||
nx = xcre->x;
|
||||
nx = xcre->x - FRAME_BORDER_WIDTH;
|
||||
else
|
||||
nx = wwin->frame_x;
|
||||
|
||||
if (xcre->value_mask & CWY)
|
||||
ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width);
|
||||
ny = xcre->y - ((ofs_y < 0) ? 0 : wwin->frame->top_width)
|
||||
- FRAME_BORDER_WIDTH;
|
||||
else
|
||||
ny = wwin->frame_y;
|
||||
|
||||
|
||||
@@ -222,6 +222,7 @@ static WOptionEnumeration seIconificationStyles[] = {
|
||||
{"Twist", WIS_TWIST, 0},
|
||||
{"Flip", WIS_FLIP, 0},
|
||||
{"None", WIS_NONE, 0},
|
||||
{"random", WIS_RANDOM, 0},
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
@@ -391,8 +392,8 @@ WDefaultEntry optionList[] = {
|
||||
{"AutoArrangeIcons", "NO", NULL,
|
||||
&wPreferences.auto_arrange_icons, getBool, NULL
|
||||
},
|
||||
{"NoWindowUnderDock", "NO", NULL,
|
||||
&wPreferences.no_window_under_dock, getBool, NULL
|
||||
{"NoWindowOverDock", "NO", NULL,
|
||||
&wPreferences.no_window_over_dock, getBool, NULL
|
||||
},
|
||||
{"NoWindowOverIcons", "NO", NULL,
|
||||
&wPreferences.no_window_over_icons, getBool, NULL
|
||||
|
||||
@@ -1235,13 +1235,12 @@ wSelectWindows(WScreen *scr, XEvent *ev)
|
||||
|
||||
|
||||
void
|
||||
InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret)
|
||||
InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
Window root = scr->root_win;
|
||||
int x, y, h = 0;
|
||||
int width = wwin->client.width;
|
||||
int height = wwin->client.height;
|
||||
XEvent event;
|
||||
KeyCode shiftl, shiftr;
|
||||
Window junkw;
|
||||
|
||||
@@ -50,7 +50,8 @@ extern WPreferences wPreferences;
|
||||
*/
|
||||
|
||||
extern void
|
||||
InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret);
|
||||
InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
|
||||
/*
|
||||
@@ -375,7 +376,7 @@ PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
||||
|
||||
switch (wPreferences.window_placement) {
|
||||
case WPM_MANUAL:
|
||||
InteractivePlaceWindow(wwin, x_ret, y_ret);
|
||||
InteractivePlaceWindow(wwin, x_ret, y_ret, width, height);
|
||||
break;
|
||||
|
||||
case WPM_SMART:
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
|
||||
|
||||
#ifdef R6SM
|
||||
|
||||
extern int wScreenCount;
|
||||
|
||||
/* requested for SaveYourselfPhase2 */
|
||||
static Bool sWaitingPhase2 = False;
|
||||
|
||||
@@ -532,7 +535,8 @@ wSessionRestoreLastWorkspace(WScreen *scr)
|
||||
#ifdef R6SM
|
||||
/*
|
||||
* With full session management support, the part of WMState
|
||||
* that store client window state will become obsolete,
|
||||
* that store client window state will become obsolete (maybe we can reuse
|
||||
* the old code too),
|
||||
* but we still need to store state info like the dock and workspaces.
|
||||
* It is better to keep dock/wspace info in WMState because the user
|
||||
* might want to keep the dock configuration while not wanting to
|
||||
@@ -559,11 +563,19 @@ wSessionRestoreLastWorkspace(WScreen *scr)
|
||||
/*
|
||||
* Windows are identified as:
|
||||
* WM_CLASS(instance.class).WM_WINDOW_ROLE
|
||||
*
|
||||
* Saved Info:
|
||||
*
|
||||
*
|
||||
* WM_CLASS.instance
|
||||
* WM_CLASSS.class
|
||||
* WM_WINDOW_ROLE
|
||||
* geometry
|
||||
* (state array (miniaturized, shaded, etc))
|
||||
* workspace
|
||||
* wich dock
|
||||
*/
|
||||
static void
|
||||
saveClientState(WWindow *wwin, proplist_t dict)
|
||||
static proplist_t
|
||||
makeClientState(WWindow *wwin)
|
||||
{
|
||||
proplist_t key;
|
||||
|
||||
@@ -585,7 +597,7 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
|
||||
Bool gsPrefix = False;
|
||||
char *discardCmd = NULL;
|
||||
time_t t;
|
||||
FILE *file;
|
||||
proplist_t state;
|
||||
|
||||
#ifdef DEBUG1
|
||||
puts("received SaveYourselfPhase2 SM message");
|
||||
@@ -629,17 +641,57 @@ smSaveYourselfPhase2Proc(SmcConn smc_conn, SmPointer client_data)
|
||||
free(prefix);
|
||||
|
||||
/* save the states of all windows we're managing */
|
||||
|
||||
file = fopen(statefile, "w");
|
||||
if (!file) {
|
||||
wsyserror(_("could not create state file %s"), statefile);
|
||||
goto fail;
|
||||
state = PLMakeArrayFromElements(NULL, NULL);
|
||||
|
||||
/*
|
||||
* Format:
|
||||
*
|
||||
* state_file ::= dictionary with version_info ; state
|
||||
* version_info ::= version = 1;
|
||||
* state ::= state = array of screen_info
|
||||
* screen_info ::= array of (screen number, window_info, window_info, ...)
|
||||
* window_info ::=
|
||||
*/
|
||||
for (i=0; i<wScreenCount; i++) {
|
||||
WScreen *scr;
|
||||
WWindow *wwin;
|
||||
char buf[32];
|
||||
proplist_t pscreen;
|
||||
|
||||
scr = wScreenWithNumber(i);
|
||||
|
||||
sprintf(buf, "%i", scr->screen);
|
||||
pscreen = PLMakeArrayFromElements(PLMakeString(buf), NULL);
|
||||
|
||||
wwin = scr->focused_window;
|
||||
while (wwin) {
|
||||
proplist_t pwindow;
|
||||
|
||||
pwindow = makeClientState(wwin);
|
||||
PLAppendArrayElement(pscreen, pwindow);
|
||||
|
||||
wwin = wwin->prev;
|
||||
}
|
||||
|
||||
PLAppendArrayElement(state, pscreen);
|
||||
}
|
||||
|
||||
{
|
||||
proplist_t statefile;
|
||||
|
||||
statefile = PLMakeDictionaryFromEntries(PLMakeString("Version"),
|
||||
PLMakeString("1"),
|
||||
|
||||
PLMakeString("Screens"),
|
||||
state,
|
||||
|
||||
NULL);
|
||||
|
||||
PLSetFilename(statefile, PLMakeString(statefile));
|
||||
PLSave(statefile, NO);
|
||||
|
||||
PLRelease(statefile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
fclose(file);
|
||||
|
||||
|
||||
/* set the remaining properties that we didn't set at
|
||||
* startup time */
|
||||
|
||||
29
src/window.c
29
src/window.c
@@ -800,18 +800,23 @@ wManageWindow(WScreen *scr, Window window)
|
||||
* or if the window wants to
|
||||
* start iconic.
|
||||
* If geometry was saved, restore it. */
|
||||
if (win_state && win_state->state->use_geometry) {
|
||||
x = win_state->state->x;
|
||||
y = win_state->state->y;
|
||||
} else if (wwin->transient_for==None && !scr->flags.startup &&
|
||||
workspace==scr->current_workspace && !iconic &&
|
||||
!(wwin->normal_hints->flags & (USPosition|PPosition))) {
|
||||
PlaceWindow(wwin, &x, &y, width, height);
|
||||
}
|
||||
|
||||
if (wwin->window_flags.dont_move_off)
|
||||
wScreenBringInside(scr, &x, &y, width, height);
|
||||
|
||||
{
|
||||
Bool dontBring = False;
|
||||
|
||||
if (win_state && win_state->state->use_geometry) {
|
||||
x = win_state->state->x;
|
||||
y = win_state->state->y;
|
||||
} else if (wwin->transient_for==None && !scr->flags.startup &&
|
||||
workspace==scr->current_workspace && !iconic &&
|
||||
!(wwin->normal_hints->flags & (USPosition|PPosition))) {
|
||||
PlaceWindow(wwin, &x, &y, width, height);
|
||||
if (wPreferences.window_placement == WPM_MANUAL)
|
||||
dontBring = True;
|
||||
}
|
||||
|
||||
if (wwin->window_flags.dont_move_off && dontBring)
|
||||
wScreenBringInside(scr, &x, &y, width, height);
|
||||
}
|
||||
/*
|
||||
*--------------------------------------------------
|
||||
*
|
||||
|
||||
@@ -1323,6 +1323,14 @@ createInspectorForWindow(WWindow *wwin)
|
||||
WMSetPopUpButtonItemEnabled(panel->pagePopUp, 4, False);
|
||||
panel->appFrm = NULL;
|
||||
}
|
||||
|
||||
/* if the window is a transient, don't let it have a miniaturize
|
||||
* button */
|
||||
if (wwin->transient_for!=None && wwin->transient_for!=scr->root_win)
|
||||
WMSetButtonEnabled(panel->attrChk[3], False);
|
||||
else
|
||||
WMSetButtonEnabled(panel->attrChk[3], True);
|
||||
|
||||
|
||||
WMRealizeWidget(panel->win);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user