Allow capture of external monitors on a laptop with dedicated gpu (prime) on x11, fix cursor not visible on some wayland compositors (hyprland) with multiple monitors

This commit is contained in:
dec05eba
2024-08-16 19:37:00 +02:00
parent f297a92e05
commit da4925b23e
9 changed files with 183 additions and 67 deletions

View File

@@ -7,14 +7,11 @@
#include <stdbool.h>
#include <stdint.h>
typedef struct _XRRCrtcInfo XRRCrtcInfo;
typedef struct {
const char *name;
int name_len;
vec2i pos;
vec2i size;
XRRCrtcInfo *crt_info; /* Only on x11 */
uint32_t connector_id; /* Only on x11 and drm */
gsr_monitor_rotation rotation; /* Only on x11 and wayland */
uint32_t monitor_identifier; /* Only on drm and wayland */
@@ -30,7 +27,8 @@ typedef struct {
double clock_get_monotonic_seconds(void);
typedef void (*active_monitor_callback)(const gsr_monitor *monitor, void *userdata);
void for_each_active_monitor_output_x11(Display *display, active_monitor_callback callback, void *userdata);
void for_each_active_monitor_output_x11_not_cached(Display *display, active_monitor_callback callback, void *userdata);
void for_each_active_monitor_output_x11(const gsr_egl *egl, active_monitor_callback callback, void *userdata);
void for_each_active_monitor_output(const gsr_egl *egl, gsr_connection_type connection_type, active_monitor_callback callback, void *userdata);
bool get_monitor_by_name(const gsr_egl *egl, gsr_connection_type connection_type, const char *name, gsr_monitor *monitor);
gsr_monitor_rotation drm_monitor_get_display_server_rotation(const gsr_egl *egl, const gsr_monitor *monitor);