mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-07 15:19:56 +09:00
A little bit of glitch fixing, warp cursor after hiding ui when XI grabbing
This commit is contained in:
@@ -1115,8 +1115,6 @@ namespace gsr {
|
|||||||
XFlush(display);
|
XFlush(display);
|
||||||
|
|
||||||
if(xi_display) {
|
if(xi_display) {
|
||||||
XFixesShowCursor(xi_display, DefaultRootWindow(xi_display));
|
|
||||||
XFlush(xi_display);
|
|
||||||
cursor_texture.clear();
|
cursor_texture.clear();
|
||||||
cursor_sprite.set_texture(nullptr);
|
cursor_sprite.set_texture(nullptr);
|
||||||
}
|
}
|
||||||
@@ -1142,6 +1140,18 @@ namespace gsr {
|
|||||||
if(xi_display) {
|
if(xi_display) {
|
||||||
XCloseDisplay(xi_display);
|
XCloseDisplay(xi_display);
|
||||||
xi_display = nullptr;
|
xi_display = nullptr;
|
||||||
|
|
||||||
|
if(window) {
|
||||||
|
mgl_context *context = mgl_get_context();
|
||||||
|
Display *display = (Display*)context->connection;
|
||||||
|
|
||||||
|
const mgl::vec2i new_cursor_position = mgl::vec2i(window->internal_window()->pos.x, window->internal_window()->pos.y) + window->get_mouse_position();
|
||||||
|
XWarpPointer(display, DefaultRootWindow(display), DefaultRootWindow(display), 0, 0, 0, 0, new_cursor_position.x, new_cursor_position.y);
|
||||||
|
XFlush(display);
|
||||||
|
|
||||||
|
XFixesShowCursor(display, DefaultRootWindow(display));
|
||||||
|
XFlush(display);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(window) {
|
if(window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user