diff options
Diffstat (limited to 'src/platform/x11/window.c')
| -rw-r--r-- | src/platform/x11/window.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/platform/x11/window.c b/src/platform/x11/window.c index f60a878..be1ff32 100644 --- a/src/platform/x11/window.c +++ b/src/platform/x11/window.c @@ -1601,6 +1601,7 @@ static struct yasl_display *display_open(struct yasl_loop *loop, } d->base.loop = d->loop; d->app_id = strdup(spec && spec->app_id ? spec->app_id : "YASL"); + d->base.app_id = d->app_id; if (!d->loop || !d->app_id) { if (d->owns_loop) yasl_loop_destroy(d->loop); free(d->app_id); @@ -1803,6 +1804,18 @@ static bool place(struct yasl_surface *base, struct yasl_vector2i at) return true; } +static bool bell(struct yasl_surface *base) +{ + struct x11_surface *s = (struct x11_surface *)base; + struct x11_display *d = (struct x11_display *)base->display; + if (s->destroyed || !d->native) return false; + /* The XKB bell names the window, so the window manager can flash it. */ + if (!XkbBell(d->native, s->window, 0, None)) + XBell(d->native, 0); + XFlush(d->native); + return true; +} + static void drag_end(struct x11_display *d, enum yasl_drag_end how) { if (!d || !d->drag.active) return; @@ -2045,6 +2058,7 @@ const struct yasl_backend_ops yasl_x11_backend = { .surface_set_cursor = cursor, .surface_drag_carry = drag_carry, .surface_place_under_pointer = place, + .surface_bell = bell, .surface_start_interactive_move = interactive_move, .surface_start_interactive_resize = interactive_resize, .surface_show_window_menu = show_window_menu, |
