aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2019-11-02 23:25:45 +1300
committerSimon Ser <contact@emersion.fr>2019-11-02 12:43:33 +0100
commita3c3b928a3814f1a44babf487b1508415958c721 (patch)
tree18a06e25133b18b508d5613c038bacc10c5f5da0 /include
parentb81bb2ef3040e5cf3dcffbddcb5389775c879d85 (diff)
backend/x11: Give X11 a real rendering loop
Makes use of the present extension to get notified of vsync, and not require any stupid timer hacks. Also make use of the present version of ConfigureNotify, because why not?
Diffstat (limited to 'include')
-rw-r--r--include/backend/x11.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/backend/x11.h b/include/backend/x11.h
index e628e4cb..59cb8e44 100644
--- a/include/backend/x11.h
+++ b/include/backend/x11.h
@@ -6,6 +6,7 @@
#include <X11/Xlib-xcb.h>
#include <wayland-server-core.h>
#include <xcb/xcb.h>
+#include <xcb/present.h>
#include <wlr/backend/x11.h>
#include <wlr/config.h>
@@ -16,8 +17,6 @@
#define XCB_EVENT_RESPONSE_TYPE_MASK 0x7f
-#define X11_DEFAULT_REFRESH (60 * 1000) // 60 Hz
-
struct wlr_x11_backend;
struct wlr_x11_output {
@@ -35,8 +34,7 @@ struct wlr_x11_output {
struct wlr_input_device touch_dev;
struct wl_list touchpoints; // wlr_x11_touchpoint::link
- struct wl_event_source *frame_timer;
- int frame_delay;
+ xcb_present_event_t present_context;
bool cursor_hidden;
};
@@ -78,6 +76,7 @@ struct wlr_x11_backend {
xcb_timestamp_t time;
uint8_t xinput_opcode;
+ uint8_t present_opcode;
struct wl_listener display_destroy;
};
@@ -97,7 +96,7 @@ void handle_x11_xinput_event(struct wlr_x11_backend *x11,
void update_x11_pointer_position(struct wlr_x11_output *output,
xcb_timestamp_t time);
-void handle_x11_configure_notify(struct wlr_x11_output *output,
- xcb_configure_notify_event_t *event);
+void handle_x11_present_event(struct wlr_x11_backend *x11,
+ xcb_present_generic_event_t *ev);
#endif