WINGs: add flush vtable entry, remove XFlush from wbutton.c
Add flush() to W_ViewBackend. X11 backend calls XFlush, Wayland backend is a no-op (compositing happens at frame boundaries). wbutton.c WMPerformButtonClick now uses the vtable.
This commit is contained in:
parent
bb420ef536
commit
05d819bf15
|
|
@ -618,6 +618,9 @@ typedef struct W_ViewBackend {
|
|||
|
||||
/* Get screen position (for views that support it) */
|
||||
WMPoint (*get_screen_position)(void *vctx, struct W_View *view);
|
||||
|
||||
/* Flush pending display output */
|
||||
void (*flush)(void *vctx);
|
||||
} W_ViewBackend;
|
||||
|
||||
extern const W_ViewBackend W_ViewBackendX11;
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ void WMPerformButtonClick(WMButton * bPtr)
|
|||
|
||||
if (bPtr->view->flags.mapped) {
|
||||
paintButton(bPtr);
|
||||
XFlush(WMScreenDisplay(WMWidgetScreen(bPtr)));
|
||||
bPtr->view->screen->viewBackend->flush(bPtr->view->screen->viewBackendCtx);
|
||||
wusleep(20000);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -297,6 +297,11 @@ static void wl_selection_release(void *vctx, W_View *view, Atom selection)
|
|||
(void)vctx; (void)view; (void)selection;
|
||||
}
|
||||
|
||||
static void wl_flush(void *vctx)
|
||||
{
|
||||
(void)vctx;
|
||||
}
|
||||
|
||||
const W_ViewBackend W_ViewBackendWL = {
|
||||
.screen_init = wl_screen_init,
|
||||
.screen_fini = wl_screen_fini,
|
||||
|
|
@ -319,4 +324,5 @@ const W_ViewBackend W_ViewBackendWL = {
|
|||
.selection_acquire = wl_selection_acquire,
|
||||
.selection_release = wl_selection_release,
|
||||
.platform_init = NULL,
|
||||
.flush = wl_flush,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -205,6 +205,12 @@ static void x11_selection_release(void *vctx, W_View *view, Atom selection)
|
|||
(void)vctx; (void)view; (void)selection;
|
||||
}
|
||||
|
||||
static void x11_flush(void *vctx)
|
||||
{
|
||||
W_Screen *scr = (W_Screen *)vctx;
|
||||
XFlush(scr->display);
|
||||
}
|
||||
|
||||
const W_ViewBackend W_ViewBackendX11 = {
|
||||
.screen_init = x11_screen_init,
|
||||
.screen_fini = x11_screen_fini,
|
||||
|
|
@ -227,4 +233,5 @@ const W_ViewBackend W_ViewBackendX11 = {
|
|||
.selection_acquire = x11_selection_acquire,
|
||||
.selection_release = x11_selection_release,
|
||||
.platform_init = W_X11PlatformInit,
|
||||
.flush = x11_flush,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue