1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-03 23:05:46 +01:00

- made deiconification not automatically focus window in sloppy focus

- fixed crash with DisableMiniwindows and icon pixmap changes
- fixed crash when changing icon of window without WM_CLASS
- added IAmAnnoyingAndDontWantWorkspaceNameDisplay
- added hysteresys for offscreen menu scrollback
- fixed bug with IgnoreFocusClick
- fixed crash with windows with width == 1 (Alban Hertroys
					<dalroi@wit401310.student.utwente.nl>)
- added SHEXEC command
- fixed resizebarback for SHADOW_RESIZEBAR ( jim knoble jmknoble@pobox.com)
This commit is contained in:
kojima
1999-04-24 20:08:20 +00:00
parent 446c02aa5c
commit 7f01849758
41 changed files with 851 additions and 150 deletions

View File

@@ -369,6 +369,9 @@ typedef struct WPreferences {
char window_balloon;
char miniwin_balloon;
char appicon_balloon;
char no_workspace_name_display;
#ifdef WEENDOZE_CYCLE
char windoze_cycling; /* Windoze 95 style Alt+Tabbing */
char popup_switchmenu; /* Popup the switchmenu when Alt+Tabbing */

View File

@@ -1150,9 +1150,9 @@ wDeiconifyWindow(WWindow *wwin)
wwin->icon = NULL;
}
XUngrabServer(dpy);
if (wPreferences.focus_mode==WKF_CLICK
|| wPreferences.focus_mode==WKF_SLOPPY)
wSetFocusTo(wwin->screen_ptr, wwin);
if (wPreferences.focus_mode==WKF_CLICK)
wSetFocusTo(wwin->screen_ptr, wwin);
#ifdef ANIMATIONS
if (!wwin->screen_ptr->flags.startup) {

View File

@@ -492,7 +492,7 @@ wClientCheckProperty(WWindow *wwin, XPropertyEvent *event)
|| (wwin->wm_hints->flags & IconWindowHint)) {
WApplication *wapp;
if (wwin->flags.miniaturized) {
if (wwin->flags.miniaturized && wwin->icon) {
wIconUpdate(wwin->icon);
}
wapp = wApplicationOf(wwin->main_window);

View File

@@ -387,6 +387,9 @@ WDefaultEntry optionList[] = {
{"CycleWorkspaces", "NO", NULL,
&wPreferences.ws_cycle, getBool, NULL
},
{"IAmAnnoyingAndDontWantWorkspaceNameDisplay", "NO",NULL,
&wPreferences.no_workspace_name_display, getBool, NULL
},
{"StickyIcons", "NO", NULL,
&wPreferences.sticky_icons, getBool, setStickyIcons
},
@@ -522,7 +525,7 @@ WDefaultEntry optionList[] = {
{"DisplayFont", DEF_INFO_TEXT_FONT, NULL,
NULL, getFont, setDisplayFont
},
{"LargeDisplayFont" DEF_WORKSPACE_NAME_FONT, NULL,
{"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL,
NULL, getFont, setLargeDisplayFont
},
{"HighlightColor", "white", NULL,

View File

@@ -496,7 +496,7 @@ wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class)
if (tmp && (instance || class))
sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);
else
tmp = _("Icon Chooser");
strcpy(tmp, _("Icon Chooser"));
wwin = wManageInternalWindow(scr, parent, None, tmp,
(scr->scr_width - 450)/2,

View File

@@ -579,11 +579,21 @@ renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height,
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark);
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light);
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2,
height-1, &dark);
if (width > 1)
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2,
width-cwidth-2, height-1, &dark);
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
height-1, &light);
#ifdef SHADOW_RESIZEBAR
ROperateLine(img, RAddOperation, 0, 1, 0, height-1, &light);
ROperateLine(img, RSubtractOperation, width-1, 1, width-1, height-1,
&dark);
ROperateLine(img, RSubtractOperation, 0, height-1, width-1, height-1,
&dark);
#endif /* SHADOW_RESIZEBAR */
if (!RConvertImage(scr->rcontext, img, pmap)) {
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
}

View File

@@ -1796,9 +1796,9 @@ wMenuScroll(WMenu *menu, XEvent *event)
WMNextEvent(dpy, &ev);
switch (ev.type) {
case EnterNotify:
case EnterNotify:
WMHandleEvent(&ev);
case MotionNotify:
case MotionNotify:
x = (ev.type==MotionNotify) ? ev.xmotion.x_root : ev.xcrossing.x_root;
y = (ev.type==MotionNotify) ? ev.xmotion.y_root : ev.xcrossing.y_root;
@@ -1938,8 +1938,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
smenu = parentMenu(menu);
old_frame_x = smenu->frame_x;
old_frame_y = smenu->frame_y;
}
else if (event->xbutton.window == menu->frame->core->window) {
} else if (event->xbutton.window == menu->frame->core->window) {
/* This is true if the menu was launched with right click on root window */
delayed_select = 1;
d_data.delayed_select = &delayed_select;
@@ -2195,8 +2194,7 @@ menuMouseDown(WObjDescriptor *desc, XEvent *event)
}
}
if (((WMenu*)desc->parent)->flags.brother || close_on_exit
|| !smenu)
if (((WMenu*)desc->parent)->flags.brother || close_on_exit || !smenu)
closeCascade(desc->parent);
/* close the cascade windows that should not remain opened */

View File

@@ -1436,7 +1436,7 @@ ExecuteShellCommand(WScreen *scr, char *command)
#ifdef HAVE_SETPGID
setpgid(0, 0);
#endif
execl(shell, shell, "-c", wstrappend("exec ", command), NULL);
execl(shell, shell, "-c", command, NULL);
wsyserror("could not execute %s -c %s", shell, command);
Exit(-1);
} else if (pid < 0) {

View File

@@ -114,6 +114,7 @@ static Shortcut *shortcutList = NULL;
* REFRESH - forces the desktop to be repainted
* EXIT [QUICK] - exit the window manager [without confirmation]
* EXEC <program> - execute an external program
* SHEXEC <command> - execute a shell command
* WORKSPACE_MENU - places the workspace submenu
* ARRANGE_ICONS
* RESTART [<window manager>] - restarts the window manager
@@ -807,7 +808,18 @@ addMenuEntry(WMenu *menu, char *title, char *shortcut, char *command,
wwarning(_("%s:missing parameter for menu command \"%s\""),
file_name, command);
else {
entry = wMenuAddCallback(menu, title, execCommand, wstrdup(params));
entry = wMenuAddCallback(menu, title, execCommand,
wstrappend("exec ", params));
entry->free_cdata = free;
shortcutOk = True;
}
} else if (strcmp(command, "SHEXEC")==0) {
if (!params)
wwarning(_("%s:missing parameter for menu command \"%s\""),
file_name, command);
else {
entry = wMenuAddCallback(menu, title, execCommand,
wstrdup(params));
entry->free_cdata = free;
shortcutOk = True;
}

View File

@@ -776,7 +776,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
&state->width, &state->height,
&state->user_changed_width, &state->user_changed_height);
/* state */
value = PLGetArrayElement(slist, index++);
str = PLGetString(value);
@@ -784,18 +784,18 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
sscanf(str, "%i %i %i", &state->miniaturized, &state->shaded,
&state->maximized);
/* attributes */
value = PLGetArrayElement(slist, index++);
str = PLGetString(value);
getAttributeState(str, &state->mflags, &state->flags);
/* workspace */
value = PLGetArrayElement(slist, index++);
str = PLGetString(value);
sscanf(str, "%i", &state->workspace);
@@ -808,7 +808,7 @@ wSessionGetStateFor(WWindow *wwin, WSessionData *state)
/* shortcuts */
value = PLGetArrayElement(slist, index++);
str = PLGetString(value);
sscanf(str, "%i", &state->shortcuts);
}

View File

@@ -1,6 +1,6 @@
/* session.h
*
* Copyright (c) 1998 Dan Pascu
* Copyright (c) 1999 Alfredo K. Kojima
*
* Window Maker window manager
*
@@ -68,4 +68,6 @@ Bool wSessionIsManaged(void);
#endif
Bool wSessionGetStateFor(WWindow *wwin, WSessionData *state);
#endif

View File

@@ -362,7 +362,10 @@
/* delay for menu item selection hysteresis */
#define MENU_SELECT_DELAY 200
/* animation speed constants */
/* delay for jumpback of scrolled menus */
#define MENU_JUMP_BACK_DELAY 200
/* *** animation speed constants *** */
/* icon slide */
#define ICON_SLIDE_SLOWDOWN_UF 20
@@ -400,7 +403,7 @@
#define MENU_SCROLL_STEPS_U 1
#define MENU_SCROLL_DELAY_U 8
#define MENU_JUMP_BACK_DELAY 0
0
/* shade animation */
#define SHADE_STEPS_UF 5
@@ -418,6 +421,12 @@
#define SHADE_STEPS_U 20
#define SHADE_DELAY_U 10
/* workspace name on switch display */
#define WORKSPACE_NAME_FADE_DELAY 30
#define WORKSPACE_NAME_DELAY 500
/* window birth animation steps (DO NOT MAKE IT RUN-TIME) */
#define WINDOW_BIRTH_STEPS 20

