diff -u -urN icewm-1.0.9.vanilla/src/.targets icewm-1.0.9/src/.targets --- icewm-1.0.9.vanilla/src/.targets Wed Dec 31 18:00:00 1969 +++ icewm-1.0.9/src/.targets Fri Jul 26 18:25:54 2002 @@ -0,0 +1,6 @@ +genpref: $(genpref_OBJS) +icewm: $(icewm_OBJS) +icesh: $(icesh_OBJS) +icewmhint: $(icewmhint_OBJS) +icewmbg: $(icewmbg_OBJS) +icehelp: $(icehelp_OBJS) diff -u -urN icewm-1.0.9.vanilla/src/bindkey.h icewm-1.0.9/src/bindkey.h --- icewm-1.0.9.vanilla/src/bindkey.h Tue Oct 9 09:54:03 2001 +++ icewm-1.0.9/src/bindkey.h Sun Aug 4 09:43:46 2002 @@ -69,6 +69,8 @@ #define defgKeySysMinimizeAll XK_F9, kfAlt+kfShift, "Alt+Shift+F9" #define defgKeySysHideAll XK_F11, kfAlt+kfShift, "Alt+Shift+F11" #define defgKeySysUndoArrange XK_F12, kfAlt+kfShift, "Alt+Shift+F12" +#define defgKeySysScreenPrev XK_Left, kfAlt, "Alt+Left" +#define defgKeySysScreenNext XK_Right, kfAlt, "Alt+Right" #ifdef NO_KEYBIND @@ -168,6 +170,8 @@ DEF_WMKEY(gKeySysMinimizeAll); DEF_WMKEY(gKeySysHideAll); DEF_WMKEY(gKeySysUndoArrange); +DEF_WMKEY(gKeySysScreenPrev); +DEF_WMKEY(gKeySysScreenNext); #undef DEF_WMKEY diff -u -urN icewm-1.0.9.vanilla/src/config.h icewm-1.0.9/src/config.h --- icewm-1.0.9.vanilla/src/config.h Tue Oct 9 09:54:29 2001 +++ icewm-1.0.9/src/config.h Fri Jul 26 18:24:32 2002 @@ -9,7 +9,7 @@ /* #undef HAVE__NL_MESSAGES_CODESET */ /* define how to query the current locale's codeset */ -#define CONFIG_NL_CODESETS _NL_MESSAGES_CODESET, _NL_CTYPE_CODESET_NAME, CODESET, 0 +/* #undef CONFIG_NL_CODESETS */ /* define when iconv is imported from GNU libiconv */ /* #undef CONFIG_LIBICONV */ @@ -51,7 +51,7 @@ /* #undef CONFIG_GUIEVENTS */ /* Define to enable internationalization */ -#define CONFIG_I18N 1 +/* #undef CONFIG_I18N */ /* Define to use Imlib for image rendering */ /* #undef CONFIG_IMLIB */ @@ -132,16 +132,16 @@ #define HAVE_GETTIMEOFDAY 1 /* Define if you have the `iconv' function. */ -#define HAVE_ICONV 1 +/* #undef HAVE_ICONV */ /* Define if you have the `iconv_close' function. */ -#define HAVE_ICONV_CLOSE 1 +/* #undef HAVE_ICONV_CLOSE */ /* Define if you have the header file. */ -#define HAVE_ICONV_H 1 +/* #undef HAVE_ICONV_H */ /* Define if you have the `iconv_open' function. */ -#define HAVE_ICONV_OPEN 1 +/* #undef HAVE_ICONV_OPEN */ /* Define if you have the header file. */ #define HAVE_INTTYPES_H 1 @@ -150,7 +150,7 @@ /* #undef HAVE_KSTAT_H */ /* Define if you have the header file. */ -#define HAVE_LANGINFO_H 1 +/* #undef HAVE_LANGINFO_H */ /* Define if you have the `esd' library (-lesd). */ /* #undef HAVE_LIBESD */ @@ -250,7 +250,7 @@ /* Define if you need an implementation of the allocation operators. (gcc 3.0) */ -#define NEED_ALLOC_OPERATORS 1 +/* #undef NEED_ALLOC_OPERATORS */ /* Define to disable preferences support. */ /* #undef NO_CONFIGURE */ diff -u -urN icewm-1.0.9.vanilla/src/debug.h icewm-1.0.9/src/debug.h --- icewm-1.0.9.vanilla/src/debug.h Tue Oct 9 09:54:03 2001 +++ icewm-1.0.9/src/debug.h Tue Jul 30 19:11:37 2002 @@ -1,6 +1,6 @@ #ifndef __DEBUG_H #define __DEBUG_H - +#define DEBUG #ifdef DEBUG extern bool debug; extern bool debug_z; diff -u -urN icewm-1.0.9.vanilla/src/default.h icewm-1.0.9/src/default.h --- icewm-1.0.9.vanilla/src/default.h Tue Oct 9 09:54:03 2001 +++ icewm-1.0.9/src/default.h Sun Aug 4 09:42:31 2002 @@ -215,6 +215,8 @@ XIV(bool, edgeHorzWorkspaceSwitching, false) XIV(bool, edgeVertWorkspaceSwitching, false) XIV(bool, edgeContWorkspaceSwitching, true) +XIV(bool, horzMonitorSwitching, true) +XIV(bool, vertMonitorSwitching, false) XIV(bool, showPopupsAbovePointer, false) XIV(bool, replayMenuCancelClick, false) XIV(bool, limitSize, true) @@ -542,6 +544,9 @@ OBV("HorizontalEdgeSwitch", &edgeHorzWorkspaceSwitching, "Workspace switches by moving mouse to left/right screen edge"), OBV("VerticalEdgeSwitch", &edgeVertWorkspaceSwitching, "Workspace switches by moving mouse to top/bottom screen edge"), OBV("ContinuousEdgeSwitch", &edgeContWorkspaceSwitching, "Workspace switches continuously when moving mouse to screen edge"), + OBV("MonitorSwitch", &horzMonitorSwitching, "In dual heads, use this option to have focus behave correctly"), + OBV("HorizontalMonitorSwitch", &horzMonitorSwitching, "In dual heads, use this option to have focus behave correctly"), + OBV("VerticalMonitorSwitch", &vertMonitorSwitching, "In dual heads, use this option to have focus behave correctly"), OBV("DesktopBackgroundCenter", ¢erBackground, "Display desktop background centered and not tiled"), OBV("SupportSemitransparency", &supportSemitransparency, "Support for semitransparent terminals like Eterm or gnome-terminal"), OBV("AutoReloadMenus", &autoReloadMenus, "Reload menu files automatically"), @@ -925,7 +930,9 @@ OKV("KeySysArrangeIcons", gKeySysArrangeIcons, ""), OKV("KeySysMinimizeAll", gKeySysMinimizeAll, ""), OKV("KeySysHideAll", gKeySysHideAll, ""), - OKV("KeySysUndoArrange", gKeySysUndoArrange, "") + OKV("KeySysUndoArrange", gKeySysUndoArrange, ""), + OKV("KeySysScreenPrev", gKeySysScreenPrev, ""), + OKV("KeySysScreenNext", gKeySysScreenNext, "") }; #endif diff -u -urN icewm-1.0.9.vanilla/src/movesize.cc icewm-1.0.9/src/movesize.cc --- icewm-1.0.9.vanilla/src/movesize.cc Tue Oct 9 09:54:03 2001 +++ icewm-1.0.9/src/movesize.cc Tue Jul 30 19:36:59 2002 @@ -16,6 +16,7 @@ #include + void YFrameWindow::snapTo(int &wx, int &wy, int rx1, int ry1, int rx2, int ry2, int &flags) { @@ -983,7 +984,7 @@ if (!isRollup() && !isIconic() && key.window != handle()) return true; - + MSG((".")); if (IS_WMKEY(k, vm, gKeyWinClose)) { if (canClose()) wmClose(); } else if (IS_WMKEY(k, vm, gKeyWinPrev)) { @@ -1014,7 +1015,7 @@ if (canRollup()) wmRollup(); } else if (IS_WMKEY(k, vm, gKeyWinMenu)) { popupSystemMenu(); - } + } if (isIconic() || isRollup()) { if (k == XK_Return || k == XK_KP_Enter) { wmRestore(); diff -u -urN icewm-1.0.9.vanilla/src/wmapp.cc icewm-1.0.9/src/wmapp.cc --- icewm-1.0.9.vanilla/src/wmapp.cc Tue Oct 9 09:54:03 2001 +++ icewm-1.0.9/src/wmapp.cc Sat Aug 3 19:25:49 2002 @@ -1250,6 +1250,10 @@ break; #endif + case SIGUSR2: + manager->setInputFocus(); + break; + default: YApplication::handleSignal(sig); break; @@ -1392,6 +1396,7 @@ initResourceManager(getpid()); #endif + app.catchSignal(SIGUSR2); initWorkspaces(); #ifndef NO_WINDOW_OPTIONS diff -u -urN icewm-1.0.9.vanilla/src/wmmgr.cc icewm-1.0.9/src/wmmgr.cc --- icewm-1.0.9.vanilla/src/wmmgr.cc Tue Oct 9 09:54:04 2001 +++ icewm-1.0.9/src/wmmgr.cc Sun Aug 4 09:37:49 2002 @@ -3,6 +3,9 @@ * * Copyright (C) 1997-2001 Marko Macek */ +#include +#include +#include #include "config.h" #include "yfull.h" #include "wmmgr.h" @@ -36,6 +39,7 @@ YAction *trayOptionActionSet[WinTrayOptionCount]; #endif + YWindowManager::YWindowManager(YWindow *parent, Window win): YDesktop(parent, win) { fShuttingDown = false; @@ -96,10 +100,30 @@ fTopSwitch = fBottomSwitch = 0; } + /* Setup shared memory for screen warp */ + numScreen = ScreenCount(app->display()); + screenID = DefaultScreen(app->display()); + shmKey = ftok(".", 'x'); + shmID = shmget(shmKey, sizeof(int) * numScreen, IPC_CREAT | 0666); + if (shmID < 0) { + printf("*** shmget error (server) ***\n"); + exit(1); + } + + shmFocus = (int *) shmat(shmID, NULL, 0); + if ((int) shmFocus == -1) { + printf("*** shmat error (server) ***\n"); + exit(1); + } + shmFocus[screenID] = getpid(); + MSG(("PID=%d\n", getpid())); YWindow::setWindowFocus(); } YWindowManager::~YWindowManager() { + /* Cleanup of shared memory for screen warp */ + shmdt((void *) shmFocus); + shmctl(shmID, IPC_RMID, NULL); } void YWindowManager::grabKeys() { @@ -164,6 +188,9 @@ GRAB_WMKEY(gKeySysMinimizeAll); GRAB_WMKEY(gKeySysHideAll); + GRAB_WMKEY(gKeySysScreenNext); + GRAB_WMKEY(gKeySysScreenPrev); + { KProgram *k = keyProgs; while (k) { @@ -339,7 +366,11 @@ } else if (IS_WMKEY(k, vm, gKeySysRun)) { if (runDlgCommand && runDlgCommand[0]) app->runCommand(runDlgCommand); - } else { + } else if (IS_WMKEY(k, vm, gKeySysScreenPrev)) { + screenPrev(); + } else if (IS_WMKEY(k, vm, gKeySysScreenNext)) { + screenNext(); + } else { KProgram *p = keyProgs; while (p) { //msg("%X=%X %X=%X", k, p->key(), vm, p->modifiers()); @@ -633,7 +664,10 @@ #endif if (input) { + int tmpInt = 0; XSetInputFocus(app->display(), w, RevertToNone, CurrentTime); + XGetInputFocus(app->display(), &oldWinFocus, &tmpInt); + MSG(("oldWinFocus=%p\n", &oldWinFocus)); } if (c && w == c->handle() && c->protocols() & YFrameClient::wpTakeFocus) { @@ -1714,8 +1748,10 @@ focusTopWindow(); } else { if (strongPointerFocus) { + int tmpInt = 0; XSetInputFocus(app->display(), PointerRoot, RevertToNone, CurrentTime); - + XGetInputFocus(app->display(), &oldWinFocus, &tmpInt); + MSG(("oldWinFocus=%p\n", &oldWinFocus)); } } resetColormap(true); @@ -2191,6 +2227,44 @@ } #endif +void +YWindowManager::screenNext() +{ + Window newFocus; + int newFocusID; + + newFocusID = (screenID + 1) % numScreen; + MSG(("screenNext: newFocusID=%d\n", newFocusID)); + newFocus = shmFocus[newFocusID]; + MSG(("screenNext: newFocus=%p\n", newFocus)); + /* send signal to other process to focus oldWinFocus */ + kill(newFocus, SIGUSR2); +} + +void +YWindowManager::screenPrev() +{ + Window newFocus; + int newFocusID; + + newFocusID = screenID - 1; + if (newFocusID < 0) + newFocusID = numScreen - 1; + newFocusID = newFocusID % numScreen; + MSG(("screenPrev: newFocusID=%d\n", newFocusID)); + newFocus = shmFocus[newFocusID]; + MSG(("screenPrev: newFocus=%d\n", newFocus)); + /* send signal to other process to focus oldWinFocus */ + kill(newFocus, SIGUSR2); +} + +void +YWindowManager::setInputFocus() +{ + XSetInputFocus(app->display(), oldWinFocus, RevertToNone, CurrentTime); + MSG(("setInputFocus=%p", &oldWinFocus)); +} + YTimer *EdgeSwitch::fEdgeSwitchTimer(NULL); EdgeSwitch::EdgeSwitch(YWindowManager *manager, int delta, bool vertical): diff -u -urN icewm-1.0.9.vanilla/src/wmmgr.h icewm-1.0.9/src/wmmgr.h --- icewm-1.0.9.vanilla/src/wmmgr.h Tue Oct 9 09:54:04 2001 +++ icewm-1.0.9/src/wmmgr.h Sun Aug 4 09:38:18 2002 @@ -198,6 +198,11 @@ void setTopLevelProcess(pid_t p); void removeLRUProcess(); #endif + + /* Screen Warp */ + void screenPrev(); + void screenNext(); + void setInputFocus(); private: struct WindowPosState { @@ -220,7 +225,14 @@ YProxyWindow *rootProxy; YWindow *fTopWin; bool fWorkAreaMoveWindows; - + + /* Variables for screen warp */ + key_t shmKey; + int shmID; + int *shmFocus; + int numScreen; + int screenID; + #ifdef CONFIG_WM_SESSION YStackSet fProcessList; #endif diff -u -urN icewm-1.0.9.vanilla/src/ywindow.cc icewm-1.0.9/src/ywindow.cc --- icewm-1.0.9.vanilla/src/ywindow.cc Tue Oct 9 09:54:04 2001 +++ icewm-1.0.9/src/ywindow.cc Fri Jul 26 18:25:18 2002 @@ -137,6 +137,7 @@ fParentWindow = desktop; } insertWindow(); + onOtherDisplay = true; } YWindow::~YWindow() { @@ -170,7 +171,9 @@ } void YWindow::setWindowFocus() { + int tmpInt = 0; XSetInputFocus(app->display(), handle(), RevertToNone, CurrentTime); + XGetInputFocus(app->display(), &oldWinFocus, &tmpInt); } void YWindow::setTitle(char const * title) { @@ -825,6 +828,18 @@ } } #endif + if (horzMonitorSwitching || vertMonitorSwitching) { + if (crossing.type == EnterNotify && crossing.mode == NotifyNormal) { + if (crossing.same_screen && !parent() && onOtherDisplay) { + XSetInputFocus(app->display(), oldWinFocus, RevertToNone, CurrentTime); + onOtherDisplay = false; + } + } + else if (crossing.type == LeaveNotify && crossing.mode == NotifyNormal) { + if (!crossing.same_screen && !parent()) + onOtherDisplay = true; + } + } } void YWindow::handleClientMessage(const XClientMessageEvent &message) { diff -u -urN icewm-1.0.9.vanilla/src/ywindow.h icewm-1.0.9/src/ywindow.h --- icewm-1.0.9.vanilla/src/ywindow.h Tue Oct 9 09:54:04 2001 +++ icewm-1.0.9/src/ywindow.h Fri Jul 26 18:25:18 2002 @@ -38,6 +38,8 @@ YWindow(YWindow *aParent = 0, Window win = 0); virtual ~YWindow(); + Window oldWinFocus; + void setStyle(unsigned long aStyle); void show(); @@ -241,6 +243,7 @@ bool fEnabled; bool fToplevel; + bool onOtherDisplay; typedef struct _YAccelerator { unsigned key; @@ -253,7 +256,7 @@ #ifdef CONFIG_TOOLTIP YToolTip *fToolTip; #endif - + static XButtonEvent fClickEvent; static YWindow *fClickWindow; static Time fClickTime;