mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
* Obtaining Gtk backend and runtime and displaying it in About box. * .fixes * .csometics * Initial iteration for GTK on Wayland. Works suprisingly stable. * Disable X11Utils when Wayland backend detected. * Cosmetics * .native * First iteration of CSD. * .working * .working * Calculating additional window spaced used by CSD. * Fix max window size problem. * Fix issue with rendering. * .refactoring * Fix splash screen when SSD is enable. * Fix issue with mouse scrolling when CSD is enable. * Not ideal fix for no keyboard input in parent window. * Fix problem with XDisplay compilation and change name of GdkBackend to GtkBackend. * Introduce new WAYLAND flag. * Ctrl::GetWndScreenRect() fix for X11. * Fix to compile on mac --------- Co-authored-by: Zbigniew Rębacz <zbigniew.rebacz@hotmail.com>
67 lines
1.1 KiB
C++
67 lines
1.1 KiB
C++
#include "CtrlCore.h"
|
|
|
|
#ifdef GUI_GTK
|
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
#include <gdk/gdkx.h>
|
|
#endif
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
#include <gdk/gdkwayland.h>
|
|
#endif
|
|
|
|
namespace Upp {
|
|
namespace GdkBackend {
|
|
|
|
Type Get()
|
|
{
|
|
static auto backend = Type::UNKNOWN;
|
|
if (backend != Type::UNKNOWN) {
|
|
return backend;
|
|
}
|
|
|
|
auto* display = gdk_display_get_default();
|
|
#ifdef GDK_WINDOWING_X11
|
|
if (GDK_IS_X11_DISPLAY(display)) {
|
|
backend = Type::X11;
|
|
return backend;
|
|
}
|
|
#endif
|
|
#ifdef GDK_WINDOWING_WAYLAND
|
|
if (GDK_IS_WAYLAND_DISPLAY(display)) {
|
|
backend = Type::WAYLAND;
|
|
return backend;
|
|
}
|
|
#endif
|
|
return backend;
|
|
}
|
|
|
|
bool IsWayland()
|
|
{
|
|
return Get() == Type::WAYLAND;
|
|
}
|
|
|
|
bool IsX11()
|
|
{
|
|
return Get() == Type::X11;
|
|
}
|
|
|
|
bool IsRunningOnWayland()
|
|
{
|
|
static bool running = GetEnv("XDG_SESSION_TYPE") == "wayland";
|
|
return running;
|
|
}
|
|
|
|
}
|
|
|
|
String ToString(GdkBackend::Type t)
|
|
{
|
|
switch (t) {
|
|
case GdkBackend::Type::X11: return "X11";
|
|
case GdkBackend::Type::WAYLAND: return "Wayland";
|
|
default: return "Unknown";
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|