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

more dnd changes

window cycling stuff
finnish pot files
This commit is contained in:
kojima
2000-04-07 22:47:04 +00:00
parent 6b93946309
commit caa86529a9
21 changed files with 1327 additions and 1113 deletions

View File

@@ -6,6 +6,11 @@ Changes since version 0.62.0:
- added check for XInternAtoms in configure and replacement code - added check for XInternAtoms in configure and replacement code
- fixed window cycling with single key shortcut - fixed window cycling with single key shortcut
- fixed WPrefs crash on menu editor - fixed WPrefs crash on menu editor
- install only needed icons for WPrefs.app
- updated Finnish translations
- fixed user-whining-windoze-cycling bug
- added option for f'n windoze cycling..
- added --create-stdcmap and made std colormap creation off by default
Changes since version 0.61.1: Changes since version 0.61.1:
............................. .............................

View File

@@ -205,9 +205,6 @@ To get a list of other options, run ./configure --help
--disable-shape --disable-shape
disables shaped windows (for oclock, xeyes etc.) disables shaped windows (for oclock, xeyes etc.)
--enable-debug
Do not use it unless you know what you're doing.
PLATFORM SPECIFIC NOTES: PLATFORM SPECIFIC NOTES:
======================== ========================

View File

@@ -402,6 +402,7 @@ typedef void WMAction2(void *self, void *clientData);
typedef void WMCallback(void *data); typedef void WMCallback(void *data);
typedef void WMDropDataCallback(WMView *view, WMData *data);
/* delegate method like stuff */ /* delegate method like stuff */
typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text, typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
@@ -509,9 +510,8 @@ typedef struct W_DragDestinationProcs {
unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info); unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info); unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
void (*draggingExited)(WMView *self, WMDraggingInfo *info); void (*draggingExited)(WMView *self, WMDraggingInfo *info);
char *(*prepareForDragOperation)(WMView *self, WMDraggingInfo *info); Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info, Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
WMData *data);
void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info); void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
} WMDragDestinationProcs; } WMDragDestinationProcs;

View File

@@ -454,6 +454,10 @@ void W_SetViewBackgroundColor(W_View *view, WMColor *color);
void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width, void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
unsigned int height, WMReliefType relief); unsigned int height, WMReliefType relief);
void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
unsigned int width, unsigned int height,
WMReliefType relief,
GC black, GC dark, GC light, GC white);
void W_CleanUpEvents(W_View *view); void W_CleanUpEvents(W_View *view);

View File

@@ -108,13 +108,12 @@ static void defDraggingExited(WMView *self, WMDraggingInfo *info)
{ {
} }
static char* defPrepareForDragOperation(WMView *self, WMDraggingInfo *info) static Bool defPrepareForDragOperation(WMView *self, WMDraggingInfo *info)
{ {
return NULL; return False;
} }
static Bool defPerformDragOperation(WMView *self, WMDraggingInfo *info, static Bool defPerformDragOperation(WMView *self, WMDraggingInfo *info)
WMData *data)
{ {
return False; return False;
} }
@@ -168,3 +167,49 @@ WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info)
{ {
return info->imageLocation; return info->imageLocation;
} }
static void
receivedData(WMView *view, Atom selection, Atom target, Time timestamp,
void *cdata, WMData *data)
{
}
Bool WMRequestDroppedData(WMView *view, WMDraggingInfo *info, char *type,
WMDropDataCallback *callback)
{
WMScreen *scr = W_VIEW_SCREEN(view);
#if 0
if (info->finished) {
return False;
}
if (type != NULL) {
if (!WMRequestSelection(scr->dragInfo.destView,
scr->xdndSelectionAtom,
XInternAtom(scr->display, type, False),
scr->dragInfo.timestamp,
receivedData, &scr->dragInfo)) {
wwarning("could not request data for dropped data");
/* send finished message */
sendClientMessage(scr->display, source,
scr->xdndFinishedAtom,
scr->dragInfo.destinationWindow,
0, 0, 0, 0);
}
} else {
/* send finished message */
sendClientMessage(scr->display, source,
scr->xdndFinishedAtom,
scr->dragInfo.destinationWindow,
0, 0, 0, 0);
}
#endif
}

View File

