- Setup libdecor, which is used automatically when available.
TODO: - xdg decorations - threading - thread-safe window manager
This commit is contained in:
@@ -114,18 +114,18 @@ void wayland_server::connect() {
|
||||
auto contexts = ctx_registry::get_type_list();
|
||||
while (not contexts.empty()) {
|
||||
const auto& ctx = contexts.front();
|
||||
gfx_context = ctx.ctor(this);
|
||||
gfx_context = unique_ptr(ctx.ctor(this));
|
||||
|
||||
if (gfx_context->is_valid()) {
|
||||
break;
|
||||
} else {
|
||||
delete gfx_context;
|
||||
gfx_context.reset();
|
||||
gfx_context = nullptr;
|
||||
contexts.pop();
|
||||
}
|
||||
}
|
||||
|
||||
assertf(gfx_context != nullptr, "Failed to create graphics context.");
|
||||
assertf(not gfx_context.empty(), "Failed to create graphics context.");
|
||||
}
|
||||
|
||||
void wayland_server::disconnect() {
|
||||
@@ -136,7 +136,7 @@ void wayland_server::disconnect() {
|
||||
}
|
||||
|
||||
// delete the gfx context
|
||||
delete gfx_context;
|
||||
gfx_context.reset();
|
||||
|
||||
|
||||
// check compositor
|
||||
@@ -167,7 +167,14 @@ bool wayland_server::connected() const {
|
||||
}
|
||||
|
||||
void wayland_server::dispatch() {
|
||||
wl_display_dispatch_pending(display);
|
||||
#if FENNEC_HAS_LIBDECOR
|
||||
if (libdecor) {
|
||||
libdecor_dispatch(libdecor, 0);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
wl_display_dispatch_pending(display);
|
||||
}
|
||||
}
|
||||
|
||||
window* wayland_server::create_window(const window::config& conf) {
|
||||
|
||||
Reference in New Issue
Block a user