View File

@@ -1552,10 +1552,10 @@ wWindowFocus(WWindow *wwin, WWindow *owin)
wFrameWindowChangeState(wwin->frame, WS_FOCUSED);
wWindowResetMouseGrabs(wwin);
wwin->flags.focused = 1;
wWindowResetMouseGrabs(wwin);
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
if (owin == wwin || !owin)
@@ -1621,6 +1621,7 @@ wWindowUnfocus(WWindow *wwin)
}
}
wwin->flags.focused = 0;
wWindowResetMouseGrabs(wwin);
UpdateSwitchMenu(wwin->screen_ptr, wwin, ACTION_CHANGE_STATE);
@@ -2334,7 +2335,7 @@ wWindowResetMouseGrabs(WWindow *wwin)
GrabModeAsync, None, None);
}
if (!wwin->flags.focused) {
if (!wwin->flags.focused && !WFLAGP(wwin, no_focusable)) {
/* the passive grabs to focus the window */
if (wPreferences.focus_mode == WKF_CLICK)
XGrabButton(dpy, AnyButton, AnyModifier, wwin->client_win,

View File

@@ -141,7 +141,6 @@ typedef struct {
unsigned int olwm_transient:1;
unsigned int olwm_warp_to_pin:1;
#endif
} WWindowAttributes;

View File

@@ -252,8 +252,9 @@ hideWorkpaceName(void *data)
RImage *img = RCloneImage(scr->workspace_name_data->back);
Pixmap pix;
scr->workspace_name_timer = WMAddTimerHandler(30, hideWorkpaceName,
scr);
scr->workspace_name_timer =
WMAddTimerHandler(WORKSPACE_NAME_FADE_DELAY, hideWorkpaceName,
scr);
RCombineImagesWithOpaqueness(img, scr->workspace_name_data->text,
scr->workspace_name_data->count*255/10);
@@ -289,6 +290,8 @@ showWorkspaceName(WScreen *scr, int workspace)
XUnmapWindow(dpy, scr->workspace_name);
XFlush(dpy);
}
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY,
hideWorkpaceName, scr);
if (scr->workspace_name_data) {
RDestroyImage(scr->workspace_name_data->back);
@@ -307,8 +310,10 @@ showWorkspaceName(WScreen *scr, int workspace)
h = scr->workspace_name_font->height;
XResizeWindow(dpy, scr->workspace_name, w+4, h+4);
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2,
XMoveWindow(dpy, scr->workspace_name, (scr->scr_width - (w+4))/2, 0);
/*
(scr->scr_height - (h+4))/2);
*/
text = XCreatePixmap(dpy, scr->w_win, w+4, h+4, scr->w_depth);
mask = XCreatePixmap(dpy, scr->w_win, w+4, h+4, 1);
@@ -374,11 +379,12 @@ showWorkspaceName(WScreen *scr, int workspace)
scr->workspace_name_data = data;
scr->workspace_name_timer = WMAddTimerHandler(300, hideWorkpaceName, scr);
return;
erro:
if (scr->workspace_name_timer)
WMDeleteTimerHandler(scr->workspace_name_timer);
if (data->text)
RDestroyImage(data->text);
if (data->back)
@@ -387,7 +393,9 @@ erro:
scr->workspace_name_data = NULL;
scr->workspace_name_timer = WMAddTimerHandler(600, hideWorkpaceName, scr);
scr->workspace_name_timer = WMAddTimerHandler(WORKSPACE_NAME_DELAY +
10*WORKSPACE_NAME_FADE_DELAY,
hideWorkpaceName, scr);
}
@@ -401,7 +409,8 @@ wWorkspaceChange(WScreen *scr, int workspace)
if (workspace != scr->current_workspace) {
wWorkspaceForceChange(scr, workspace);
} else {
showWorkspaceName(scr, workspace);
if (!wPreferences.no_workspace_name_display)
showWorkspaceName(scr, workspace);
}
}
@@ -568,7 +577,8 @@ wWorkspaceForceChange(WScreen *scr, int workspace)
}
}
showWorkspaceName(scr, workspace);
if (!wPreferences.no_workspace_name_display)
showWorkspaceName(scr, workspace);
#ifdef GNOME_STUFF
wGNOMEUpdateCurrentWorkspaceHint(scr);