@@ -261,8 +261,6 @@ lookForToplevel(WMScreen *scr, Window window, Bool *isAware)
} }
XFree(children); XFree(children);
} }
return toplevel; return toplevel;
@@ -1093,7 +1091,7 @@ receivedData(WMView *view, Atom selection, Atom target,
WMDraggingInfo *info = (WMDraggingInfo*)cdata; WMDraggingInfo *info = (WMDraggingInfo*)cdata;
Bool res; Bool res;
res = view->dragDestinationProcs->performDragOperation(view, info, data); res = view->dragDestinationProcs->performDragOperation(view, info);
if (res) { if (res) {
DISPATCH(view, concludeDragOperation, info); DISPATCH(view, concludeDragOperation, info);
@@ -1297,30 +1295,16 @@ W_HandleDNDClientMessage(WMView *toplevel, XClientMessageEvent *event)
case WDrop: case WDrop:
{ {
char *type; Bool res;
type = DISPATCH(oldView, prepareForDragOperation, &scr->dragInfo); res = DISPATCH(oldView, prepareForDragOperation, &scr->dragInfo);
if (type != NULL) { if (res) {
if (!WMRequestSelection(scr->dragInfo.destView, res = DISPATCH(oldView, performDragOperation, &scr->dragInfo);
scr->xdndSelectionAtom, }
XInternAtom(scr->display, type, False),
scr->dragInfo.timestamp, if (res) {
receivedData, &scr->dragInfo)) {
wwarning("could not request data for dropped data");
/* send finished message */
sendClientMessage(scr->display, source,
scr->xdndFinishedAtom,
scr->dragInfo.destinationWindow,
0, 0, 0, 0);
}
} else {
/* send finished message */
sendClientMessage(scr->display, source,
scr->xdndFinishedAtom,
scr->dragInfo.destinationWindow,
0, 0, 0, 0);
} }
} }
break; break;

View File

@@ -72,7 +72,8 @@ paintFrame(Frame *fPtr)
W_Screen *scrPtr = view->screen; W_Screen *scrPtr = view->screen;
int tx, ty, tw, th; int tx, ty, tw, th;
int fy, fh; int fy, fh;
Bool drawTitle;
if (fPtr->caption!=NULL) if (fPtr->caption!=NULL)
th = WMFontHeight(scrPtr->normalFont); th = WMFontHeight(scrPtr->normalFont);
else { else {
@@ -124,27 +125,66 @@ paintFrame(Frame *fPtr)
fy = 0; fy = 0;
fh = view->size.height; fh = view->size.height;
} }
/*
XClearArea(scrPtr->display, view->window, fy+2, 2, fh-4, view->size.width-4,
False);
*/
XClearWindow(scrPtr->display, view->window);
W_DrawRelief(scrPtr, view->window, 0, fy, view->size.width, fh,
fPtr->flags.relief);
if (fPtr->caption!=NULL && fPtr->flags.titlePosition!=WTPNoTitle) { if (fPtr->caption!=NULL && fPtr->flags.titlePosition!=WTPNoTitle) {
tw = WMWidthOfString(scrPtr->normalFont, fPtr->caption, tw = WMWidthOfString(scrPtr->normalFont, fPtr->caption,
strlen(fPtr->caption)); strlen(fPtr->caption));
tx = (view->size.width - tw) / 2;
XFillRectangle(scrPtr->display, view->window, WMColorGC(scrPtr->gray),
tx, ty, tw, th);
WMDrawString(scrPtr, view->window, WMColorGC(scrPtr->black), tx = (view->size.width - tw) / 2;
drawTitle = True;
} else {
drawTitle = False;
}
/* XClearArea(scrPtr->display, view->window, x, y, width, height, False);
*/
{
XRectangle rect;
Region region, tmp;
GC gc[4];
int i;
region = XCreateRegion();
if (drawTitle) {
tmp = XCreateRegion();
rect.x = tx;
rect.y = ty;
rect.width = tw;
rect.height = th;
XUnionRectWithRegion(&rect, tmp, tmp);
}
rect.x = 0;
rect.y = 0;
rect.width = view->size.width;
rect.height = view->size.height;
XUnionRectWithRegion(&rect, region, region);
if (drawTitle) {
XSubtractRegion(region, tmp, region);
XDestroyRegion(tmp);
}
gc[0] = WMColorGC(scrPtr->black);
gc[1] = WMColorGC(scrPtr->darkGray);
gc[2] = WMColorGC(scrPtr->gray);
gc[3] = WMColorGC(scrPtr->white);
for (i = 0; i < 4; i++) {
XSetRegion(scrPtr->display, gc[i], region);
}
XDestroyRegion(region);
W_DrawReliefWithGC(scrPtr, view->window, 0, fy, view->size.width, fh,
fPtr->flags.relief, gc[0], gc[1], gc[2], gc[3]);
for (i = 0; i < 4; i++) {
XSetClipMask(scrPtr->display, gc[i], None);
}
}
if (drawTitle) {
WMDrawString(scrPtr, view->window, WMColorGC(scrPtr->black),
scrPtr->normalFont, tx, ty, fPtr->caption, scrPtr->normalFont, tx, ty, fPtr->caption,
strlen(fPtr->caption)); strlen(fPtr->caption));
} }
@@ -163,9 +203,8 @@ handleEvents(XEvent *event, void *data)
switch (event->type) { switch (event->type) {
case Expose: case Expose:
if (event->xexpose.count!=0) if (event->xexpose.count == 0)
break; paintFrame(fPtr);
paintFrame(fPtr);
break; break;
case DestroyNotify: case DestroyNotify:

View File

@@ -8,6 +8,17 @@
void void
W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width, W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
unsigned int height, WMReliefType relief) unsigned int height, WMReliefType relief)
{
W_DrawReliefWithGC(scr, d, x, y, width, height, relief,
WMColorGC(scr->black), WMColorGC(scr->darkGray),
WMColorGC(scr->gray), WMColorGC(scr->white));
}
void
W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
unsigned int height, WMReliefType relief,
GC black, GC dark, GC light, GC white)
{ {
Display *dpy = scr->display; Display *dpy = scr->display;
GC bgc; GC bgc;
@@ -17,37 +28,36 @@ W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
switch (relief) { switch (relief) {
case WRSimple: case WRSimple:
XDrawRectangle(dpy, d, WMColorGC(scr->black), x, y, width-1, height-1); XDrawRectangle(dpy, d, black, x, y, width-1, height-1);
return; return;
break;
case WRRaised: case WRRaised:
bgc = WMColorGC(scr->black); bgc = black;
dgc = WMColorGC(scr->darkGray); dgc = dark;
wgc = WMColorGC(scr->white); wgc = white;
lgc = WMColorGC(scr->gray); lgc = light;
break; break;
case WRSunken: case WRSunken:
wgc = WMColorGC(scr->darkGray); wgc = dark;
lgc = WMColorGC(scr->black); lgc = black;
bgc = WMColorGC(scr->white); bgc = white;
dgc = WMColorGC(scr->gray); dgc = light;
break; break;
case WRPushed: case WRPushed:
lgc = wgc = WMColorGC(scr->black); lgc = wgc = black;
dgc = bgc = WMColorGC(scr->white); dgc = bgc = white;
break; break;
case WRRidge: case WRRidge:
lgc = bgc = WMColorGC(scr->darkGray); lgc = bgc = dark;
dgc = wgc = WMColorGC(scr->white); dgc = wgc = white;
break; break;
case WRGroove: case WRGroove:
wgc = dgc = WMColorGC(scr->darkGray); wgc = dgc = dark;
lgc = bgc = WMColorGC(scr->white); lgc = bgc = white;
break; break;
default: default:
@@ -77,6 +87,8 @@ W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
} }
static int static int
fitText(char *text, WMFont *font, int width, int wrap) fitText(char *text, WMFont *font, int width, int wrap)
{ {

View File

@@ -69,6 +69,50 @@ testFontPanel(WMScreen *scr)
void
testFrame(WMScreen *scr)
{
WMWindow *win;
WMFrame *frame;
int i;
static char* titles[] = {
"AboveTop",
"AtTop",
"BelowTop",
"AboveBottom",
"AtBottom",
"BelowBottom"
};
static WMTitlePosition pos[] = {
WTPAboveTop,
WTPAtTop,
WTPBelowTop,
WTPAboveBottom,
WTPAtBottom,
WTPBelowBottom
};
windowCount++;
win = WMCreateWindow(scr, "testFrame");
WMSetWindowTitle(win, "Frame");
WMSetWindowCloseAction(win, closeAction, NULL);
WMResizeWidget(win, 400, 300);
for (i = 0; i < 6; i++) {
frame = WMCreateFrame(win);
WMMoveWidget(frame, 8+(i%3)*130, 8+(i/3)*130);
WMResizeWidget(frame, 120, 120);
WMSetFrameTitle(frame, titles[i]);
WMSetFrameTitlePosition(frame, pos[i]);
}
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
}
void void
testList(WMScreen *scr) testList(WMScreen *scr)
{ {
@@ -812,8 +856,7 @@ Bool performDragOperation(WMView *self, WMDraggingInfo *info,
void concludeDragOperation(WMView *self, WMDraggingInfo *info) void concludeDragOperation(WMView *self, WMDraggingInfo *info)
{ {
puts("concluded");
} }
@@ -955,7 +998,7 @@ int main(int argc, char **argv)
* Do NOT use it unless when debugging. It will cause a major * Do NOT use it unless when debugging. It will cause a major
* slowdown in your application * slowdown in your application
*/ */
#ifdef DEBUG #if 1
XSynchronize(dpy, True); XSynchronize(dpy, True);
#endif #endif
/* /*
@@ -978,12 +1021,15 @@ int main(int argc, char **argv)
* *
* Put the testSomething() function you want to test here. * Put the testSomething() function you want to test here.
*/ */
testDragAndDrop(scr);
testDragAndDrop(scr);
#if 0
testFrame(scr);
testDragAndDrop(scr);
testDragAndDrop(scr);
#if 0
testColorWell(scr); testColorWell(scr);
testTabView(scr); testTabView(scr);

View File

@@ -51,8 +51,9 @@ showData(_Panel *panel)
WMSetButtonSelected(panel->swi[1], WMGetUDBoolForKey(udb, "NoXSetStuff")); WMSetButtonSelected(panel->swi[1], WMGetUDBoolForKey(udb, "NoXSetStuff"));
WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit")); WMSetButtonSelected(panel->swi[2], GetBoolForKey("SaveSessionOnExit"));
WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders")); WMSetButtonSelected(panel->swi[3], GetBoolForKey("UseSaveUnders"));
WMSetButtonSelected(panel->swi[4], GetBoolForKey("DisableBlinking")); WMSetButtonSelected(panel->swi[4], GetBoolForKey("WindowsCycling"));
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill")); WMSetButtonSelected(panel->swi[5], GetBoolForKey("DontConfirmKill"));
WMSetButtonSelected(panel->swi[6], GetBoolForKey("DisableBlinking"));
} }
@@ -66,7 +67,7 @@ createPanel(Panel *p)
WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT); WMResizeWidget(panel->frame, FRAME_WIDTH, FRAME_HEIGHT);
WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP); WMMoveWidget(panel->frame, FRAME_LEFT, FRAME_TOP);
for (i=0; i<6; i++) { for (i=0; i<7; i++) {
panel->swi[i] = WMCreateSwitchButton(panel->frame); panel->swi[i] = WMCreateSwitchButton(panel->frame);
WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25); WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
WMMoveWidget(panel->swi[i], 20, 20+i*25); WMMoveWidget(panel->swi[i], 20, 20+i*25);
@@ -76,8 +77,9 @@ createPanel(Panel *p)
WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)")); WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)"));
WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker")); WMSetButtonText(panel->swi[2], _("Automatically save session when exiting WindowMaker"));
WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects")); WMSetButtonText(panel->swi[3], _("Use SaveUnder in window frames, icons, menus and other objects"));
WMSetButtonText(panel->swi[4], _("Disable cycling color highlighting of icons.")); WMSetButtonText(panel->swi[4], _("Use Windoze style cycling"));
WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command.")); WMSetButtonText(panel->swi[5], _("Disable confirmation panel for the Kill command"));
WMSetButtonText(panel->swi[6], _("Disable cycling color highlighting of icons"));
WMRealizeWidget(panel->frame); WMRealizeWidget(panel->frame);
WMMapSubwidgets(panel->frame); WMMapSubwidgets(panel->frame);
@@ -97,8 +99,9 @@ storeDefaults(_Panel *panel)
SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit"); SetBoolForKey(WMGetButtonSelected(panel->swi[2]), "SaveSessionOnExit");
SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders"); SetBoolForKey(WMGetButtonSelected(panel->swi[3]), "UseSaveUnders");
SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DisableBlinking"); SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "WindowsCycling");
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill"); SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DontConfirmKill");
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "DisableBlinking");
} }

