1
0
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:
id
2000-11-25 21:06:31 +00:00
parent 4eb26a0bd3
commit 1f22c07051
2 changed files with 288 additions and 250 deletions

View File

@@ -1262,8 +1262,18 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
looper.ox=off_x;
looper.oy=off_y;
*/
do {
WMMaskEvent(dpy, KeyPressMask | ButtonReleaseMask
| 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(scr->selected_windows)
drawFrames(wwin,scr->selected_windows,off_x,off_y);
@@ -1412,6 +1422,13 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
case ButtonRelease:
done=1;
break;
case Expose:
WMHandleEvent(&event);
while (XCheckTypedEvent(dpy, Expose, &event)) {
WMHandleEvent(&event);
}
break;
default:
WMHandleEvent(&event);
break;
@@ -1448,7 +1465,7 @@ wKeyboardMoveResizeWindow(WWindow *wwin)
showPosition(wwin, src_x+off_x, src_y+off_y);
/**/
if(done){
if (done) {
scr->keymove_tick=0;
/*
WMDeleteTimerWithClientData(&looper);

View File

@@ -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 adjust_flag = False;
int diff_x, diff_y;
static _delay_configure delay_configure = {NULL, 0};
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);
@@ -780,12 +797,16 @@ Bool wWorkspaceSetViewPort(WScreen *scr, int workspace, int view_x, int 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) {
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;
}