diff options
Diffstat (limited to 'backend/x11/backend.c')
-rw-r--r-- | backend/x11/backend.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c index 28a4fcac..d0206976 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -23,6 +23,7 @@ #include <dev/evdev/input-event-codes.h> #endif #include "backend/x11.h" +#include "util/defs.h" #include "util/signal.h" static struct wlr_backend_impl backend_impl; @@ -221,11 +222,21 @@ static bool wlr_x11_backend_start(struct wlr_backend *backend) { init_atom(x11, &x11->atoms.wm_protocols, 1, "WM_PROTOCOLS"); init_atom(x11, &x11->atoms.wm_delete_window, 0, "WM_DELETE_WINDOW"); + init_atom(x11, &x11->atoms.net_wm_name, 1, "_NET_WM_NAME"); + init_atom(x11, &x11->atoms.utf8_string, 0, "UTF8_STRING"); xcb_change_property(x11->xcb_conn, XCB_PROP_MODE_REPLACE, output->win, x11->atoms.wm_protocols.reply->atom, XCB_ATOM_ATOM, 32, 1, &x11->atoms.wm_delete_window.reply->atom); + char title[32]; + if (snprintf(title, sizeof(title), "wlroots - %s", output->wlr_output.name)) { + xcb_change_property(x11->xcb_conn, XCB_PROP_MODE_REPLACE, output->win, + x11->atoms.net_wm_name.reply->atom, + x11->atoms.utf8_string.reply->atom, 8, + strlen(title), title); + } + xcb_map_window(x11->xcb_conn, output->win); xcb_flush(x11->xcb_conn); wlr_output_update_enabled(&output->wlr_output, true); @@ -289,6 +300,7 @@ static struct wlr_backend_impl backend_impl = { .get_renderer = wlr_x11_backend_get_renderer, }; +WLR_API bool wlr_backend_is_x11(struct wlr_backend *backend) { return backend->impl == &backend_impl; } @@ -299,6 +311,7 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { wlr_x11_backend_destroy(&x11->backend); } +WLR_API struct wlr_backend *wlr_x11_backend_create(struct wl_display *display, const char *x11_display) { struct wlr_x11_backend *x11 = calloc(1, sizeof(*x11)); @@ -418,10 +431,12 @@ static struct wlr_output_impl output_impl = { .swap_buffers = output_swap_buffers, }; +WLR_API bool wlr_output_is_x11(struct wlr_output *wlr_output) { return wlr_output->impl == &output_impl; } +WLR_API bool wlr_input_device_is_x11(struct wlr_input_device *wlr_dev) { return wlr_dev->impl == &input_device_impl; } |