View File

@@ -746,22 +746,6 @@ dnl End of Graphic Format Libraries
dnl ============================================== dnl ==============================================
dnl Debugging setup
dnl ===============
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging ],, enable_debug=no)
if test "$enable_debug" = yes; then
DFLAGS="-g -DDEBUG"
# Efence makes things too slow. Add it by hand in the Makefiles
# if it is really needed.
# AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
else
DFLAGS="-DWITHOUT_NANA"
fi
AC_SUBST(DFLAGS)
dnl Sound support - Dan dnl Sound support - Dan
dnl ============================================= dnl =============================================
sound=yes sound=yes

1256
po/fi.po

File diff suppressed because it is too large Load Diff

View File

@@ -24,6 +24,7 @@ wmaker_SOURCES = \
client.c \ client.c \
client.h \ client.h \
colormap.c \ colormap.c \
cycling.c \
def_pixmaps.h \ def_pixmaps.h \
defaults.c \ defaults.c \
defaults.h \ defaults.h \

View File

@@ -103,7 +103,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 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 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 cycling.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,9 +126,9 @@ X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@ 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 cycling.o defaults.o dialog.o dock.o dockedapp.o \
framewin.o geomview.o gnome.o icon.o kwm.o main.o menu.o misc.o motif.o \ event.o framewin.o geomview.o gnome.o icon.o kwm.o main.o menu.o misc.o \
moveres.o openlook.o pixmap.o placement.o plugin.o properties.o \ motif.o moveres.o openlook.o pixmap.o placement.o plugin.o properties.o \
proplist.o resources.o rootmenu.o screen.o session.o shutdown.o \ proplist.o resources.o rootmenu.o screen.o session.o shutdown.o \
stacking.o startup.o superfluous.o switchmenu.o texture.o usermenu.o \ stacking.o startup.o superfluous.o switchmenu.o texture.o usermenu.o \
xdnd.o xmodifier.o xutil.o wcore.o wdefaults.o window.o winmenu.o \ xdnd.o xmodifier.o xutil.o wcore.o wdefaults.o window.o winmenu.o \

View File

@@ -308,6 +308,7 @@ typedef struct WPreferences {
char constrain_window_size; /* don't let windows get bigger than char constrain_window_size; /* don't let windows get bigger than
* screen */ * screen */
char windows_cycling; /* windoze cycling */
char circ_raise; /* raise window after Alt-tabbing */ char circ_raise; /* raise window after Alt-tabbing */
char ignore_focus_click; char ignore_focus_click;
@@ -426,6 +427,7 @@ typedef struct WPreferences {
unsigned int noupdates:1; /* don't require ~/GNUstep (-static) */ unsigned int noupdates:1; /* don't require ~/GNUstep (-static) */
unsigned int noautolaunch:1; /* don't autolaunch apps */ unsigned int noautolaunch:1; /* don't autolaunch apps */
unsigned int norestore:1; /* don't restore session */ unsigned int norestore:1; /* don't restore session */
unsigned int createstdcmap:1; /* create std colormap */
} flags; /* internal flags */ } flags; /* internal flags */
} WPreferences; } WPreferences;

312
src/cycling.c Normal file
View File

@@ -0,0 +1,312 @@
/* cycling.c- window cycling
*
* Window Maker window manager
*
* Copyright (c) 2000 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include "wconfig.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "WindowMaker.h"
#include "GNUstep.h"
#include "screen.h"
#include "wcore.h"
#include "window.h"
#include "framewin.h"
#include "keybind.h"
#include "actions.h"
#include "stacking.h"
#include "funcs.h"
/* Globals */
extern WPreferences wPreferences;
extern WShortKey wKeyBindings[WKBD_LAST];
static WWindow*
nextToFocusAfter(WWindow *wwin)
{
WWindow *tmp = wwin->prev;
while (tmp) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->prev;
}
tmp = wwin;
/* start over from the beginning of the list */
while (tmp->next)
tmp = tmp->next;
while (tmp && tmp != wwin) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->prev;
}
return wwin;
}
static WWindow*
nextToFocusBefore(WWindow *wwin)
{
WWindow *tmp = wwin->next;
while (tmp) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->next;
}
/* start over from the beginning of the list */
tmp = wwin;
while (tmp->prev)
tmp = tmp->prev;
while (tmp && tmp != wwin) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->next;
}
return wwin;
}
void
StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
{
WScreen *scr = wScreenForRootWindow(event->xkey.root);
Bool done = False;
Bool openedSwitchMenu = False;
WWindow *newFocused;
WWindow *oldFocused;
int modifiers;
XModifierKeymap *keymap;
Bool somethingElse = False;
XEvent ev;
if (!wwin)
return;
keymap = XGetModifierMapping(dpy);
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync,
CurrentTime);
if (next) {
newFocused = nextToFocusAfter(wwin);
} else {
newFocused = nextToFocusBefore(wwin);
}
scr->flags.doing_alt_tab = 1;
if (wPreferences.circ_raise)
XRaiseWindow(dpy, newFocused->frame->core->window);
wWindowFocus(newFocused, scr->focused_window);
oldFocused = newFocused;
#if 0
if (wPreferences.popup_switchmenu &&
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
openedSwitchMenu = True;
}
#endif
while (!done) {
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
if (ev.type != KeyRelease && ev.type != KeyPress) {
WMHandleEvent(&ev);
continue;
}
/* ignore CapsLock */
modifiers = ev.xkey.state & ValidModMask;
if (ev.type == KeyPress) {
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = nextToFocusAfter(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
if (wPreferences.circ_raise) {
/* restore order */
CommitStacking(scr);
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = nextToFocusBefore(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
if (wPreferences.circ_raise) {
/* restore order */
CommitStacking(scr);
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else {
somethingElse = True;
done = True;
}
} else if (ev.type == KeyRelease) {
int i;
for (i = 0; i < 8 * keymap->max_keypermod; i++) {
if (keymap->modifiermap[i] == ev.xkey.keycode &&
wKeyBindings[WKBD_FOCUSNEXT].modifier
& 1<<(i/keymap->max_keypermod)) {
done = True;
break;
}
}
}
}
XFreeModifiermap(keymap);
XUngrabKeyboard(dpy, CurrentTime);
wSetFocusTo(scr, newFocused);
if (wPreferences.circ_raise) {
wRaiseFrame(newFocused->frame->core);
CommitStacking(scr);
}
scr->flags.doing_alt_tab = 0;
if (openedSwitchMenu)
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
if (somethingElse) {
WMHandleEvent(&ev);
}
}
static WWindow*
nextFocusWindow(WScreen *scr)
{
WWindow *tmp, *wwin, *closest, *min;
Window d;
if (!(wwin = scr->focused_window))
return NULL;
tmp = wwin->prev;
closest = NULL;
min = wwin;
d = 0xffffffff;
while (tmp) {
if (wWindowCanReceiveFocus(tmp)
&& (!WFLAGP(tmp, skip_window_list)|| tmp->flags.internal_window)) {
if (min->client_win > tmp->client_win)
min = tmp;
if (tmp->client_win > wwin->client_win
&& (!closest
|| (tmp->client_win - wwin->client_win) < d)) {
closest = tmp;
d = tmp->client_win - wwin->client_win;
}
}
tmp = tmp->prev;
}
if (!closest||closest==wwin)
return min;
return closest;
}
static WWindow*
prevFocusWindow(WScreen *scr)
{
WWindow *tmp, *wwin, *closest, *max;
Window d;
if (!(wwin = scr->focused_window))
return NULL;
tmp = wwin->prev;
closest = NULL;
max = wwin;
d = 0xffffffff;
while (tmp) {
if (wWindowCanReceiveFocus(tmp) &&
(!WFLAGP(tmp, skip_window_list) || tmp->flags.internal_window)) {
if (max->client_win < tmp->client_win)
max = tmp;
if (tmp->client_win < wwin->client_win
&& (!closest
|| (wwin->client_win - tmp->client_win) < d)) {
closest = tmp;
d = wwin->client_win - tmp->client_win;
}
}
tmp = tmp->prev;
}
if (!closest||closest==wwin)
return max;
return closest;
}
void CycleWindow(WScreen *scr, Bool forward)
{
WWindow *wwin;
if (forward)
wwin = nextFocusWindow(scr);
else
wwin = prevFocusWindow(scr);
if (wwin != NULL)
wSetFocusTo(scr, wwin);
}

View File

@@ -405,6 +405,9 @@ WDefaultEntry optionList[] = {
{"RaiseDelay", "0", NULL, {"RaiseDelay", "0", NULL,
&wPreferences.raise_delay, getInt, NULL &wPreferences.raise_delay, getInt, NULL
}, },
{"WindowsCycling", "YES", NULL,
&wPreferences.windows_cycling,getBool, NULL
},
{"CirculateRaise", "NO", NULL, {"CirculateRaise", "NO", NULL,
&wPreferences.circ_raise, getBool, NULL &wPreferences.circ_raise, getBool, NULL
}, },
@@ -825,14 +828,14 @@ WDefaultEntry optionList[] = {
}, },
{"WaitCursor", "(builtin, watch)", (void*)WCUR_WAIT, {"WaitCursor", "(builtin, watch)", (void*)WCUR_WAIT,
NULL, getCursor, setCursor NULL, getCursor, setCursor
} },
,{"ArrowCursor", "(builtin, top_left_arrow)", (void*)WCUR_ARROW, {"ArrowCursor", "(builtin, top_left_arrow)", (void*)WCUR_ARROW,
NULL, getCursor, setCursor NULL, getCursor, setCursor
} },
,{"QuestionCursor", "(builtin, question_arrow)", (void*)WCUR_QUESTION, {"QuestionCursor", "(builtin, question_arrow)", (void*)WCUR_QUESTION,
NULL, getCursor, setCursor NULL, getCursor, setCursor
} },
,{"TextCursor", "(builtin, xterm)", (void*)WCUR_TEXT, {"TextCursor", "(builtin, xterm)", (void*)WCUR_TEXT,
NULL, getCursor, setCursor NULL, getCursor, setCursor
} }
#endif #endif
@@ -2541,20 +2544,19 @@ static WCursorLookup cursor_table[] =
static void check_bitmap_status(int status, char *filename, Pixmap bitmap) static void check_bitmap_status(int status, char *filename, Pixmap bitmap)
{ {
switch(status) switch(status) {
{
case BitmapOpenFailed: case BitmapOpenFailed:
wwarning(_("failed to open bitmap file \"%s\""), filename); wwarning(_("failed to open bitmap file \"%s\""), filename);
break; break;
case BitmapFileInvalid: case BitmapFileInvalid:
wwarning(_("\"%s\" is not a valid bitmap file"), filename); wwarning(_("\"%s\" is not a valid bitmap file"), filename);
break; break;
case BitmapNoMemory: case BitmapNoMemory:
wwarning(_("out of memory reading bitmap file \"%s\""), filename); wwarning(_("out of memory reading bitmap file \"%s\""), filename);
break; break;
case BitmapSuccess: case BitmapSuccess:
XFreePixmap(dpy, bitmap); XFreePixmap(dpy, bitmap);
break; break;
} }
} }
@@ -2565,172 +2567,147 @@ static void check_bitmap_status(int status, char *filename, Pixmap bitmap)
*/ */
static int parse_cursor(WScreen *scr, proplist_t pl, Cursor *cursor) static int parse_cursor(WScreen *scr, proplist_t pl, Cursor *cursor)
{ {
proplist_t elem; proplist_t elem;
char *val; char *val;
int nelem; int nelem;
int status = 0; int status = 0;
nelem = PLGetNumberOfElements(pl); nelem = PLGetNumberOfElements(pl);
if (nelem < 1) if (nelem < 1) {
{ return(status);
return(status);
} }
elem = PLGetArrayElement(pl, 0); elem = PLGetArrayElement(pl, 0);
if (!elem || !PLIsString(elem)) if (!elem || !PLIsString(elem)) {
{ return(status);
return(status);
} }
val = PLGetString(elem); val = PLGetString(elem);
if (0 == strcasecmp(val, "none")) if (0 == strcasecmp(val, "none")) {
{ status = 1;
status = 1; *cursor = None;
*cursor = None; } else if (0 == strcasecmp(val, "builtin")) {
} int i;
else if (0 == strcasecmp(val, "builtin")) int cursor_id = CURSOR_ID_NONE;
{
int i; if (2 != nelem) {
int cursor_id = CURSOR_ID_NONE; wwarning(_("bad number of arguments in cursor specification"));
return(status);
if (2 != nelem)
{
wwarning(_("bad number of arguments in cursor specification"));
return(status);
} }
elem = PLGetArrayElement(pl, 1); elem = PLGetArrayElement(pl, 1);
if (!elem || !PLIsString(elem)) if (!elem || !PLIsString(elem)) {
{ return(status);
return(status);
} }
val = PLGetString(elem); val = PLGetString(elem);
for (i = 0; NULL != cursor_table[i].name; i++) for (i = 0; NULL != cursor_table[i].name; i++) {
{ if (0 == strcasecmp(val, cursor_table[i].name)) {
if (0 == strcasecmp(val, cursor_table[i].name)) cursor_id = cursor_table[i].id;
{ break;
cursor_id = cursor_table[i].id;
break;
} }
} }
if (CURSOR_ID_NONE == cursor_id) if (CURSOR_ID_NONE == cursor_id) {
{ wwarning(_("unknown builtin cursor name \"%s\""), val);
wwarning(_("unknown builtin cursor name \"%s\""), val); } else {
*cursor = XCreateFontCursor(dpy, cursor_id);
status = 1;
} }
else } else if (0 == strcasecmp(val, "bitmap")) {
{ char *bitmap_name;
*cursor = XCreateFontCursor(dpy, cursor_id); char *mask_name;
status = 1; int bitmap_status;
int mask_status;
Pixmap bitmap;
Pixmap mask;
unsigned int w, h;
int x, y;
XColor fg, bg;
if (3 != nelem) {
wwarning(_("bad number of arguments in cursor specification"));
return(status);
} }
elem = PLGetArrayElement(pl, 1);
if (!elem || !PLIsString(elem)) {
return(status);
}
val = PLGetString(elem);
bitmap_name = FindImage(wPreferences.pixmap_path, val);
if (!bitmap_name) {
wwarning(_("could not find cursor bitmap file \"%s\""), val);
return(status);
}
elem = PLGetArrayElement(pl, 2);
if (!elem || !PLIsString(elem)) {
free(bitmap_name);
return(status);
}
val = PLGetString(elem);
mask_name = FindImage(wPreferences.pixmap_path, val);
if (!mask_name) {
free(bitmap_name);
wwarning(_("could not find cursor bitmap file \"%s\""), val);
return(status);
}
mask_status = XReadBitmapFile(dpy, scr->w_win, mask_name, &w, &h,
&mask, &x, &y);
bitmap_status = XReadBitmapFile(dpy, scr->w_win, bitmap_name, &w, &h,
&bitmap, &x, &y);
if ((BitmapSuccess == bitmap_status) &&
(BitmapSuccess == mask_status)) {
fg.pixel = scr->black_pixel;
bg.pixel = scr->white_pixel;
XQueryColor(dpy, scr->w_colormap, &fg);
XQueryColor(dpy, scr->w_colormap, &bg);
*cursor = XCreatePixmapCursor(dpy, bitmap, mask, &fg, &bg, x, y);
status = 1;
}
check_bitmap_status(bitmap_status, bitmap_name, bitmap);
check_bitmap_status(mask_status, mask_name, mask);
free(bitmap_name);
free(mask_name);
} }
else if (0 == strcasecmp(val, "bitmap")) return(status);
{
char *bitmap_name;
char *mask_name;
int bitmap_status;
int mask_status;
Pixmap bitmap;
Pixmap mask;
unsigned int w, h;
int x, y;
XColor fg, bg;
if (3 != nelem)
{
wwarning(_("bad number of arguments in cursor specification"));
return(status);
}
elem = PLGetArrayElement(pl, 1);
if (!elem || !PLIsString(elem))
{
return(status);
}
val = PLGetString(elem);
bitmap_name = FindImage(wPreferences.pixmap_path, val);
if (!bitmap_name)
{
wwarning(_("could not find cursor bitmap file \"%s\""), val);
return(status);
}
elem = PLGetArrayElement(pl, 2);
if (!elem || !PLIsString(elem))
{
free(bitmap_name);
return(status);
}
val = PLGetString(elem);
mask_name = FindImage(wPreferences.pixmap_path, val);
if (!mask_name)
{
free(bitmap_name);
wwarning(_("could not find cursor bitmap file \"%s\""), val);
return(status);
}
mask_status = XReadBitmapFile(dpy, scr->w_win, mask_name, &w, &h,
&mask, &x, &y);
bitmap_status = XReadBitmapFile(dpy, scr->w_win, bitmap_name, &w, &h,
&bitmap, &x, &y);
if ((BitmapSuccess == bitmap_status) &&
(BitmapSuccess == mask_status))
{
fg.pixel = scr->black_pixel;
bg.pixel = scr->white_pixel;
XQueryColor(dpy, scr->w_colormap, &fg);
XQueryColor(dpy, scr->w_colormap, &bg);
*cursor = XCreatePixmapCursor(dpy, bitmap, mask, &fg, &bg, x, y);
status = 1;
}
check_bitmap_status(bitmap_status, bitmap_name, bitmap);
check_bitmap_status(mask_status, mask_name, mask);
free(bitmap_name);
free(mask_name);
}
return(status);
} }
static int static int
getCursor(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr, getCursor(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
void **ret) void **ret)
{ {
static Cursor cursor; static Cursor cursor;
int status; int status;
int changed = 0; int changed = 0;
again: again:
if (!PLIsArray(value)) if (!PLIsArray(value)) {
{ wwarning(_("Wrong option format for key \"%s\". Should be %s."),
wwarning(_("Wrong option format for key \"%s\". Should be %s."), entry->key, "cursor specification");
entry->key, "cursor specification"); if (!changed) {
if (!changed) value = entry->plvalue;
{ changed = 1;
value = entry->plvalue; wwarning(_("using default \"%s\" instead"), entry->default_value);
changed = 1; goto again;
wwarning(_("using default \"%s\" instead"), entry->default_value);
goto again;
} }
return(False); return(False);
} }
status = parse_cursor(scr, value, &cursor); status = parse_cursor(scr, value, &cursor);
if (!status) if (!status) {
{ wwarning(_("Error in cursor specification for key \"%s\""), entry->key);
wwarning(_("Error in cursor specification for key \"%s\""), entry->key); if (!changed) {
if (!changed) value = entry->plvalue;
{ changed = 1;
value = entry->plvalue; wwarning(_("using default \"%s\" instead"), entry->default_value);
changed = 1; goto again;
wwarning(_("using default \"%s\" instead"), entry->default_value);
goto again;
} }
return(False); return(False);
} }
if (ret) if (ret) {
{ *ret = &cursor;
*ret = &cursor;
} }
if (addr) if (addr) {
{ *(Cursor *)addr = cursor;
*(Cursor *)addr = cursor;
} }
return(True); return(True);
} }
#undef CURSOR_ID_NONE #undef CURSOR_ID_NONE
@@ -2739,7 +2716,7 @@ again:
/* ---------------- value setting functions --------------- */ /* ---------------- value setting functions --------------- */
static int static int
setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo) setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
{ {
return REFRESH_WINDOW_TITLE_COLOR; return REFRESH_WINDOW_TITLE_COLOR;
} }

View File

@@ -1303,131 +1303,6 @@ windowUnderPointer(WScreen *scr)
static void
doWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
{
WScreen *scr = wScreenForRootWindow(event->xkey.root);
Bool done = False;
Bool openedSwitchMenu = False;
WWindow *newFocused;
WWindow *oldFocused;
int modifiers;
XModifierKeymap *keymap;
Bool somethingElse = False;
XEvent ev;
if (!wwin)
return;
keymap = XGetModifierMapping(dpy);
XGrabKeyboard(dpy, scr->root_win, False, GrabModeAsync, GrabModeAsync,
CurrentTime);
if (next) {
newFocused = NextToFocusAfter(wwin);
} else {
newFocused = NextToFocusBefore(wwin);
}
scr->flags.doing_alt_tab = 1;
if (wPreferences.circ_raise)
XRaiseWindow(dpy, newFocused->frame->core->window);
wWindowFocus(newFocused, scr->focused_window);
oldFocused = newFocused;
#if 0
if (wPreferences.popup_switchmenu &&
(!scr->switch_menu || !scr->switch_menu->flags.mapped)) {
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
openedSwitchMenu = True;
}
#endif
while (!done) {
WMMaskEvent(dpy,KeyPressMask|KeyReleaseMask|ExposureMask, &ev);
if (ev.type != KeyRelease && ev.type != KeyPress) {
WMHandleEvent(&ev);
continue;
}
/* ignore CapsLock */
modifiers = ev.xkey.state & ValidModMask;
if (ev.type == KeyPress) {
if (wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = NextToFocusAfter(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
if (wPreferences.circ_raise) {
/* restore order */
CommitStacking(scr);
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else if (wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSPREV].modifier == modifiers) {
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
newFocused = NextToFocusBefore(newFocused);
wWindowFocus(newFocused, oldFocused);
oldFocused = newFocused;
if (wPreferences.circ_raise) {
/* restore order */
CommitStacking(scr);
XRaiseWindow(dpy, newFocused->frame->core->window);
}
UpdateSwitchMenu(scr, newFocused, ACTION_CHANGE_STATE);
} else {
somethingElse = True;
done = True;
}
} else if (ev.type == KeyRelease) {
int i;
for (i = 0; i < 8 * keymap->max_keypermod; i++) {
if (keymap->modifiermap[i] == ev.xkey.keycode &&
wKeyBindings[WKBD_FOCUSNEXT].modifier
& 1<<(i/keymap->max_keypermod)) {
done = True;
break;
}
}
}
}
XFreeModifiermap(keymap);
XUngrabKeyboard(dpy, CurrentTime);
wSetFocusTo(scr, newFocused);
if (wPreferences.circ_raise) {
wRaiseFrame(newFocused->frame->core);
CommitStacking(scr);
}
scr->flags.doing_alt_tab = 0;
if (openedSwitchMenu)
OpenSwitchMenu(scr, scr->scr_width/2, scr->scr_height/2, False);
if (somethingElse) {
handleKeyPress(&ev);
}
}
static void static void
handleKeyPress(XEvent *event) handleKeyPress(XEvent *event)
{ {
@@ -1598,17 +1473,19 @@ handleKeyPress(XEvent *event)
} }
break; break;
case WKBD_FOCUSNEXT: case WKBD_FOCUSNEXT:
if (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0) if (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0
doWindozeCycle(wwin, event, True); && wPreferences.windows_cycling)
StartWindozeCycle(wwin, event, True);
else else
puts("NEXT"); CycleWindow(scr, True);
break; break;
case WKBD_FOCUSPREV: case WKBD_FOCUSPREV:
if (wKeyBindings[WKBD_FOCUSPREV].modifier != 0) if (wKeyBindings[WKBD_FOCUSPREV].modifier != 0
doWindozeCycle(wwin, event, False); && wPreferences.windows_cycling)
StartWindozeCycle(wwin, event, False);
else else
puts("PREV"); CycleWindow(scr, False);
break; break;
#if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP) #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)

View File

@@ -94,6 +94,11 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret);
void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned int width, unsigned int height); unsigned int width, unsigned int height);
void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next);
void CycleWindow(WScreen *scr, Bool forward);
#ifdef USECPP #ifdef USECPP
char *MakeCPPArgs(char *path); char *MakeCPPArgs(char *path);
#endif #endif

