niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching·0 forks·Rust·GPL-3.0·12.1 MiB·9d8f4f8·Ivan Molodetskikh·1 month ago·2997 commits
| 1 | use std::path::PathBuf; |
| 2 | |
| 3 | use crate::utils::{Flag, MergeWith}; |
| 4 | |
| 5 | #[derive(Debug, Default, PartialEq)] |
| 6 | pub struct Debug { |
| 7 | pub preview_render: Option<PreviewRender>, |
| 8 | pub dbus_interfaces_in_non_session_instances: bool, |
| 9 | pub wait_for_frame_completion_before_queueing: bool, |
| 10 | pub enable_overlay_planes: bool, |
| 11 | pub disable_cursor_plane: bool, |
| 12 | pub disable_direct_scanout: bool, |
| 13 | pub restrict_primary_scanout_to_matching_format: bool, |
| 14 | pub force_disable_connectors_on_resume: bool, |
| 15 | pub render_drm_device: Option<PathBuf>, |
| 16 | pub ignored_drm_devices: Vec<PathBuf>, |
| 17 | pub force_pipewire_invalid_modifier: bool, |
| 18 | pub disable_pipewire_dmabuf: bool, |
| 19 | pub emulate_zero_presentation_time: bool, |
| 20 | pub disable_resize_throttling: bool, |
| 21 | pub disable_transactions: bool, |
| 22 | pub keep_laptop_panel_on_when_lid_is_closed: bool, |
| 23 | pub disable_monitor_names: bool, |
| 24 | pub strict_new_window_focus_policy: bool, |
| 25 | pub honor_xdg_activation_with_invalid_serial: bool, |
| 26 | pub deactivate_unfocused_windows: bool, |
| 27 | pub skip_cursor_only_updates_during_vrr: bool, |
| 28 | pub disable_10bit_output: bool, |
| 29 | } |
| 30 | |
| 31 | #[derive(knuffel::Decode, Debug, Default, PartialEq)] |
| 32 | pub struct DebugPart { |
| 33 | #[knuffel(child, unwrap(argument))] |
| 34 | pub preview_render: Option<PreviewRender>, |
| 35 | #[knuffel(child)] |
| 36 | pub dbus_interfaces_in_non_session_instances: Option<Flag>, |
| 37 | #[knuffel(child)] |
| 38 | pub wait_for_frame_completion_before_queueing: Option<Flag>, |
| 39 | #[knuffel(child)] |
| 40 | pub enable_overlay_planes: Option<Flag>, |
| 41 | #[knuffel(child)] |
| 42 | pub disable_cursor_plane: Option<Flag>, |
| 43 | #[knuffel(child)] |
| 44 | pub disable_direct_scanout: Option<Flag>, |
| 45 | #[knuffel(child)] |
| 46 | pub restrict_primary_scanout_to_matching_format: Option<Flag>, |
| 47 | #[knuffel(child)] |
| 48 | pub force_disable_connectors_on_resume: Option<Flag>, |
| 49 | #[knuffel(child, unwrap(argument))] |
| 50 | pub render_drm_device: Option<PathBuf>, |
| 51 | #[knuffel(children(name = "ignore-drm-device"), unwrap(argument))] |
| 52 | pub ignored_drm_devices: Vec<PathBuf>, |
| 53 | #[knuffel(child)] |
| 54 | pub force_pipewire_invalid_modifier: Option<Flag>, |
| 55 | #[knuffel(child)] |
| 56 | pub disable_pipewire_dmabuf: Option<Flag>, |
| 57 | #[knuffel(child)] |
| 58 | pub emulate_zero_presentation_time: Option<Flag>, |
| 59 | #[knuffel(child)] |
| 60 | pub disable_resize_throttling: Option<Flag>, |
| 61 | #[knuffel(child)] |
| 62 | pub disable_transactions: Option<Flag>, |
| 63 | #[knuffel(child)] |
| 64 | pub keep_laptop_panel_on_when_lid_is_closed: Option<Flag>, |
| 65 | #[knuffel(child)] |
| 66 | pub disable_monitor_names: Option<Flag>, |
| 67 | #[knuffel(child)] |
| 68 | pub strict_new_window_focus_policy: Option<Flag>, |
| 69 | #[knuffel(child)] |
| 70 | pub honor_xdg_activation_with_invalid_serial: Option<Flag>, |
| 71 | #[knuffel(child)] |
| 72 | pub deactivate_unfocused_windows: Option<Flag>, |
| 73 | #[knuffel(child)] |
| 74 | pub skip_cursor_only_updates_during_vrr: Option<Flag>, |
| 75 | #[knuffel(child)] |
| 76 | pub disable_10bit_output: Option<Flag>, |
| 77 | } |
| 78 | |
| 79 | impl MergeWith<DebugPart> for Debug { |
| 80 | fn merge_with(&mut self, part: &DebugPart) { |
| 81 | merge!( |
| 82 | (self, part), |
| 83 | dbus_interfaces_in_non_session_instances, |
| 84 | wait_for_frame_completion_before_queueing, |
| 85 | enable_overlay_planes, |
| 86 | disable_cursor_plane, |
| 87 | disable_direct_scanout, |
| 88 | restrict_primary_scanout_to_matching_format, |
| 89 | force_disable_connectors_on_resume, |
| 90 | force_pipewire_invalid_modifier, |
| 91 | disable_pipewire_dmabuf, |
| 92 | emulate_zero_presentation_time, |
| 93 | disable_resize_throttling, |
| 94 | disable_transactions, |
| 95 | keep_laptop_panel_on_when_lid_is_closed, |
| 96 | disable_monitor_names, |
| 97 | strict_new_window_focus_policy, |
| 98 | honor_xdg_activation_with_invalid_serial, |
| 99 | deactivate_unfocused_windows, |
| 100 | skip_cursor_only_updates_during_vrr, |
| 101 | disable_10bit_output, |
| 102 | ); |
| 103 | |
| 104 | merge_clone_opt!((self, part), preview_render, render_drm_device); |
| 105 | |
| 106 | self.ignored_drm_devices |
| 107 | .extend(part.ignored_drm_devices.iter().cloned()); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | #[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)] |
| 112 | pub enum PreviewRender { |
| 113 | Screencast, |
| 114 | ScreenCapture, |
| 115 | } |