mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Add delay to send configure notify in virtual edge and
fix a bug in move window with keyboard.
This commit is contained in:
@@ -1262,8 +1262,18 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
|||||||
looper.ox=off_x;
|
looper.ox=off_x;
|
||||||
looper.oy=off_y;
|
looper.oy=off_y;
|
||||||
*/
|
*/
|
||||||
|
do {
|
||||||
WMMaskEvent(dpy, KeyPressMask | ButtonReleaseMask
|
WMMaskEvent(dpy, KeyPressMask | ButtonReleaseMask
|
||||||
| ButtonPressMask | ExposureMask, &event);
|
| ButtonPressMask | ExposureMask, &event);
|
||||||
|
if (event.type == Expose) {
|
||||||
|
WMHandleEvent(&event);
|
||||||
|
}
|
||||||
|
} while (event.type == Expose);
|
||||||
|
|
||||||
|
|
||||||
|
while (XCheckTypedEvent(dpy, Expose, &event)) {
|
||||||
|
WMHandleEvent(&event);
|
||||||
|
}
|
||||||
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);
|
||||||
@@ -1412,6 +1422,13 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
|||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
done=1;
|
done=1;
|
||||||
break;
|
break;
|
||||||
|
case Expose:
|
||||||
|
WMHandleEvent(&event);
|
||||||
|
while (XCheckTypedEvent(dpy, Expose, &event)) {
|
||||||
|
WMHandleEvent(&event);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WMHandleEvent(&event);
|
WMHandleEvent(&event);
|
||||||
break;
|
break;
|
||||||
@@ -1448,7 +1465,7 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
|
|||||||
showPosition(wwin, src_x+off_x, src_y+off_y);
|
showPosition(wwin, src_x+off_x, src_y+off_y);
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
if(done){
|
if (done) {
|
||||||
scr->keymove_tick=0;
|
scr->keymove_tick=0;
|
||||||
/*
|
/*
|
||||||
WMDeleteTimerWithClientData(&looper);
|
WMDeleteTimerWithClientData(&looper);
|
||||||
|
|||||||
@@ -744,13 +744,30 @@ void updateWorkspaceGeometry(WScreen *scr, int workspace, int *view_x, int *view
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct _delay_configure {
|
||||||
|
WWindow *wwin;
|
||||||
|
int delay_count;
|
||||||
|
} _delay_configure;
|
||||||
|
|
||||||
|
void _sendConfigureNotify (_delay_configure *delay) {
|
||||||
|
WWindow *wwin;
|
||||||
|
|
||||||
|
delay->delay_count--;
|
||||||
|
if (!delay->delay_count) {
|
||||||
|
for (wwin = delay->wwin; wwin; wwin = wwin->prev) {
|
||||||
|
wWindowSynthConfigureNotify(wwin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
||||||
{
|
{
|
||||||
Bool adjust_flag = False;
|
Bool adjust_flag = False;
|
||||||
int diff_x, diff_y;
|
int diff_x, diff_y;
|
||||||
|
static _delay_configure delay_configure = {NULL, 0};
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
printf("wWorkspaceSetViewPort %d %d\n", view_x, view_y);
|
/*printf("wWorkspaceSetViewPort %d %d\n", view_x, view_y);*/
|
||||||
|
|
||||||
updateWorkspaceGeometry(scr, workspace, &view_x, &view_y);
|
updateWorkspaceGeometry(scr, workspace, &view_x, &view_y);
|
||||||
|
|
||||||
@@ -780,12 +797,16 @@ Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int view_y)
|
|||||||
scr->workspaces[workspace]->view_y = view_y;
|
scr->workspaces[workspace]->view_y = view_y;
|
||||||
|
|
||||||
|
|
||||||
for( wwin = scr->focused_window; wwin; wwin = wwin->prev) {
|
for (wwin = scr->focused_window; wwin; wwin = wwin->prev) {
|
||||||
if (wwin->frame->workspace == workspace) {
|
if (wwin->frame->workspace == workspace) {
|
||||||
wWindowMove(wwin, wwin->frame_x + diff_x, wwin->frame_y + diff_y);
|
wWindowMove(wwin, wwin->frame_x + diff_x, wwin->frame_y + diff_y);
|
||||||
wWindowSynthConfigureNotify(wwin);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (1) { /* if delay*/
|
||||||
|
delay_configure.delay_count++;
|
||||||
|
delay_configure.wwin = scr->focused_window;
|
||||||
|
WMAddTimerHandler(200, (WMCallback *)_sendConfigureNotify, &delay_configure);
|
||||||
|
}
|
||||||
|
|
||||||
return adjust_flag;
|
return adjust_flag;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user