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

changed geometry display stuff

fixed colormap windows crash bug
This commit is contained in:
kojima
2000-01-14 16:30:56 +00:00
parent f10d928e0a
commit f2de1c9dcf
20 changed files with 298 additions and 309 deletions

View File

@@ -36,6 +36,8 @@ wmaker_SOURCES = \
extend_pixmaps.h \ extend_pixmaps.h \
framewin.c \ framewin.c \
framewin.h \ framewin.h \
geomview.c \
geomview.h \
gnome.c \ gnome.c \
gnome.h \ gnome.h \
funcs.h \ funcs.h \

View File

@@ -102,7 +102,7 @@ bin_PROGRAMS = wmaker
EXTRA_DIST = wmnotify.c wmnotdef.h wmnotify.h DI.h DL.h I.h L.h Q.h GDB.h nana.h EXTRA_DIST = wmnotify.c wmnotdef.h wmnotify.h DI.h DL.h I.h L.h Q.h GDB.h nana.h
wmaker_SOURCES = GNUstep.h WindowMaker.h actions.c actions.h appicon.c appicon.h application.c application.h appmenu.c appmenu.h balloon.c balloon.h client.c client.h colormap.c def_pixmaps.h defaults.c defaults.h dialog.c dialog.h dock.c dockedapp.c dock.h event.c extend_pixmaps.h framewin.c framewin.h gnome.c gnome.h funcs.h icon.c icon.h keybind.h kwm.h kwm.c main.c menu.c menu.h misc.c motif.c motif.h moveres.c openlook.c openlook.h pixmap.c pixmap.h placement.c plugin.c plugin.h properties.c properties.h proplist.c resources.c resources.h rootmenu.c screen.c screen.h session.h session.c shutdown.c stacking.c stacking.h startup.c superfluous.c superfluous.h switchmenu.c texture.c texture.h usermenu.c usermenu.h xdnd.h xdnd.c xmodifier.h xmodifier.c xutil.c xutil.h wconfig.h wcore.c wcore.h wdefaults.c wdefaults.h window.c window.h winmenu.c winspector.h winspector.c workspace.c workspace.h wmsound.c wmsound.h text.c text.h wmaker_SOURCES = GNUstep.h WindowMaker.h actions.c actions.h appicon.c appicon.h application.c application.h appmenu.c appmenu.h balloon.c balloon.h client.c client.h colormap.c def_pixmaps.h defaults.c defaults.h dialog.c dialog.h dock.c dockedapp.c dock.h event.c extend_pixmaps.h framewin.c framewin.h geomview.c geomview.h gnome.c gnome.h funcs.h icon.c icon.h keybind.h kwm.h kwm.c main.c menu.c menu.h misc.c motif.c motif.h moveres.c openlook.c openlook.h pixmap.c pixmap.h placement.c plugin.c plugin.h properties.c properties.h proplist.c resources.c resources.h rootmenu.c screen.c screen.h session.h session.c shutdown.c stacking.c stacking.h startup.c superfluous.c superfluous.h switchmenu.c texture.c texture.h usermenu.c usermenu.h xdnd.h xdnd.c xmodifier.h xmodifier.c xutil.c xutil.h wconfig.h wcore.c wcore.h wdefaults.c wdefaults.h window.c window.h winmenu.c winspector.h winspector.c workspace.c workspace.h wmsound.c wmsound.h text.c text.h
CPPFLAGS = @CPPFLAGS@ @DFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\" CPPFLAGS = @CPPFLAGS@ @DFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\"
@@ -126,12 +126,12 @@ X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@
wmaker_OBJECTS = actions.o appicon.o application.o appmenu.o balloon.o \ wmaker_OBJECTS = actions.o appicon.o application.o appmenu.o balloon.o \
client.o colormap.o defaults.o dialog.o dock.o dockedapp.o event.o \ client.o colormap.o defaults.o dialog.o dock.o dockedapp.o event.o \
framewin.o gnome.o icon.o kwm.o main.o menu.o misc.o motif.o moveres.o \ framewin.o geomview.o gnome.o icon.o kwm.o main.o menu.o misc.o motif.o \
openlook.o pixmap.o placement.o plugin.o properties.o proplist.o \ moveres.o openlook.o pixmap.o placement.o plugin.o properties.o \
resources.o rootmenu.o screen.o session.o shutdown.o stacking.o \ proplist.o resources.o rootmenu.o screen.o session.o shutdown.o \
startup.o superfluous.o switchmenu.o texture.o usermenu.o xdnd.o \ stacking.o startup.o superfluous.o switchmenu.o texture.o usermenu.o \
xmodifier.o xutil.o wcore.o wdefaults.o window.o winmenu.o winspector.o \ xdnd.o xmodifier.o xutil.o wcore.o wdefaults.o window.o winmenu.o \
workspace.o wmsound.o text.o winspector.o workspace.o wmsound.o text.o
wmaker_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a \ wmaker_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a \
$(top_builddir)/wrlib/libwraster.la $(top_builddir)/wrlib/libwraster.la
wmaker_LDFLAGS = wmaker_LDFLAGS =
@@ -146,7 +146,7 @@ wconfig.h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = gtar
GZIP_ENV = --best GZIP_ENV = --best
SOURCES = $(wmaker_SOURCES) SOURCES = $(wmaker_SOURCES)
OBJECTS = $(wmaker_OBJECTS) OBJECTS = $(wmaker_OBJECTS)
@@ -155,7 +155,7 @@ all: all-redirect
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .lo .o .s .SUFFIXES: .S .c .lo .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \ cd $(top_builddir) \
@@ -296,7 +296,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \ cp -pr $$/$$file $(distdir)/$$file; \
else \ else \
test -f $(distdir)/$$file \ test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \

View File

@@ -1769,13 +1769,24 @@ wSelectWindow(WWindow *wwin, Bool flag)
if (flag) { if (flag) {
wwin->flags.selected = 1; wwin->flags.selected = 1;
XSetWindowBorder(dpy, wwin->frame->core->window, scr->white_pixel); XSetWindowBorder(dpy, wwin->frame->core->window, scr->white_pixel);
if (WFLAGP(wwin, no_border)) {
XSetWindowBorderWidth(dpy, wwin->frame->core->window,
FRAME_BORDER_WIDTH);
}
if (!scr->selected_windows) if (!scr->selected_windows)
scr->selected_windows = WMCreateBag(4); scr->selected_windows = WMCreateBag(4);
WMPutInBag(scr->selected_windows, wwin); WMPutInBag(scr->selected_windows, wwin);
} else { } else {
wwin->flags.selected = 0; wwin->flags.selected = 0;
XSetWindowBorder(dpy, wwin->frame->core->window, XSetWindowBorder(dpy, wwin->frame->core->window,
scr->frame_border_pixel); scr->frame_border_pixel);
if (WFLAGP(wwin, no_border)) {
XSetWindowBorderWidth(dpy, wwin->frame->core->window, 0);
}
if (scr->selected_windows) { if (scr->selected_windows) {
WMRemoveFromBag(scr->selected_windows, wwin); WMRemoveFromBag(scr->selected_windows, wwin);
} }

View File

@@ -739,7 +739,7 @@ GetColormapWindows(WWindow *wwin)
if (wwin->cmap_windows) { if (wwin->cmap_windows) {
XFree(wwin->cmap_windows); XFree(wwin->cmap_windows);
} }
wwin->cmap_windows = NULL; wwin->cmap_windows = NULL;
wwin->cmap_window_no = 0; wwin->cmap_window_no = 0;
@@ -749,5 +749,6 @@ GetColormapWindows(WWindow *wwin)
wwin->cmap_window_no = 0; wwin->cmap_window_no = 0;
wwin->cmap_windows = NULL; wwin->cmap_windows = NULL;
} }
#endif #endif
} }

