diff options
| author | Trung Lê <8@tle.id.au> | 2026-02-22 00:20:30 +1100 |
|---|---|---|
| committer | Trung Lê <8@tle.id.au> | 2026-02-22 00:20:30 +1100 |
| commit | 8f1bfa65591fbec2f019c515bd3ac02934ff6e4d (patch) | |
| tree | 5e4abcd2446b56268966590bbe562325a2d3d454 /src/gsr-window.c | |
| parent | 3eed1b64af72dcb4bcb8ae28d45856767d4acff1 (diff) | |
Hide unavailable record area options, fix recording saved notification, and update about dialog
- Only show Window/Focused window options on X11 (compile-time and runtime)
- Only show Desktop portal option on Wayland with portal support
- Fix default record area selection to use dynamic index instead of hardcoded 2
- Use notify_saved preference (default: true) for recording saved notification
instead of notify_stopped (default: false) so users see the file path by default
- Update about dialog: website and issues URL to GitHub, revert developer to
dec05eba with Trung Lê credited for the Adwaita port
Diffstat (limited to 'src/gsr-window.c')
| -rw-r--r-- | src/gsr-window.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/gsr-window.c b/src/gsr-window.c index d224aba..e2c1ab7 100644 --- a/src/gsr-window.c +++ b/src/gsr-window.c @@ -526,23 +526,22 @@ handle_child_death(GsrWindow *self, int exit_status) /* Canceled by user — silent */ } else if (exit_status == 0) { /* Success */ - gboolean notify = gsr_config_page_get_notify_stopped(self->config_page); - if (notify) { - if (mode == GSR_ACTIVE_MODE_RECORD && self->record_filename) { + if (mode == GSR_ACTIVE_MODE_RECORD && self->record_filename) { + if (gsr_config_page_get_notify_saved(self->config_page)) { char *msg = g_strdup_printf("Recording saved to %s", self->record_filename); send_notification(self, "GPU Screen Recorder", msg, G_NOTIFICATION_PRIORITY_NORMAL); g_free(msg); - } else { - const char *mode_str = - mode == GSR_ACTIVE_MODE_STREAM ? "streaming" : - mode == GSR_ACTIVE_MODE_REPLAY ? "replay" : "recording"; - char *msg = g_strdup_printf("Stopped %s", mode_str); - send_notification(self, "GPU Screen Recorder", msg, - G_NOTIFICATION_PRIORITY_NORMAL); - g_free(msg); } + } else if (gsr_config_page_get_notify_stopped(self->config_page)) { + const char *mode_str = + mode == GSR_ACTIVE_MODE_STREAM ? "streaming" : + mode == GSR_ACTIVE_MODE_REPLAY ? "replay" : "recording"; + char *msg = g_strdup_printf("Stopped %s", mode_str); + send_notification(self, "GPU Screen Recorder", msg, + G_NOTIFICATION_PRIORITY_NORMAL); + g_free(msg); } } else { /* Error — always notify regardless of user prefs */ @@ -1077,23 +1076,23 @@ gsr_window_stop_process(GsrWindow *self, gboolean *already_dead) self->active_mode = GSR_ACTIVE_MODE_NONE; /* Show stop notification (respecting user prefs) */ - if (gsr_config_page_get_notify_stopped(self->config_page)) { - if (success && mode == GSR_ACTIVE_MODE_RECORD && self->record_filename) { + if (success && mode == GSR_ACTIVE_MODE_RECORD && self->record_filename) { + if (gsr_config_page_get_notify_saved(self->config_page)) { char *msg = g_strdup_printf("Recording saved to %s", self->record_filename); send_notification(self, "GPU Screen Recorder", msg, G_NOTIFICATION_PRIORITY_NORMAL); g_free(msg); - } else { - const char *mode_str = - mode == GSR_ACTIVE_MODE_STREAM ? "streaming" : - mode == GSR_ACTIVE_MODE_RECORD ? "recording" : - mode == GSR_ACTIVE_MODE_REPLAY ? "replay" : "unknown"; - char *msg = g_strdup_printf("Stopped %s", mode_str); - send_notification(self, "GPU Screen Recorder", msg, - G_NOTIFICATION_PRIORITY_NORMAL); - g_free(msg); } + } else if (gsr_config_page_get_notify_stopped(self->config_page)) { + const char *mode_str = + mode == GSR_ACTIVE_MODE_STREAM ? "streaming" : + mode == GSR_ACTIVE_MODE_RECORD ? "recording" : + mode == GSR_ACTIVE_MODE_REPLAY ? "replay" : "unknown"; + char *msg = g_strdup_printf("Stopped %s", mode_str); + send_notification(self, "GPU Screen Recorder", msg, + G_NOTIFICATION_PRIORITY_NORMAL); + g_free(msg); } return success; |
