mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlCore: Attemt at fixing xwayland cursor
This commit is contained in:
parent
e69c9eb859
commit
94a5c94b6e
3 changed files with 32 additions and 0 deletions
|
|
@ -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...
|
||||
|
|
|
|||
9
upptst/CursorImage/CursorImage.upp
Normal file
9
upptst/CursorImage/CursorImage.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
21
upptst/CursorImage/main.cpp
Normal file
21
upptst/CursorImage/main.cpp
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue