CtrlCore: Attemt at fixing xwayland cursor

This commit is contained in:
Mirek Fidler 2026-01-09 08:29:16 +01:00
parent e69c9eb859
commit 94a5c94b6e
3 changed files with 32 additions and 0 deletions

View file

@ -109,6 +109,8 @@ void Ctrl::SetMouseCursor(const Image& image)
#endif
}
if(c && topctrl->IsOpen()) {
static GdkCursor *blank_cursor = gdk_cursor_new_for_display(gdk_display_get_default(), GDK_BLANK_CURSOR);
gdk_window_set_cursor(topctrl->gdk(), blank_cursor); // should help in [x]wayland
gdk_window_set_cursor(topctrl->gdk(), c);
g_object_unref(c);
if(IsXWayland()) // xwayland is broken, need some paint to change the cursor...

View file

@ -0,0 +1,9 @@
uses
CtrlLib;
file
main.cpp;
mainconfig
"" = "GUI";

View file

@ -0,0 +1,21 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
void Paint(Draw& w) override {
w.DrawRect(GetSize(), White());
}
Image CursorImage(Point p, dword keyflags) override {
if(p.x < GetSize().cx / 2)
return Image::Hand();
else
return CtrlImg::HelpCursor0();
}
};
GUI_APP_MAIN
{
MyApp().Run();
}