1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

KDE enhancements, menu appearance enhancement

This commit is contained in:
kojima
1999-03-18 04:26:47 +00:00
parent 42b8948743
commit 9a3d1fef45
9 changed files with 41 additions and 18 deletions

View File

@@ -18,6 +18,10 @@ Changes since version 0.51.2:
- added DisableMiniwindows option - added DisableMiniwindows option
- kde: miniaturize animation will match the taskbar icon (KWM_WIN_ICON_GEOMETRY) - kde: miniaturize animation will match the taskbar icon (KWM_WIN_ICON_GEOMETRY)
- miniwindows show the title of the window if there is none set for it - miniwindows show the title of the window if there is none set for it
- fixed crash on kpanel restart
- remember window shortcuts after restart
- change edge resistance to account for panels and stuffs
- narrower menus
Changes since version 0.51.1: Changes since version 0.51.1:
............................. .............................

2
NEWS
View File

@@ -64,7 +64,7 @@ Window Maker has become a GNU program (part of the GNU Project).
Title text drop shadow Title text drop shadow
---------------------- ----------------------
drop shadow option added for titlebar text. The is a compile time drop shadow option added for titlebar text. This is a compile time
option which needs to be defined in src/wconfig.h after you run option which needs to be defined in src/wconfig.h after you run
configure and before you run make. configure and before you run make.

View File

@@ -1284,7 +1284,7 @@ wKWMCheckRootHintChange(WScreen *scr, XPropertyEvent *event)
processed = False; processed = False;
for (i = 0; i < MAX_WORKSPACES; i++) { for (i = 0; i < MAX_WORKSPACES && i < scr->workspace_count; i++) {
if (event->atom == _XA_KWM_DESKTOP_NAME_[i]) { if (event->atom == _XA_KWM_DESKTOP_NAME_[i]) {
char *name; char *name;

View File

@@ -453,7 +453,7 @@ wMenuRealize(WMenu *menu)
twidth = wTextWidth(scr->menu_title_font->font, menu->frame->title, twidth = wTextWidth(scr->menu_title_font->font, menu->frame->title,
strlen(menu->frame->title)); strlen(menu->frame->title));
theight = menu->frame->top_width; theight = menu->frame->top_width;
twidth += theight + theight/2 + (wPreferences.new_style ? 8 : 0); twidth += theight + (wPreferences.new_style ? 16 : 8);
} else { } else {
twidth = 0; twidth = 0;
theight = 0; theight = 0;
@@ -467,7 +467,7 @@ wMenuRealize(WMenu *menu)
/* search widest text */ /* search widest text */
text = menu->entries[i]->text; text = menu->entries[i]->text;
width = wTextWidth(scr->menu_entry_font->font, text, strlen(text))+12; width = wTextWidth(scr->menu_entry_font->font, text, strlen(text))+10;
if (menu->entries[i]->flags.indicator) { if (menu->entries[i]->flags.indicator) {
width += MENU_INDICATOR_SPACE; width += MENU_INDICATOR_SPACE;
@@ -482,7 +482,7 @@ wMenuRealize(WMenu *menu)
rwidth = wTextWidth(scr->menu_entry_font->font, text, rwidth = wTextWidth(scr->menu_entry_font->font, text,
strlen(text)) + 5; strlen(text)) + 5;
else if (menu->entries[i]->cascade>=0) else if (menu->entries[i]->cascade>=0)
rwidth = eheight; rwidth = 16;
else else
rwidth = 4; rwidth = 4;
@@ -494,6 +494,7 @@ wMenuRealize(WMenu *menu)
if (mwidth < twidth) if (mwidth < twidth)
mwidth = twidth; mwidth = twidth;
wCoreConfigure(menu->menu, 0, theight, mwidth, menu->entry_no*eheight -1); wCoreConfigure(menu->menu, 0, theight, mwidth, menu->entry_no*eheight -1);
wFrameWindowResize(menu->frame, mwidth, menu->entry_no*eheight-1 wFrameWindowResize(menu->frame, mwidth, menu->entry_no*eheight-1

View File

@@ -961,7 +961,7 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
/* horizontal movement: check horizontal edge resistances */ /* horizontal movement: check horizontal edge resistances */
if (dx < 0) { if (dx < 0) {
/* window is the leftmost window: check against screen edge */ /* window is the leftmost window: check against screen edge */
edge = 0; edge = scr->totalUsableArea.x1;
/* check position of nearest window to the left */ /* check position of nearest window to the left */
if (data->rightIndex > 0) { if (data->rightIndex > 0) {
@@ -983,7 +983,7 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
} }
} else if (dx > 0) { } else if (dx > 0) {
/* window is the rightmost window: check against screen edge */ /* window is the rightmost window: check against screen edge */
edge = scr->scr_width; edge = scr->totalUsableArea.x2;
/* check position of nearest window to the right */ /* check position of nearest window to the right */
if (data->leftIndex > 0) { if (data->leftIndex > 0) {
@@ -1009,7 +1009,7 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
/* vertical movement: check vertical edge resistances */ /* vertical movement: check vertical edge resistances */
if (dy < 0) { if (dy < 0) {
/* window is the topmost window: check against screen edge */ /* window is the topmost window: check against screen edge */
edge = 0; edge = scr->totalUsableArea.y1;
/* check position of nearest window to the top */ /* check position of nearest window to the top */
if (data->bottomIndex > 0) { if (data->bottomIndex > 0) {
@@ -1031,7 +1031,7 @@ updateWindowPosition(WWindow *wwin, MoveData *data, Bool doResistance,
} }
} else if (dy > 0) { } else if (dy > 0) {
/* window is the bottommost window: check against screen edge */ /* window is the bottommost window: check against screen edge */
edge = scr->scr_height; edge = scr->totalUsableArea.y2;
/* check position of nearest window to the bottom */ /* check position of nearest window to the bottom */
if (data->topIndex > 0) { if (data->topIndex > 0) {

View File

@@ -61,6 +61,8 @@ play(Display *dpy, int pitch, int delay)
} }
#endif #endif
#ifdef DEMATERIALIZE_ICON #ifdef DEMATERIALIZE_ICON
void void
DoKaboom(WScreen *scr, Window win, int x, int y) DoKaboom(WScreen *scr, Window win, int x, int y)
@@ -94,8 +96,8 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
for (i=0; i<DEMATERIALIZE_STEPS; i++) { for (i=0; i<DEMATERIALIZE_STEPS; i++) {
XEvent foo; XEvent foo;
if (XCheckTypedWindowEvent(dpy, scr->root_win, ButtonPressMask, if (XCheckTypedEvent(dpy, ButtonPress, &foo)) {
&foo)) { XPutBackEvent(dpy, &foo);
XClearWindow(dpy, scr->root_win); XClearWindow(dpy, scr->root_win);
break; break;
} }
@@ -106,6 +108,7 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
XCopyArea(dpy, pixmap, scr->root_win, scr->copy_gc, 0, 0, w, h, x, y); XCopyArea(dpy, pixmap, scr->root_win, scr->copy_gc, 0, 0, w, h, x, y);
XFreePixmap(dpy, pixmap); XFreePixmap(dpy, pixmap);
XFlush(dpy); XFlush(dpy);
wusleep(1000);
} }
XClearArea(dpy, scr->root_win, x, y, w, h, False); XClearArea(dpy, scr->root_win, x, y, w, h, False);
XFlush(dpy); XFlush(dpy);
@@ -113,7 +116,6 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
RDestroyImage(icon); RDestroyImage(icon);
RDestroyImage(back); RDestroyImage(back);
} }
#else /* !DEMATERIALIZE_ICON */ #else /* !DEMATERIALIZE_ICON */
void void
DoKaboom(WScreen *scr, Window win, int x, int y) DoKaboom(WScreen *scr, Window win, int x, int y)

View File

@@ -761,6 +761,15 @@ wManageWindow(WScreen *scr, Window window)
wwin->flags.hidden = wstate->hidden; wwin->flags.hidden = wstate->hidden;
wwin->flags.miniaturized = wstate->miniaturized; wwin->flags.miniaturized = wstate->miniaturized;
workspace = wstate->workspace; workspace = wstate->workspace;
if (scr->flags.startup && wstate->window_shortcuts >= 0) {
int i;
for (i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {
if (wstate->window_shortcuts & (1<<i))
scr->shortcutWindow[i] = wwin;
}
}
free(wstate); free(wstate);
} }
} }
@@ -2051,17 +2060,22 @@ wWindowConfigureBorders(WWindow *wwin)
void void
wWindowSaveState(WWindow *wwin) wWindowSaveState(WWindow *wwin)
{ {
CARD32 data[9]; CARD32 data[10];
int i;
memset(data, 0, sizeof(CARD32)*9);
memset(data, 0, sizeof(CARD32)*10);
data[0] = wwin->frame->workspace; data[0] = wwin->frame->workspace;
data[1] = wwin->flags.miniaturized; data[1] = wwin->flags.miniaturized;
data[2] = wwin->flags.shaded; data[2] = wwin->flags.shaded;
data[3] = wwin->flags.hidden; data[3] = wwin->flags.hidden;
for (i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {
if (wwin->screen_ptr->shortcutWindow[i] == wwin)
data[9] |= 1<<i;
}
XChangeProperty(dpy, wwin->client_win, _XA_WINDOWMAKER_STATE, XChangeProperty(dpy, wwin->client_win, _XA_WINDOWMAKER_STATE,
_XA_WINDOWMAKER_STATE, 32, PropModeReplace, _XA_WINDOWMAKER_STATE, 32, PropModeReplace,
(unsigned char *)data, 9); (unsigned char *)data, 10);
} }
@@ -2074,7 +2088,7 @@ getSavedState(Window window, WSavedState **state)
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
CARD32 *data; CARD32 *data;
if (XGetWindowProperty(dpy, window, _XA_WINDOWMAKER_STATE, 0, 9, if (XGetWindowProperty(dpy, window, _XA_WINDOWMAKER_STATE, 0, 10,
True, _XA_WINDOWMAKER_STATE, True, _XA_WINDOWMAKER_STATE,
&type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret, &type_ret, &fmt_ret, &nitems_ret, &bytes_after_ret,
(unsigned char **)&data)!=Success || !data) (unsigned char **)&data)!=Success || !data)
@@ -2092,6 +2106,7 @@ getSavedState(Window window, WSavedState **state)
(*state)->y = data[6]; (*state)->y = data[6];
(*state)->w = data[7]; (*state)->w = data[7];
(*state)->h = data[8]; (*state)->h = data[8];
(*state)->window_shortcuts = data[9];
} }
XFree(data); XFree(data);

View File

@@ -303,6 +303,7 @@ typedef struct WSavedState {
int y; int y;
unsigned int w; unsigned int w;
unsigned int h; unsigned int h;
unsigned window_shortcuts; /* mask like 1<<shortcut_number */
} WSavedState; } WSavedState;

View File

@@ -460,7 +460,7 @@ makeThemePack(proplist_t style, char *themeName)
tmp = wmalloc(strlen(themeDir)+20); tmp = wmalloc(strlen(themeDir)+20);
sprintf(tmp, "/bin/mkdir %s", themeDir); sprintf(tmp, "/bin/mkdir %s", themeDir);
if (system(tmp)!=0) { if (system(tmp)!=0) {
printf("%s: could not create directory %s\n", ProgName, themeDir); printf("%s: could not create directory %s. Probably there's already a theme with that name in this directory.\n", ProgName, themeDir);
exit(1); exit(1);
} }
free(tmp); free(tmp);