diff --git a/WINGs/WINGs/WINGsP.h.in b/WINGs/WINGs/WINGsP.h.in index 86e925a..cf14786 100644 --- a/WINGs/WINGs/WINGsP.h.in +++ b/WINGs/WINGs/WINGsP.h.in @@ -651,6 +651,7 @@ typedef struct W_ViewBackend { void (*balloon_draw)(void *vctx, struct W_View *view, int x, int y, int w, int h, const char *text); void (*text_init)(void *vctx, struct W_View *view, void *stipple_gc_out); + void (*xor_fill_rect)(void *vctx, struct W_View *view, int x, int y, int w, int h); } W_ViewBackend; extern const W_ViewBackend W_ViewBackendX11; diff --git a/WINGs/wsplitview.c b/WINGs/wsplitview.c index 5b63273..e023388 100644 --- a/WINGs/wsplitview.c +++ b/WINGs/wsplitview.c @@ -451,7 +451,9 @@ static void drawDragingRectangle(WMSplitView * sPtr, int pos) h = DIVIDER_THICKNESS; } - XFillRectangle(sPtr->view->screen->display, sPtr->view->window, sPtr->view->screen->ixorGC, x, y, w, h); + W_Screen *scr = sPtr->view->screen; + if (scr->viewBackend->xor_fill_rect) + scr->viewBackend->xor_fill_rect(scr->viewBackendCtx, sPtr->view, x, y, w, h); } static void getMinMaxDividerCoord(WMSplitView * sPtr, int divider, int *minC, int *maxC) diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c index 24a48ae..1cf90f3 100644 --- a/WINGs/wtextfield.c +++ b/WINGs/wtextfield.c @@ -1365,8 +1365,6 @@ static void handleTextFieldActionEvents(WMEvent * event, void *data) TextField *tPtr = (TextField *) data; static Time lastButtonReleasedEvent = 0; static Time lastButtonReleasedEvent2 = 0; - Display *dpy = tPtr->view->screen->display; - CHECK_CLASS(data, WC_TextField); switch (event->type) { @@ -1502,8 +1500,6 @@ static void handleTextFieldActionEvents(WMEvent * event, void *data) if (!tPtr->flags.secure && tPtr->selection.count != 0) { int start, count; - XRotateBuffers(dpy, 1); - count = abs(tPtr->selection.count); if (tPtr->selection.count < 0) start = tPtr->selection.position - count; diff --git a/WINGs/wview_wl.c b/WINGs/wview_wl.c index a77b99b..29f013d 100644 --- a/WINGs/wview_wl.c +++ b/WINGs/wview_wl.c @@ -620,4 +620,5 @@ const W_ViewBackend W_ViewBackendWL = { .bell = NULL, .balloon_draw = wl_balloon_draw, .text_init = wl_text_init, + .xor_fill_rect = NULL, }; diff --git a/WINGs/wview_x11.c b/WINGs/wview_x11.c index 204c1a5..2a8fbb6 100644 --- a/WINGs/wview_x11.c +++ b/WINGs/wview_x11.c @@ -520,6 +520,12 @@ static void x11_window_withdraw(void *vctx, W_View *view) XWithdrawWindow(scr->display, view->window, scr->screen); } +static void x11_xor_fill_rect(void *vctx, W_View *view, int x, int y, int w, int h) +{ + W_Screen *scr = (W_Screen *)vctx; + XFillRectangle(scr->display, view->window, scr->ixorGC, x, y, w, h); +} + const W_ViewBackend W_ViewBackendX11 = { .screen_init = x11_screen_init, .screen_fini = x11_screen_fini, @@ -557,4 +563,5 @@ const W_ViewBackend W_ViewBackendX11 = { .bell = x11_bell, .balloon_draw = x11_balloon_draw, .text_init = x11_text_init, + .xor_fill_rect = x11_xor_fill_rect, };