mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
more bug fixes..
This commit is contained in:
@@ -26,6 +26,10 @@
|
|||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
// TODO: remove non-MOX_CYCLING junk
|
||||||
|
// fix the stacking/window raising during alt-tabbing
|
||||||
|
// allow selection of icons with mouse
|
||||||
|
|
||||||
#define MOX_CYCLING
|
#define MOX_CYCLING
|
||||||
|
|
||||||
#include "WindowMaker.h"
|
#include "WindowMaker.h"
|
||||||
@@ -190,13 +194,15 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
#ifdef MOX_CYCLING
|
#ifdef MOX_CYCLING
|
||||||
WSwitchPanel *swpanel = NULL;
|
WSwitchPanel *swpanel = NULL;
|
||||||
#endif
|
#endif
|
||||||
KeyCode leftKey, rightKey;
|
KeyCode leftKey, rightKey, homeKey, endKey;
|
||||||
|
|
||||||
if (!wwin)
|
if (!wwin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
leftKey = XKeysymToKeycode(dpy, XK_Left);
|
leftKey = XKeysymToKeycode(dpy, XK_Left);
|
||||||
rightKey = XKeysymToKeycode(dpy, XK_Right);
|
rightKey = XKeysymToKeycode(dpy, XK_Right);
|
||||||
|
homeKey = XKeysymToKeycode(dpy, XK_Home);
|
||||||
|
endKey = XKeysymToKeycode(dpy, XK_End);
|
||||||
|
|
||||||
if (next)
|
if (next)
|
||||||
hasModifier = (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0);
|
hasModifier = (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0);
|
||||||
@@ -307,6 +313,14 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||||
}
|
}
|
||||||
#endif /* !MOX_CYCLING */
|
#endif /* !MOX_CYCLING */
|
||||||
|
} else if (ev.xkey.keycode == homeKey || ev.xkey.keycode == endKey) {
|
||||||
|
if (swpanel) {
|
||||||
|
newFocused = wSwitchPanelSelectFirst(swpanel, ev.xkey.keycode != homeKey);
|
||||||
|
if (newFocused) {
|
||||||
|
wWindowFocus(newFocused, oldFocused);
|
||||||
|
oldFocused = newFocused;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (ev.type == MotionNotify) {
|
} else if (ev.type == MotionNotify) {
|
||||||
WWindow *tmp;
|
WWindow *tmp;
|
||||||
if (swpanel) {
|
if (swpanel) {
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ extern WPreferences wPreferences;
|
|||||||
|
|
||||||
static int canReceiveFocus(WWindow *wwin)
|
static int canReceiveFocus(WWindow *wwin)
|
||||||
{
|
{
|
||||||
|
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
||||||
|
return 0;
|
||||||
if (!wwin->flags.mapped)
|
if (!wwin->flags.mapped)
|
||||||
{
|
{
|
||||||
if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden)
|
if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden)
|
||||||
@@ -142,8 +144,6 @@ static int canReceiveFocus(WWindow *wwin)
|
|||||||
}
|
}
|
||||||
if (WFLAGP(wwin, no_focusable))
|
if (WFLAGP(wwin, no_focusable))
|
||||||
return 0;
|
return 0;
|
||||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
|
||||||
return 0;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +364,6 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
|
|||||||
|
|
||||||
WMMapSubwidgets(panel->win);
|
WMMapSubwidgets(panel->win);
|
||||||
WMRealizeWidget(panel->win);
|
WMRealizeWidget(panel->win);
|
||||||
WMMapWidget(panel->win);
|
|
||||||
{
|
{
|
||||||
WMPoint center;
|
WMPoint center;
|
||||||
|
|
||||||
@@ -376,7 +375,9 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
|
|||||||
panel->current= WMGetFirstInArray(panel->windows, curwin);
|
panel->current= WMGetFirstInArray(panel->windows, curwin);
|
||||||
if (panel->current >= 0)
|
if (panel->current >= 0)
|
||||||
changeImage(panel, panel->current, 1);
|
changeImage(panel, panel->current, 1);
|
||||||
|
|
||||||
|
WMMapWidget(panel->win);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,6 +434,32 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back)
|
||||||
|
{
|
||||||
|
WWindow *wwin;
|
||||||
|
int count = WMGetArrayItemCount(panel->windows);
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (panel->win)
|
||||||
|
changeImage(panel, panel->current, 0);
|
||||||
|
|
||||||
|
if (!back)
|
||||||
|
panel->current = count-1;
|
||||||
|
else
|
||||||
|
panel->current = 0;
|
||||||
|
|
||||||
|
wwin = WMGetFromArray(panel->windows, panel->current);
|
||||||
|
|
||||||
|
if (panel->win) {
|
||||||
|
WMSetLabelText(panel->label, wwin->frame->title);
|
||||||
|
|
||||||
|
changeImage(panel, panel->current, 1);
|
||||||
|
}
|
||||||
|
return wwin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace);
|
|||||||
void wSwitchPanelDestroy(WSwitchPanel *panel);
|
void wSwitchPanelDestroy(WSwitchPanel *panel);
|
||||||
|
|
||||||
WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back);
|
WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back);
|
||||||
|
WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back);
|
||||||
|
|
||||||
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event);
|
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user