View File

@@ -202,64 +202,6 @@ MakeCPPArgs(char *path)
WWindow*
NextToFocusAfter(WWindow *wwin)
{
WWindow *tmp = wwin->prev;
while (tmp) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->prev;
}
tmp = wwin;
/* start over from the beginning of the list */
while (tmp->next)
tmp = tmp->next;
while (tmp && tmp != wwin) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->prev;
}
return wwin;
}
WWindow*
NextToFocusBefore(WWindow *wwin)
{
WWindow *tmp = wwin->next;
while (tmp) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->next;
}
/* start over from the beginning of the list */
tmp = wwin;
while (tmp->prev)
tmp = tmp->prev;
while (tmp && tmp != wwin) {
if (wWindowCanReceiveFocus(tmp) && !WFLAGP(tmp, skip_window_list)) {
return tmp;
}
tmp = tmp->next;
}
return wwin;
}
#if 0 #if 0
/* /*
* Is win2 below win1? * Is win2 below win1?

View File

@@ -193,44 +193,3 @@ FormatXError(Display *dpy, XErrorEvent *error, char *buffer, int size)
sprintf(buffer, " Error serial: %li\n", error->serial); sprintf(buffer, " Error serial: %li\n", error->serial);
return; return;
} }
#if 0
/*
*----------------------------------------------------------------------
* GetSelection--
* Request for the current primary selection.
*----------------------------------------------------------------------
*/
void
RequestSelection(Display *dpy, Window requestor, Time timestamp)
{
if (!Clipboard)
Clipboard = XInternAtom(dpy, "CLIPBOARD", False);
XConvertSelection(dpy, XA_PRIMARY, XA_STRING, Clipboard, requestor,
timestamp);
}
char*
GetSelection(Display *dpy, Window requestor)
{
Atom rtype;
int bits;
unsigned long len, bytes;
unsigned char *data;
XGetWindowProperty(dpy, requestor, Clipboard,
0, MAXLINE/4, False, XA_STRING,
&rtype, &bits, &len, &bytes, &data);
if ((rtype!=XA_STRING) || (bits!=8)) {
wwarning(_("invalid data in selection"));
if (data) XFree(data);
return NULL;
} else {
return (char*)data;
}
}
#endif