mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-04-08 04:18:08 +09:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62d5daad90 | ||
|
|
5be5b4c8eb |
@@ -67,7 +67,7 @@ namespace gsr {
|
||||
void process_key_bindings(mgl::Event &event);
|
||||
void grab_mouse_and_keyboard();
|
||||
void xi_setup_fake_cursor();
|
||||
void xi_grab_all_devices();
|
||||
void xi_grab_all_mouse_devices();
|
||||
|
||||
void close_gpu_screen_recorder_output();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.0.7', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.0.8', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
|
||||
if get_option('buildtype') == 'debug'
|
||||
add_project_arguments('-g3', language : ['c', 'cpp'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "gsr-ui"
|
||||
type = "executable"
|
||||
version = "1.0.7"
|
||||
version = "1.0.8"
|
||||
platforms = ["posix"]
|
||||
|
||||
[lang.cpp]
|
||||
|
||||
@@ -667,7 +667,15 @@ namespace gsr {
|
||||
XcursorImageDestroy(cursor_image);
|
||||
}
|
||||
|
||||
void Overlay::xi_grab_all_devices() {
|
||||
static bool device_is_mouse(const XIDeviceInfo *dev) {
|
||||
for(int i = 0; i < dev->num_classes; ++i) {
|
||||
if(dev->classes[i]->type == XIMasterPointer || dev->classes[i]->type == XISlavePointer)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Overlay::xi_grab_all_mouse_devices() {
|
||||
if(!xi_display)
|
||||
return;
|
||||
|
||||
@@ -687,6 +695,9 @@ namespace gsr {
|
||||
|
||||
for (int i = 0; i < num_devices; ++i) {
|
||||
const XIDeviceInfo *dev = &info[i];
|
||||
if(!device_is_mouse(dev))
|
||||
continue;
|
||||
|
||||
XIEventMask xi_masks;
|
||||
xi_masks.deviceid = dev->deviceid;
|
||||
xi_masks.mask_len = sizeof(mask);
|
||||
@@ -989,7 +1000,7 @@ namespace gsr {
|
||||
|
||||
// We want to grab all devices to prevent any other application below the UI from receiving events.
|
||||
// Owlboy seems to use xi events and XGrabPointer doesn't prevent owlboy from receiving events.
|
||||
xi_grab_all_devices();
|
||||
xi_grab_all_mouse_devices();
|
||||
|
||||
// if(gsr_info.system_info.display_server == DisplayServer::WAYLAND) {
|
||||
// set_focused_window(display, window->get_system_handle());
|
||||
|
||||
Reference in New Issue
Block a user