View File

@@ -32,7 +32,7 @@
#include "window.h" #include "window.h"
#include "framewin.h"
void void
wColormapInstallForWindow(WScreen *scr, WWindow *wwin) wColormapInstallForWindow(WScreen *scr, WWindow *wwin)
{ {
@@ -41,6 +41,7 @@ wColormapInstallForWindow(WScreen *scr, WWindow *wwin)
int done = 0; int done = 0;
Window xwin = None; Window xwin = None;
if (wwin) { if (wwin) {
xwin = wwin->client_win; xwin = wwin->client_win;
} else { } else {
@@ -81,7 +82,9 @@ wColormapInstallForWindow(WScreen *scr, WWindow *wwin)
} }
if (!done) { if (!done) {
XGetWindowAttributes(dpy, xwin, &attributes); attributes.colormap = None;
if (xwin != None)
XGetWindowAttributes(dpy, xwin, &attributes);
if (attributes.colormap == None) if (attributes.colormap == None)
attributes.colormap = scr->colormap; attributes.colormap = scr->colormap;

View File

@@ -130,6 +130,12 @@
/* define if you have then inet_aton function */ /* define if you have then inet_aton function */
#undef HAVE_INET_ATON #undef HAVE_INET_ATON
/* define if processor is x86 */
#undef ASM_X86
/* define if processor is x86 with MMX(tm) support */
#undef ASM_X86_MMX
/* Define if you have the atexit function. */ /* Define if you have the atexit function. */
#undef HAVE_ATEXIT #undef HAVE_ATEXIT

View File

@@ -155,7 +155,6 @@ static int setMenuTextFont();
static int setIconTitleFont(); static int setIconTitleFont();
static int setIconTitleColor(); static int setIconTitleColor();
static int setIconTitleBack(); static int setIconTitleBack();
static int setDisplayFont();
static int setLargeDisplayFont(); static int setLargeDisplayFont();
static int setWTitleColor(); static int setWTitleColor();
static int setFTitleBack(); static int setFTitleBack();
@@ -579,9 +578,6 @@ WDefaultEntry optionList[] = {
{"ClipTitleFont", DEF_CLIP_TITLE_FONT, NULL, {"ClipTitleFont", DEF_CLIP_TITLE_FONT, NULL,
NULL, getFont, setClipTitleFont NULL, getFont, setClipTitleFont
}, },
{"DisplayFont", DEF_INFO_TEXT_FONT, NULL,
NULL, getFont, setDisplayFont
},
{"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL, {"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL,
NULL, getFont, setLargeDisplayFont NULL, getFont, setLargeDisplayFont
}, },
@@ -2592,28 +2588,6 @@ setClipTitleFont(WScreen *scr, WDefaultEntry *entry, WMFont *font, void *foo)
} }
static int
setDisplayFont(WScreen *scr, WDefaultEntry *entry, WMFont *font, void *foo)
{
if (scr->info_text_font) {
WMReleaseFont(scr->info_text_font);
}
scr->info_text_font = font;
/* This test works because the scr structure is initially zeroed out
and None = 0. Any other time, the window should be valid. */
if (scr->geometry_display != None) {
wGetGeometryWindowSize(scr, &scr->geometry_display_width,
&scr->geometry_display_height);
XResizeWindow(dpy, scr->geometry_display,
scr->geometry_display_width, scr->geometry_display_height);
}
return 0;
}
static int static int
setLargeDisplayFont(WScreen *scr, WDefaultEntry *entry, WMFont *font, void *foo) setLargeDisplayFont(WScreen *scr, WDefaultEntry *entry, WMFont *font, void *foo)
{ {
@@ -2956,10 +2930,6 @@ setWidgetColor(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo
} }
scr->widget_texture = *(WTexSolid**)texture; scr->widget_texture = *(WTexSolid**)texture;
if (scr->geometry_display != None)
XSetWindowBackground(dpy, scr->geometry_display,
scr->widget_texture->normal.pixel);
return 0; return 0;
} }

View File

@@ -964,7 +964,8 @@ handleLogoPush(XEvent *event, void *data)
" .....XmnbN:q&Bo.... ", " .....XmnbN:q&Bo.... ",
" ............ "}; " ............ "};
static char *msgs[] = { static char *msgs[] = {
"Have a nice day!" "Have a nice day!",
"Repent! Focus follow mouse users will burn in the flames of hell!"
}; };

View File

@@ -228,8 +228,6 @@ toggleLoweredCallback(WMenu *menu, WMenuEntry *entry)
toggleLowered(entry->clientdata); toggleLowered(entry->clientdata);
entry->flags.indicator_on = !((WDock*)entry->clientdata)->lowered;
wMenuPaint(menu); wMenuPaint(menu);
} }
@@ -1027,7 +1025,11 @@ updateClipOptionsMenu(WMenu *menu, WDock *dock)
/* keep on top */ /* keep on top */
entry = menu->entries[index]; entry = menu->entries[index];
entry->flags.indicator_on = !dock->lowered; if (dock->lowered) {
entry->text = _("Keep on Top");
} else {
entry->text = _("Allow Lowering");
}
entry->clientdata = dock; entry->clientdata = dock;
/* collapsed */ /* collapsed */
@@ -1069,9 +1071,6 @@ makeClipOptionsMenu(WScreen *scr)
entry = wMenuAddCallback(menu, _("Keep on Top"), entry = wMenuAddCallback(menu, _("Keep on Top"),
toggleLoweredCallback, NULL); toggleLoweredCallback, NULL);
entry->flags.indicator = 1;
entry->flags.indicator_on = 1;
entry->flags.indicator_type = MI_CHECK;
entry = wMenuAddCallback(menu, _("Collapsed"), entry = wMenuAddCallback(menu, _("Collapsed"),
toggleCollapsedCallback, NULL); toggleCollapsedCallback, NULL);
@@ -1115,11 +1114,8 @@ dockMenuCreate(WScreen *scr, int type)
menu = wMenuCreate(scr, NULL, False); menu = wMenuCreate(scr, NULL, False);
if (type != WM_CLIP) { if (type != WM_CLIP) {
entry = wMenuAddCallback(menu, _("Keep on top"), entry = wMenuAddCallback(menu, _("Keep on Top"),
toggleLoweredCallback, NULL); toggleLoweredCallback, NULL);
entry->flags.indicator = 1;
entry->flags.indicator_on = 1;
entry->flags.indicator_type = MI_CHECK;
} else { } else {
entry = wMenuAddCallback(menu, _("Clip Options"), NULL, NULL); entry = wMenuAddCallback(menu, _("Clip Options"), NULL, NULL);
scr->clip_options = makeClipOptionsMenu(scr); scr->clip_options = makeClipOptionsMenu(scr);
@@ -3357,8 +3353,15 @@ openDockMenu(WDock *dock, WAppIcon *aicon, XEvent *event)
if (dock->type == WM_DOCK) { if (dock->type == WM_DOCK) {
/* keep on top */ /* keep on top */
entry = dock->menu->entries[index]; entry = dock->menu->entries[index];
entry->flags.indicator_on = !dock->lowered;
if (dock->lowered) {
entry->text = _("Keep on Top");
} else {
entry->text = _("Allow Lowering");
}
entry->clientdata = dock; entry->clientdata = dock;
dock->menu->flags.realized = 0;
} else { } else {
/* clip options */ /* clip options */
if (scr->clip_options) if (scr->clip_options)

View File

@@ -93,9 +93,10 @@ wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
fwin->languagemode = XkbGroup1Index; fwin->languagemode = XkbGroup1Index;
fwin->last_languagemode = XkbGroup2Index; fwin->last_languagemode = XkbGroup2Index;
#endif #endif
fwin->core = wCoreCreateTopLevel(scr, x, y, width, height, fwin->core = wCoreCreateTopLevel(scr, x, y, width, height,
FRAME_BORDER_WIDTH); (flags & WFF_BORDER)
? FRAME_BORDER_WIDTH : 0);
if (wPreferences.use_saveunders) { if (wPreferences.use_saveunders) {
unsigned long vmask; unsigned long vmask;
XSetWindowAttributes attribs; XSetWindowAttributes attribs;
@@ -161,12 +162,12 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
} }
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
if (fwin->language_button) if (fwin->language_button)
if (fwin->flags.hide_left_button || !fwin->left_button if (fwin->flags.hide_left_button || !fwin->left_button
|| fwin->flags.lbutton_dont_fit) { || fwin->flags.lbutton_dont_fit) {
wCoreConfigure(fwin->language_button, 0, 0, bsize, bsize); wCoreConfigure(fwin->language_button, 0, 0, bsize, bsize);
} else { } else {
wCoreConfigure(fwin->language_button, bsize, 0, bsize, bsize); wCoreConfigure(fwin->language_button, bsize, 0, bsize, bsize);
} }
#endif #endif
@@ -182,10 +183,9 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
if (fwin->language_button) { if (fwin->language_button) {
wCoreConfigure(fwin->language_button, 6 + bsize, (theight-bsize)/2, wCoreConfigure(fwin->language_button, 6 + bsize, (theight-bsize)/2,
bsize, bsize); bsize, bsize);
}
}
#endif #endif
if (fwin->right_button) { if (fwin->right_button) {
@@ -197,23 +197,23 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
} else { } else {
/* we had a titlebar, but now we don't need it anymore */ /* we had a titlebar, but now we don't need it anymore */
for (i=0; i < (fwin->flags.single_texture ? 1 : 3); i++) { for (i=0; i < (fwin->flags.single_texture ? 1 : 3); i++) {
FREE_PIXMAP(fwin->title_back[i]); FREE_PIXMAP(fwin->title_back[i]);
if (wPreferences.new_style) { if (wPreferences.new_style) {
FREE_PIXMAP(fwin->lbutton_back[i]); FREE_PIXMAP(fwin->lbutton_back[i]);
FREE_PIXMAP(fwin->rbutton_back[i]); FREE_PIXMAP(fwin->rbutton_back[i]);
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
FREE_PIXMAP(fwin->languagebutton_back[i]); FREE_PIXMAP(fwin->languagebutton_back[i]);
#endif #endif
} }
} }
if (fwin->left_button) if (fwin->left_button)
wCoreDestroy(fwin->left_button); wCoreDestroy(fwin->left_button);
fwin->left_button = NULL; fwin->left_button = NULL;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
if (fwin->language_button) if (fwin->language_button)
wCoreDestroy(fwin->language_button); wCoreDestroy(fwin->language_button);
fwin->language_button = NULL; fwin->language_button = NULL;
#endif #endif
if (fwin->right_button) if (fwin->right_button)
@@ -233,59 +233,59 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
fwin->flags.titlebar = 1; fwin->flags.titlebar = 1;
fwin->titlebar = wCoreCreate(fwin->core, 0, 0, width+1, theight); fwin->titlebar = wCoreCreate(fwin->core, 0, 0, width+1, theight);
if (flags & WFF_LEFT_BUTTON) { if (flags & WFF_LEFT_BUTTON) {
fwin->flags.left_button = 1; fwin->flags.left_button = 1;
if (wPreferences.new_style) { if (wPreferences.new_style) {
fwin->left_button = wCoreCreate(fwin->core, 0, 0, fwin->left_button = wCoreCreate(fwin->core, 0, 0,
bsize, bsize); bsize, bsize);
if (width < theight*4) { if (width < theight*4) {
fwin->flags.lbutton_dont_fit = 1; fwin->flags.lbutton_dont_fit = 1;
} else { } else {
XMapRaised(dpy, fwin->left_button->window); XMapRaised(dpy, fwin->left_button->window);
} }
} else { } else {
fwin->left_button = fwin->left_button =
wCoreCreate(fwin->titlebar, 3, (theight-bsize)/2, wCoreCreate(fwin->titlebar, 3, (theight-bsize)/2,
bsize, bsize); bsize, bsize);
XSetWindowBackground(dpy, fwin->left_button->window, XSetWindowBackground(dpy, fwin->left_button->window,
scr->widget_texture->normal.pixel); scr->widget_texture->normal.pixel);
if (width < theight*3) { if (width < theight*3) {
fwin->flags.lbutton_dont_fit = 1; fwin->flags.lbutton_dont_fit = 1;
} else { } else {
XMapRaised(dpy, fwin->left_button->window); XMapRaised(dpy, fwin->left_button->window);
} }
} }
} }
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
if (flags & WFF_LANGUAGE_BUTTON) { if (flags & WFF_LANGUAGE_BUTTON) {
fwin->flags.language_button = 1; fwin->flags.language_button = 1;
if (wPreferences.new_style) { if (wPreferences.new_style) {
fwin->language_button = wCoreCreate(fwin->core, fwin->language_button = wCoreCreate(fwin->core,
bsize, 0, bsize, bsize); bsize, 0, bsize, bsize);
if (width < theight*4) { if (width < theight*4) {
fwin->flags.languagebutton_dont_fit = 1; fwin->flags.languagebutton_dont_fit = 1;
} else { } else {
XMapRaised(dpy, fwin->language_button->window); XMapRaised(dpy, fwin->language_button->window);
} }
} else { } else {
fwin->language_button = fwin->language_button =
wCoreCreate(fwin->titlebar, bsize + 6, (theight-bsize)/2, wCoreCreate(fwin->titlebar, bsize + 6, (theight-bsize)/2,
bsize, bsize); bsize, bsize);
XSetWindowBackground(dpy, fwin->language_button->window, XSetWindowBackground(dpy, fwin->language_button->window,
scr->widget_texture->normal.pixel); scr->widget_texture->normal.pixel);
if (width < theight*3) { if (width < theight*3) {
fwin->flags.languagebutton_dont_fit = 1; fwin->flags.languagebutton_dont_fit = 1;
} else { } else {
XMapRaised(dpy, fwin->language_button->window); XMapRaised(dpy, fwin->language_button->window);
} }
} }
} }
#endif #endif
@@ -319,14 +319,10 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
} }
} }
checkTitleSize(fwin); checkTitleSize(fwin);
if (flags & WFF_RESIZEBAR) {
fwin->bottom_width = RESIZEBAR_HEIGHT;
} else {
fwin->bottom_width = 0;
}
if (flags & WFF_RESIZEBAR) { if (flags & WFF_RESIZEBAR) {
fwin->bottom_width = RESIZEBAR_HEIGHT;
if (!fwin->resizebar) { if (!fwin->resizebar) {
fwin->flags.resizebar = 1; fwin->flags.resizebar = 1;
fwin->resizebar = wCoreCreate(fwin->core, 0, fwin->resizebar = wCoreCreate(fwin->core, 0,
@@ -350,6 +346,8 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
} }
} }
} else { } else {
fwin->bottom_width = 0;
if (fwin->resizebar) { if (fwin->resizebar) {
fwin->bottom_width = 0; fwin->bottom_width = 0;
wCoreDestroy(fwin->resizebar); wCoreDestroy(fwin->resizebar);
@@ -363,6 +361,13 @@ wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags)
height + fwin->top_width + fwin->bottom_width); height + fwin->top_width + fwin->bottom_width);
} }
if (flags & WFF_BORDER) {
XSetWindowBorderWidth(dpy, fwin->core->window, FRAME_BORDER_WIDTH);
} else {
XSetWindowBorderWidth(dpy, fwin->core->window, 0);
}
/* setup object descriptors */ /* setup object descriptors */
if (fwin->titlebar) { if (fwin->titlebar) {

View File

@@ -149,10 +149,6 @@ void wHackedGrabButton(unsigned int button, unsigned int modifiers,
/* this function is in dock.c */ /* this function is in dock.c */
void ParseCommand(char *command, char ***argv, int *argc); void ParseCommand(char *command, char ***argv, int *argc);
/* This function is in moveres.c. */
void wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
unsigned int *height);
void ExecExitScript(); void ExecExitScript();
/****** I18N Wrapper for XFetchName,XGetIconName ******/ /****** I18N Wrapper for XFetchName,XGetIconName ******/

View File

@@ -164,7 +164,7 @@ wMenuCreate(WScreen *screen, char *title, int main_menu)
tmp = (main_menu ? WMMainMenuLevel : WMSubmenuLevel); tmp = (main_menu ? WMMainMenuLevel : WMSubmenuLevel);
#endif #endif
flags = WFF_SINGLE_STATE; flags = WFF_SINGLE_STATE|WFF_BORDER;
if (title) { if (title) {
flags |= WFF_TITLEBAR|WFF_RIGHT_BUTTON; flags |= WFF_TITLEBAR|WFF_RIGHT_BUTTON;
menu->flags.titled = 1; menu->flags.titled = 1;
@@ -536,7 +536,7 @@ wMenuRealize(WMenu *menu)
brother_done = 0; brother_done = 0;
} }
flags = WFF_SINGLE_STATE; flags = WFF_SINGLE_STATE|WFF_BORDER;
if (menu->flags.titled) if (menu->flags.titled)
flags |= WFF_TITLEBAR|WFF_RIGHT_BUTTON; flags |= WFF_TITLEBAR|WFF_RIGHT_BUTTON;

View File

@@ -40,6 +40,8 @@
#include "actions.h" #include "actions.h"
#include "workspace.h" #include "workspace.h"
#include "geomview.h"
#ifdef KWM_HINTS #ifdef KWM_HINTS
#include "kwm.h" #include "kwm.h"
@@ -67,16 +69,6 @@ extern Atom _XA_WM_PROTOCOLS;
void
wGetGeometryWindowSize(WScreen *scr, unsigned int *width,
unsigned int *height)
{
*width = WMWidthOfString(scr->info_text_font, "-8888 x -8888", 13);
*height = (6 * WMFontHeight(scr->info_text_font)) / 4 - 1;
}
/* /*
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* checkMouseSamplingRate- * checkMouseSamplingRate-
@@ -114,20 +106,23 @@ checkMouseSamplingRate(XEvent *ev)
static void static void
moveGeometryDisplayCentered(WScreen *scr, int x, int y) moveGeometryDisplayCentered(WScreen *scr, int x, int y)
{ {
x -= scr->geometry_display_width / 2; unsigned int w = WMWidgetWidth(scr->gview);
y -= scr->geometry_display_height / 2; unsigned int h = WMWidgetHeight(scr->gview);
x -= w / 2;
y -= h / 2;
if (x < 1) if (x < 1)
x = 1; x = 1;
else if (x > (scr->scr_width - scr->geometry_display_width - 3)) else if (x > (scr->scr_width - w - 3))
x = scr->scr_width - scr->geometry_display_width - 3; x = scr->scr_width - w - 3;
if (y < 1) if (y < 1)
y = 1; y = 1;
else if (y > (scr->scr_height - scr->geometry_display_height - 3)) else if (y > (scr->scr_height - h - 3))
y = scr->scr_height - scr->geometry_display_height - 3; y = scr->scr_height - h - 3;
XMoveWindow(dpy, scr->geometry_display, x, y); WMMoveWidget(scr->gview, x, y);
} }
@@ -135,12 +130,9 @@ static void
showPosition(WWindow *wwin, int x, int y) showPosition(WWindow *wwin, int x, int y)
{ {
WScreen *scr = wwin->screen_ptr; WScreen *scr = wwin->screen_ptr;
GC gc = scr->info_text_gc;
char num[16];
int fw, fh;
if (wPreferences.move_display == WDIS_NEW) { if (wPreferences.move_display == WDIS_NEW) {
#if 1 #if 0
int width = wwin->frame->core->width; int width = wwin->frame->core->width;
int height = wwin->frame->core->height; int height = wwin->frame->core->height;
@@ -156,22 +148,7 @@ showPosition(WWindow *wwin, int x, int y)
scr->scr_height); scr->scr_height);
#endif #endif
} else { } else {
XClearArea(dpy, scr->geometry_display, 1, 1, WSetGeometryViewShownPosition(scr->gview, x, y);
scr->geometry_display_width-2, scr->geometry_display_height-2,
False);
sprintf(num, "%+i %-+i", x, y);
fw = WMWidthOfString(scr->info_text_font, num, strlen(num));
XSetForeground(dpy, gc, scr->black_pixel);
fh = WMFontHeight(scr->info_text_font);
WMDrawString(scr->wmscreen, scr->geometry_display, gc,
scr->info_text_font,
(scr->geometry_display_width - 2 - fw) / 2,
(scr->geometry_display_height-fh)/2, num, strlen(num));
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
scr->geometry_display_height+1,
scr->widget_texture, WREL_RAISED);
} }
} }
@@ -183,9 +160,9 @@ cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
wPreferences.move_display++; wPreferences.move_display++;
wPreferences.move_display %= NUM_DISPLAYS; wPreferences.move_display %= NUM_DISPLAYS;
if (wPreferences.move_display == WDIS_NEW) { if (wPreferences.move_display == WDIS_NEW) {
XUnmapWindow(dpy, scr->geometry_display); WMUnmapWidget(scr->gview);
} else { } else {
if (wPreferences.move_display == WDIS_CENTER) { if (wPreferences.move_display == WDIS_CENTER) {
moveGeometryDisplayCentered(scr, moveGeometryDisplayCentered(scr,
@@ -195,7 +172,7 @@ cyclePositionDisplay(WWindow *wwin, int x, int y, int w, int h)
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { } else if (wPreferences.move_display == WDIS_FRAME_CENTER) {
moveGeometryDisplayCentered(scr, x + w/2, y + h/2); moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
} }
XMapRaised(dpy, scr->geometry_display); WMMapWidget(scr->gview);
} }
} }
@@ -215,13 +192,10 @@ mapPositionDisplay(WWindow *wwin, int x, int y, int w, int h)
} else if (wPreferences.move_display == WDIS_FRAME_CENTER) { } else if (wPreferences.move_display == WDIS_FRAME_CENTER) {
moveGeometryDisplayCentered(scr, x + w/2, y + h/2); moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
} }
XMapRaised(dpy, scr->geometry_display); WMMapWidget(scr->gview);
showPosition(wwin, x, y); WSetGeometryViewShownPosition(scr->gview, x, y);
} }
#define unmapPositionDisplay(w) \
XUnmapWindow(dpy, (w)->screen_ptr->geometry_display);
static void static void
showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction) showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
@@ -233,7 +207,7 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
char num[16]; char num[16];
XSegment segment[4]; XSegment segment[4];
int fw, fh; int fw, fh;
ty = y1 + wwin->frame->top_width; ty = y1 + wwin->frame->top_width;
by = y2 - wwin->frame->bottom_width; by = y2 - wwin->frame->bottom_width;
fw = WMWidthOfString(scr->info_text_font, "8888", 4); fw = WMWidthOfString(scr->info_text_font, "8888", 4);
@@ -353,25 +327,11 @@ showGeometry(WWindow *wwin, int x1, int y1, int x2, int y2, int direction)
WMDrawString(scr->wmscreen, root, gc, scr->info_text_font, WMDrawString(scr->wmscreen, root, gc, scr->info_text_font,
mx - fw/2 + 1, y - s - fh/2 + 1, num, strlen(num)); mx - fw/2 + 1, y - s - fh/2 + 1, num, strlen(num));
} else { } else {
XClearArea(dpy, scr->geometry_display, 1, 1, WSetGeometryViewShownSize(scr->gview,
scr->geometry_display_width-2, scr->geometry_display_height-2, (x2 - x1 - wwin->normal_hints->base_width)
False); / wwin->normal_hints->width_inc,
sprintf(num, "%i x %-i", (x2 - x1 - wwin->normal_hints->base_width) (by - ty - wwin->normal_hints->base_height)
/ wwin->normal_hints->width_inc, / wwin->normal_hints->height_inc);
(by - ty - wwin->normal_hints->base_height)
/ wwin->normal_hints->height_inc);
fw = WMWidthOfString(scr->info_text_font, num, strlen(num));
XSetForeground(dpy, scr->info_text_gc, scr->black_pixel);
/* Display the height. */
WMDrawString(scr->wmscreen, scr->geometry_display, scr->info_text_gc,
scr->info_text_font,
(scr->geometry_display_width-fw)/2,
(scr->geometry_display_height-fh)/2, num, strlen(num));
wDrawBevel(scr->geometry_display, scr->geometry_display_width+1,
scr->geometry_display_height+1,
scr->widget_texture, WREL_RAISED);
} }
} }
@@ -385,7 +345,7 @@ cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
wPreferences.size_display %= NUM_DISPLAYS; wPreferences.size_display %= NUM_DISPLAYS;
if (wPreferences.size_display == WDIS_NEW) { if (wPreferences.size_display == WDIS_NEW) {
XUnmapWindow(dpy, scr->geometry_display); WMUnmapWidget(scr->gview);
} else { } else {
if (wPreferences.size_display == WDIS_CENTER) { if (wPreferences.size_display == WDIS_CENTER) {
moveGeometryDisplayCentered(scr, moveGeometryDisplayCentered(scr,
@@ -395,7 +355,7 @@ cycleGeometryDisplay(WWindow *wwin, int x, int y, int w, int h, int dir)
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { } else if (wPreferences.size_display == WDIS_FRAME_CENTER) {
moveGeometryDisplayCentered(scr, x + w/2, y + h/2); moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
} }
XMapRaised(dpy, scr->geometry_display); WMMapWidget(scr->gview);
showGeometry(wwin, x, y, x + w, y + h, dir); showGeometry(wwin, x, y, x + w, y + h, dir);
} }
} }
@@ -417,12 +377,10 @@ mapGeometryDisplay(WWindow *wwin, int x, int y, int w, int h)
} else if (wPreferences.size_display == WDIS_FRAME_CENTER) { } else if (wPreferences.size_display == WDIS_FRAME_CENTER) {
moveGeometryDisplayCentered(scr, x + w/2, y + h/2); moveGeometryDisplayCentered(scr, x + w/2, y + h/2);
} }
XMapRaised(dpy, scr->geometry_display); WMMapWidget(scr->gview);
showGeometry(wwin, x, y, x + w, y + h, 0); showGeometry(wwin, x, y, x + w, y + h, 0);
} }
#define unmapGeometryDisplay(w) \
XUnmapWindow(dpy, (w)->screen_ptr->geometry_display);
static void static void
@@ -1450,32 +1408,29 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
if (wwin->flags.shaded && !scr->selected_windows){ if (wwin->flags.shaded && !scr->selected_windows){
moveGeometryDisplayCentered(scr, src_x+off_x + w/2, src_y+off_y + h/2); moveGeometryDisplayCentered(scr, src_x+off_x + w/2, src_y+off_y + h/2);
} } else {
else { if (ctrlmode) {
if(ctrlmode){ WMUnmapWidget(scr->gview);
unmapPositionDisplay(wwin);
mapGeometryDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh); mapGeometryDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh);
} } else if(!scr->selected_windows) {
else if(!scr->selected_windows){ WMUnmapWidget(scr->gview);
unmapGeometryDisplay(wwin);
mapPositionDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh); mapPositionDisplay(wwin, src_x+off_x, src_y+off_y, ww, wh);
} }
} }
if (wwin->flags.shaded || scr->selected_windows) { if (wwin->flags.shaded || scr->selected_windows) {
if(scr->selected_windows) if (scr->selected_windows)
drawFrames(wwin,scr->selected_windows,off_x,off_y); drawFrames(wwin,scr->selected_windows,off_x,off_y);
else drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h); else
} drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, w, h);
else { } else {
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh); drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
} }
if(ctrlmode){ if (ctrlmode) {
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0); showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
} } else if(!scr->selected_windows)
else if(!scr->selected_windows)
showPosition(wwin, src_x+off_x, src_y+off_y); showPosition(wwin, src_x+off_x, src_y+off_y);
/**/ /**/
@@ -1493,36 +1448,36 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh); drawTransparentFrame(wwin, src_x+off_x, src_y+off_y, ww, wh);
} }
if(ctrlmode){ if (ctrlmode) {
showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0); showGeometry(wwin, src_x+off_x, src_y+off_y, src_x+off_x+ww, src_y+off_y+wh,0);
unmapGeometryDisplay(wwin); WMUnmapWidget(scr->gview);
} } else
else WMUnmapWidget(scr->gview);
unmapPositionDisplay(wwin);
XUngrabKeyboard(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime);
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
XUngrabServer(dpy); XUngrabServer(dpy);
if(done==2) { if(done==2) {
if (wwin->flags.shaded || scr->selected_windows) { if (wwin->flags.shaded || scr->selected_windows) {
if (!scr->selected_windows) { if (!scr->selected_windows) {
wWindowMove(wwin, src_x+off_x, src_y+off_y); wWindowMove(wwin, src_x+off_x, src_y+off_y);
wWindowSynthConfigureNotify(wwin); wWindowSynthConfigureNotify(wwin);
} else { } else {
int i; int i;
WMBag *bag = scr->selected_windows; WMBag *bag = scr->selected_windows;
doWindowMove(wwin,scr->selected_windows,off_x,off_y); doWindowMove(wwin,scr->selected_windows,off_x,off_y);
for (i = 0; i < WMGetBagItemCount(bag); i++) { for (i = 0; i < WMGetBagItemCount(bag); i++) {
wWindowSynthConfigureNotify(WMGetFromBag(bag, i)); wWindowSynthConfigureNotify(WMGetFromBag(bag, i));
} }
} }
} else { } else {
if (wwin->client.width != ww) if (wwin->client.width != ww)
wwin->flags.user_changed_width = 1; wwin->flags.user_changed_width = 1;
if (wwin->client.height != wh - vert_border) if (wwin->client.height != wh - vert_border)
wwin->flags.user_changed_height = 1; wwin->flags.user_changed_height = 1;
wWindowConfigure(wwin, src_x+off_x, src_y+off_y, wWindowConfigure(wwin, src_x+off_x, src_y+off_y,
ww, wh - vert_border); ww, wh - vert_border);
wWindowSynthConfigureNotify(wwin); wWindowSynthConfigureNotify(wwin);
@@ -1754,7 +1709,7 @@ wMouseMoveWindow(WWindow *wwin, XEvent *ev)
if (!scr->selected_windows) { if (!scr->selected_windows) {
/* get rid of the geometry window */ /* get rid of the geometry window */
unmapPositionDisplay(wwin); WMUnmapWidget(scr->gview);
} }
} }
#ifdef DEBUG #ifdef DEBUG
@@ -2028,7 +1983,7 @@ wMouseResizeWindow(WWindow *wwin, XEvent *ev)
drawTransparentFrame(wwin, fx, fy, fw, fh); drawTransparentFrame(wwin, fx, fy, fw, fh);
XUngrabKeyboard(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime);
unmapGeometryDisplay(wwin); WMUnmapWidget(scr->gview);
XUngrabServer(dpy); XUngrabServer(dpy);
if (wwin->client.width != fw) if (wwin->client.width != fw)
@@ -2258,7 +2213,7 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
XUngrabPointer(dpy, CurrentTime); XUngrabPointer(dpy, CurrentTime);
XUngrabKeyboard(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime);
/* get rid of the geometry window */ /* get rid of the geometry window */
unmapPositionDisplay(wwin); WMUnmapWidget(scr->gview);
return; return;
default: default:

View File

@@ -52,6 +52,7 @@
#include "workspace.h" #include "workspace.h"
#include "session.h" #include "session.h"
#include "balloon.h" #include "balloon.h"
#include "geomview.h"
#ifdef KWM_HINTS #ifdef KWM_HINTS
# include "kwm.h" # include "kwm.h"
#endif #endif
@@ -498,29 +499,6 @@ createInternalWindows(WScreen *scr)
{ {
int vmask; int vmask;
XSetWindowAttributes attribs; XSetWindowAttributes attribs;
/* window for displaying geometry information during resizes and moves */
vmask = CWBorderPixel|CWBackPixmap|CWBackPixel|CWCursor|CWSaveUnder|CWOverrideRedirect;
attribs.border_pixel = scr->black_pixel;
attribs.save_under = True;
attribs.override_redirect = True;
attribs.cursor = wCursor[WCUR_DEFAULT];
attribs.background_pixmap = None;
if (scr->widget_texture)
attribs.background_pixel = scr->widget_texture->normal.pixel;
else
attribs.background_pixel = scr->light_pixel;
vmask |= CWColormap;
attribs.colormap = scr->w_colormap;
wGetGeometryWindowSize(scr, &scr->geometry_display_width,
&scr->geometry_display_height);
scr->geometry_display =
XCreateWindow(dpy, scr->root_win, 1, 1,
scr->geometry_display_width,
scr->geometry_display_height,
1, scr->w_depth, CopyFromParent, scr->w_visual,
vmask, &attribs);
/* InputOnly window to get the focus when no other window can get it */ /* InputOnly window to get the focus when no other window can get it */
vmask = CWEventMask|CWOverrideRedirect; vmask = CWEventMask|CWOverrideRedirect;
@@ -540,6 +518,7 @@ createInternalWindows(WScreen *scr)
attribs.override_redirect = True; attribs.override_redirect = True;
attribs.background_pixmap = None; attribs.background_pixmap = None;
attribs.background_pixel = scr->white_pixel; attribs.background_pixel = scr->white_pixel;
attribs.cursor = wCursor[WCUR_DEFAULT];
vmask |= CWColormap; vmask |= CWColormap;
attribs.colormap = scr->w_colormap; attribs.colormap = scr->w_colormap;
scr->dock_shadow = scr->dock_shadow =
@@ -868,6 +847,12 @@ wScreenInit(int screen_number)
/* initialize balloon text stuff */ /* initialize balloon text stuff */
wBalloonInitialize(scr); wBalloonInitialize(scr);
#endif #endif
scr->info_text_font = WMBoldSystemFontOfSize(scr->wmscreen, 12);
scr->gview = WCreateGeometryView(scr->wmscreen);
WMRealizeWidget(scr->gview);
wScreenUpdateUsableArea(scr); wScreenUpdateUsableArea(scr);

View File

@@ -233,10 +233,6 @@ typedef struct _WScreen {
Window clip_balloon; /* window for workspace name */ Window clip_balloon; /* window for workspace name */
Window geometry_display; /* displays the geometry during
* window resize, move etc. */
unsigned int geometry_display_width;
unsigned int geometry_display_height;
int keymove_tick; int keymove_tick;
#ifdef GRADIENT_CLIP_ARROW #ifdef GRADIENT_CLIP_ARROW
@@ -255,6 +251,9 @@ typedef struct _WScreen {
Pixmap def_ticon_pixmap; Pixmap def_ticon_pixmap;
struct WDialogData *dialog_data; struct WDialogData *dialog_data;
struct W_GeometryView *gview; /* size/position view */
#ifdef NEWSTUFF #ifdef NEWSTUFF
struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */ struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */

View File

@@ -465,11 +465,14 @@ static WMPixmap *data[12];
static Bool static Bool
loadData(WScreen *scr) loadData(WScreen *scr)
{ {
#ifdef needs_update
FILE *f; FILE *f;
int i; int i;
RImage *image; RImage *image;
Pixmap d[12]; Pixmap d[12];
return False;
f = fopen(PKGDATADIR"/xtree.dat", "r"); f = fopen(PKGDATADIR"/xtree.dat", "r");
if (!f) if (!f)
return False; return False;
@@ -515,6 +518,7 @@ error:
} }
return False; return False;
#endif
} }

View File

@@ -66,6 +66,7 @@ static proplist_t ANoTitlebar = NULL;
static proplist_t ANoResizebar; static proplist_t ANoResizebar;
static proplist_t ANoMiniaturizeButton; static proplist_t ANoMiniaturizeButton;
static proplist_t ANoCloseButton; static proplist_t ANoCloseButton;
static proplist_t ANoBorder;
static proplist_t ANoHideOthers; static proplist_t ANoHideOthers;
static proplist_t ANoMouseBindings; static proplist_t ANoMouseBindings;
static proplist_t ANoKeyBindings; static proplist_t ANoKeyBindings;
@@ -105,6 +106,7 @@ init_wdefaults(WScreen *scr)
ANoResizebar = PLMakeString("NoResizebar"); ANoResizebar = PLMakeString("NoResizebar");
ANoMiniaturizeButton = PLMakeString("NoMiniaturizeButton"); ANoMiniaturizeButton = PLMakeString("NoMiniaturizeButton");
ANoCloseButton = PLMakeString("NoCloseButton"); ANoCloseButton = PLMakeString("NoCloseButton");
ANoBorder = PLMakeString("NoBorder");
ANoHideOthers = PLMakeString("NoHideOthers"); ANoHideOthers = PLMakeString("NoHideOthers");
ANoMouseBindings = PLMakeString("NoMouseBindings"); ANoMouseBindings = PLMakeString("NoMouseBindings");
ANoKeyBindings = PLMakeString("NoKeyBindings"); ANoKeyBindings = PLMakeString("NoKeyBindings");
@@ -261,6 +263,9 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
value = get_value(dw, dc, dn, da, ANoCloseButton, No, useGlobalDefault); value = get_value(dw, dc, dn, da, ANoCloseButton, No, useGlobalDefault);
APPLY_VAL(value, no_close_button, ANoCloseButton); APPLY_VAL(value, no_close_button, ANoCloseButton);
value = get_value(dw, dc, dn, da, ANoBorder, No, useGlobalDefault);
APPLY_VAL(value, no_border, ANoBorder);
value = get_value(dw, dc, dn, da, ANoHideOthers, No, useGlobalDefault); value = get_value(dw, dc, dn, da, ANoHideOthers, No, useGlobalDefault);
APPLY_VAL(value, no_hide_others, ANoHideOthers); APPLY_VAL(value, no_hide_others, ANoHideOthers);

View File

@@ -215,6 +215,10 @@ wWindowDestroy(WWindow *wwin)
{ {
int i; int i;
if (wwin->screen_ptr->cmap_window == wwin) {
wwin->screen_ptr->cmap_window = NULL;
}
WMRemoveNotificationObserver(wwin); WMRemoveNotificationObserver(wwin);
wwin->flags.destroyed = 1; wwin->flags.destroyed = 1;
@@ -232,7 +236,7 @@ wWindowDestroy(WWindow *wwin)
} }
if (wwin->normal_hints) if (wwin->normal_hints)
free(wwin->normal_hints); XFree(wwin->normal_hints);
if (wwin->wm_hints) if (wwin->wm_hints)
XFree(wwin->wm_hints); XFree(wwin->wm_hints);
@@ -270,28 +274,48 @@ static void
setupGNUstepHints(WWindow *wwin, GNUstepWMAttributes *gs_hints) setupGNUstepHints(WWindow *wwin, GNUstepWMAttributes *gs_hints)
{ {
if (gs_hints->flags & GSWindowStyleAttr) { if (gs_hints->flags & GSWindowStyleAttr) {
wwin->client_flags.no_titlebar = if (gs_hints->window_style == WMBorderlessWindowMask) {
((gs_hints->window_style & WMTitledWindowMask)?0:1); wwin->client_flags.no_border = 1;
wwin->client_flags.no_titlebar = 1;
wwin->client_flags.no_closable = 1;
wwin->client_flags.no_miniaturizable = 1;
wwin->client_flags.no_resizable = 1;
wwin->client_flags.no_close_button = 1;
wwin->client_flags.no_miniaturize_button = 1;
wwin->client_flags.no_resizebar = 1;
} else {
wwin->client_flags.no_close_button =
((gs_hints->window_style & WMClosableWindowMask)?0:1);
wwin->client_flags.no_close_button = wwin->client_flags.no_closable =
((gs_hints->window_style & WMClosableWindowMask)?0:1); ((gs_hints->window_style & WMClosableWindowMask)?0:1);
wwin->client_flags.no_closable = wwin->client_flags.no_miniaturize_button =
((gs_hints->window_style & WMClosableWindowMask)?0:1); ((gs_hints->window_style & WMMiniaturizableWindowMask)?0:1);
wwin->client_flags.no_miniaturize_button = wwin->client_flags.no_miniaturizable =
((gs_hints->window_style & WMMiniaturizableWindowMask)?0:1); wwin->client_flags.no_miniaturize_button;
wwin->client_flags.no_miniaturizable = wwin->client_flags.no_resizebar =
((gs_hints->window_style & WMMiniaturizableWindowMask)?0:1); ((gs_hints->window_style & WMResizableWindowMask)?0:1);
wwin->client_flags.no_resizebar = wwin->client_flags.no_resizable = wwin->client_flags.no_resizebar;
((gs_hints->window_style & WMResizableWindowMask)?0:1);
wwin->client_flags.no_resizable = /* these attributes supposedly imply in the existence
((gs_hints->window_style & WMResizableWindowMask)?0:1); * of a titlebar */
if (gs_hints->window_style & (WMResizableWindowMask|
WMClosableWindowMask|
WMMiniaturizableWindowMask)) {
wwin->client_flags.no_titlebar = 0;
} else {
wwin->client_flags.no_titlebar =
((gs_hints->window_style & WMTitledWindowMask)?0:1);
}
}
} else { } else {
/* setup the defaults */ /* setup the defaults */
wwin->client_flags.no_border = 0;
wwin->client_flags.no_titlebar = 0; wwin->client_flags.no_titlebar = 0;
wwin->client_flags.no_closable = 0; wwin->client_flags.no_closable = 0;
wwin->client_flags.no_miniaturizable = 0; wwin->client_flags.no_miniaturizable = 0;
@@ -911,6 +935,8 @@ wManageWindow(WScreen *scr, Window window)
foo |= WFF_TITLEBAR; foo |= WFF_TITLEBAR;
if (!WFLAGP(wwin, no_resizebar)) if (!WFLAGP(wwin, no_resizebar))
foo |= WFF_RESIZEBAR; foo |= WFF_RESIZEBAR;
if (!WFLAGP(wwin, no_border))
foo |= WFF_BORDER;
wwin->frame = wFrameWindowCreate(scr, window_level, wwin->frame = wFrameWindowCreate(scr, window_level,
x, y, width, height, x, y, width, height,
@@ -1271,7 +1297,7 @@ wManageInternalWindow(WScreen *scr, Window window, Window owner,
wwin->frame_y = wwin->client.y; wwin->frame_y = wwin->client.y;
foo = WFF_RIGHT_BUTTON; foo = WFF_RIGHT_BUTTON|WFF_BORDER;
foo |= WFF_TITLEBAR; foo |= WFF_TITLEBAR;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
foo |= WFF_LANGUAGE_BUTTON; foo |= WFF_LANGUAGE_BUTTON;
@@ -2152,6 +2178,8 @@ wWindowConfigureBorders(WWindow *wwin)
flags |= WFF_TITLEBAR; flags |= WFF_TITLEBAR;
if (!WFLAGP(wwin, no_resizebar)) if (!WFLAGP(wwin, no_resizebar))
flags |= WFF_RESIZEBAR; flags |= WFF_RESIZEBAR;
if (!WFLAGP(wwin, no_border))
flags |= WFF_BORDER;
if (wwin->flags.shaded) if (wwin->flags.shaded)
flags |= WFF_IS_SHADED; flags |= WFF_IS_SHADED;

View File

@@ -91,6 +91,7 @@ typedef struct {
unsigned int no_resizable:1; unsigned int no_resizable:1;
unsigned int no_closable:1; unsigned int no_closable:1;
unsigned int no_miniaturizable:1; unsigned int no_miniaturizable:1;
unsigned int no_border:1; /* 1 pixel border around window */
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
unsigned int no_language_button:1; unsigned int no_language_button:1;
#endif #endif

View File

@@ -88,7 +88,7 @@ typedef struct InspectorPanel {
/* second page. attributes */ /* second page. attributes */
WMFrame *attrFrm; WMFrame *attrFrm;
WMButton *attrChk[10]; WMButton *attrChk[11];
/* 3rd page. more attributes */ /* 3rd page. more attributes */
WMFrame *moreFrm; WMFrame *moreFrm;
@@ -136,6 +136,7 @@ static proplist_t ANoTitlebar = NULL;
static proplist_t ANoResizebar; static proplist_t ANoResizebar;
static proplist_t ANoMiniaturizeButton; static proplist_t ANoMiniaturizeButton;
static proplist_t ANoCloseButton; static proplist_t ANoCloseButton;
static proplist_t ANoBorder;
static proplist_t ANoHideOthers; static proplist_t ANoHideOthers;
static proplist_t ANoMouseBindings; static proplist_t ANoMouseBindings;
static proplist_t ANoKeyBindings; static proplist_t ANoKeyBindings;
@@ -199,6 +200,7 @@ make_keys()
ANoResizebar = PLMakeString("NoResizebar"); ANoResizebar = PLMakeString("NoResizebar");
ANoMiniaturizeButton = PLMakeString("NoMiniaturizeButton"); ANoMiniaturizeButton = PLMakeString("NoMiniaturizeButton");
ANoCloseButton = PLMakeString("NoCloseButton"); ANoCloseButton = PLMakeString("NoCloseButton");
ANoBorder = PLMakeString("NoBorder");
ANoHideOthers = PLMakeString("NoHideOthers"); ANoHideOthers = PLMakeString("NoHideOthers");
ANoMouseBindings = PLMakeString("NoMouseBindings"); ANoMouseBindings = PLMakeString("NoMouseBindings");
ANoKeyBindings = PLMakeString("NoKeyBindings"); ANoKeyBindings = PLMakeString("NoKeyBindings");
@@ -595,21 +597,24 @@ saveSettings(WMButton *button, InspectorPanel *panel)
different |= insertAttribute(dict, winDic, ANoMiniaturizeButton, value, flags); different |= insertAttribute(dict, winDic, ANoMiniaturizeButton, value, flags);
value = (WMGetButtonSelected(panel->attrChk[4])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[4])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AKeepOnTop, value, flags); different |= insertAttribute(dict, winDic, ANoBorder, value, flags);
value = (WMGetButtonSelected(panel->attrChk[5])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[5])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AKeepOnBottom, value, flags); different |= insertAttribute(dict, winDic, AKeepOnTop, value, flags);
value = (WMGetButtonSelected(panel->attrChk[6])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[6])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AOmnipresent, value, flags); different |= insertAttribute(dict, winDic, AKeepOnBottom, value, flags);
value = (WMGetButtonSelected(panel->attrChk[7])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[7])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AStartMiniaturized, value, flags); different |= insertAttribute(dict, winDic, AOmnipresent, value, flags);
value = (WMGetButtonSelected(panel->attrChk[8])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[8])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AStartMaximized, value, flags); different |= insertAttribute(dict, winDic, AStartMiniaturized, value, flags);
value = (WMGetButtonSelected(panel->attrChk[9])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->attrChk[9])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AStartMaximized, value, flags);
value = (WMGetButtonSelected(panel->attrChk[10])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, ASkipWindowList, value, flags); different |= insertAttribute(dict, winDic, ASkipWindowList, value, flags);
@@ -811,12 +816,13 @@ applySettings(WMButton *button, InspectorPanel *panel)
WSETUFLAG(wwin, no_resizebar, WMGetButtonSelected(panel->attrChk[1])); WSETUFLAG(wwin, no_resizebar, WMGetButtonSelected(panel->attrChk[1]));
WSETUFLAG(wwin, no_close_button, WMGetButtonSelected(panel->attrChk[2])); WSETUFLAG(wwin, no_close_button, WMGetButtonSelected(panel->attrChk[2]));
WSETUFLAG(wwin, no_miniaturize_button, WMGetButtonSelected(panel->attrChk[3])); WSETUFLAG(wwin, no_miniaturize_button, WMGetButtonSelected(panel->attrChk[3]));
floating = WMGetButtonSelected(panel->attrChk[4]); WSETUFLAG(wwin, no_border, WMGetButtonSelected(panel->attrChk[4]));
sunken = WMGetButtonSelected(panel->attrChk[5]); floating = WMGetButtonSelected(panel->attrChk[5]);
WSETUFLAG(wwin, omnipresent, WMGetButtonSelected(panel->attrChk[6])); sunken = WMGetButtonSelected(panel->attrChk[6]);
WSETUFLAG(wwin, start_miniaturized, WMGetButtonSelected(panel->attrChk[7])); WSETUFLAG(wwin, omnipresent, WMGetButtonSelected(panel->attrChk[7]));
WSETUFLAG(wwin, start_maximized, WMGetButtonSelected(panel->attrChk[8])); WSETUFLAG(wwin, start_miniaturized, WMGetButtonSelected(panel->attrChk[8]));
skip_window_list = WMGetButtonSelected(panel->attrChk[9]); WSETUFLAG(wwin, start_maximized, WMGetButtonSelected(panel->attrChk[9]));
skip_window_list = WMGetButtonSelected(panel->attrChk[10]);
WSETUFLAG(wwin, no_hide_others, WMGetButtonSelected(panel->moreChk[0])); WSETUFLAG(wwin, no_hide_others, WMGetButtonSelected(panel->moreChk[0]));
WSETUFLAG(wwin, no_bind_keys, WMGetButtonSelected(panel->moreChk[1])); WSETUFLAG(wwin, no_bind_keys, WMGetButtonSelected(panel->moreChk[1]));
@@ -936,7 +942,7 @@ revertSettings(WMButton *button, InspectorPanel *panel)
wWindowSetupInitialAttributes(wwin, &level, &workspace); wWindowSetupInitialAttributes(wwin, &level, &workspace);
for (i=0; i < 10; i++) { for (i=0; i < 11; i++) {
int flag = 0; int flag = 0;
switch (i) { switch (i) {
@@ -953,21 +959,24 @@ revertSettings(WMButton *button, InspectorPanel *panel)
flag = WFLAGP(wwin, no_miniaturize_button); flag = WFLAGP(wwin, no_miniaturize_button);
break; break;
case 4: case 4:
flag = WFLAGP(wwin, floating); flag = WFLAGP(wwin, no_border);
break; break;
case 5: case 5:
flag = WFLAGP(wwin, sunken); flag = WFLAGP(wwin, floating);
break; break;
case 6: case 6:
flag = WFLAGP(wwin, omnipresent); flag = WFLAGP(wwin, sunken);
break; break;
case 7: case 7:
flag = WFLAGP(wwin, start_miniaturized); flag = WFLAGP(wwin, omnipresent);
break; break;
case 8: case 8:
flag = WFLAGP(wwin, start_maximized!=0); flag = WFLAGP(wwin, start_miniaturized);
break; break;
case 9: case 9:
flag = WFLAGP(wwin, start_maximized!=0);
break;
case 10:
flag = WFLAGP(wwin, skip_window_list); flag = WFLAGP(wwin, skip_window_list);
break; break;
} }
@@ -1318,7 +1327,7 @@ createInspectorForWindow(WWindow *wwin, int xpos, int ypos,
WMMoveWidget(panel->attrFrm, 15, 45); WMMoveWidget(panel->attrFrm, 15, 45);
WMResizeWidget(panel->attrFrm, frame_width, 250); WMResizeWidget(panel->attrFrm, frame_width, 250);
for (i=0; i < 10; i++) { for (i=0; i < 11; i++) {
char *caption = NULL; char *caption = NULL;
int flag = 0; int flag = 0;
char *descr = NULL; char *descr = NULL;
@@ -1349,34 +1358,39 @@ createInspectorForWindow(WWindow *wwin, int xpos, int ypos,
descr = _("Remove the `miniaturize window' button of the window."); descr = _("Remove the `miniaturize window' button of the window.");
break; break;
case 4: case 4:
caption = _("Disable Border");
flag = WFLAGP(wwin, no_border);
descr = _("Remove the 1 pixel black border around the window.");
break;
case 5:
caption = _("Keep on Top / Floating"); caption = _("Keep on Top / Floating");
flag = WFLAGP(wwin, floating); flag = WFLAGP(wwin, floating);
descr = _("Keep the window over other windows, not allowing\n" descr = _("Keep the window over other windows, not allowing\n"
"them to covert it."); "them to covert it.");
break; break;
case 5: case 6:
caption = _("Keep at Bottom / Sunken"); caption = _("Keep at Bottom / Sunken");
flag = WFLAGP(wwin, sunken); flag = WFLAGP(wwin, sunken);
descr = _("Keep the window under all other windows."); descr = _("Keep the window under all other windows.");
break; break;
case 6: case 7:
caption = _("Omnipresent"); caption = _("Omnipresent");
flag = WFLAGP(wwin, omnipresent); flag = WFLAGP(wwin, omnipresent);
descr = _("Make window occupy all workspaces."); descr = _("Make window occupy all workspaces.");
break; break;
case 7: case 8:
caption = _("Start Miniaturized"); caption = _("Start Miniaturized");
flag = WFLAGP(wwin, start_miniaturized); flag = WFLAGP(wwin, start_miniaturized);
descr = _("Make the window be automatically miniaturized when it's\n" descr = _("Make the window be automatically miniaturized when it's\n"
"first shown."); "first shown.");
break; break;
case 8: case 9:
caption = _("Start Maximized"); caption = _("Start Maximized");
flag = WFLAGP(wwin, start_maximized!=0); flag = WFLAGP(wwin, start_maximized!=0);
descr = _("Make the window be automatically maximized when it's\n" descr = _("Make the window be automatically maximized when it's\n"
"first shown."); "first shown.");
break; break;
case 9: case 10:
caption = _("Skip Window List"); caption = _("Skip Window List");
flag = WFLAGP(wwin, skip_window_list); flag = WFLAGP(wwin, skip_window_list);
descr = _("Do not list the window in the window list menu."); descr = _("Do not list the window in the window list menu.");