--- a/plugins/single_plugins/meson.build +++ b/plugins/single_plugins/meson.build @@ -2,7 +2,7 @@ 'move', 'resize', 'command', 'autostart', 'vswipe', 'wrot', 'expo', 'switcher', 'fast-switcher', 'oswitch', 'place', 'invert', 'zoom', 'alpha', 'idle', 'extra-gestures', 'preserve-output', - 'wsets', 'xkb-bindings', + 'wsets', 'xkb-bindings', 'output-control', ] all_include_dirs = [wayfire_api_inc, wayfire_conf_inc, plugins_common_inc, vswitch_inc, wobbly_inc, grid_inc, ipc_include_dirs] --- a/metadata/meson.build +++ b/metadata/meson.build @@ -24,6 +24,7 @@ install_data('move.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) install_data('oswitch.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) install_data('output.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) +install_data('output-control.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) install_data('place.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) install_data('preserve-output.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) install_data('resize.xml', install_dir: conf_data.get('PLUGIN_XML_DIR')) --- a/plugins/grid/grid.cpp +++ b/plugins/grid/grid.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include #include #include #include @@ -118,9 +120,23 @@ // Inset each physical region, including the internal seams. // Clamp independently so even a small region stays usable. auto& g = zone.geometry; - double gx = std::clamp(zone_gap, 0, + int gap = zone_gap; + for (auto& [head, state] : wf::get_core().output_layout->get_current_configuration()) + { + if (name == head->name) + { + auto section = wf::get_core().config_backend->get_output_section(head); + if (auto opt = section->get_option_or("zone_gap")) + { + int local_gap = std::stoi(opt->get_value_str()); + if (local_gap >= 0) gap = local_gap; + } + break; + } + } + double gx = std::clamp(gap, 0, std::max(0.0, std::floor((g.width - 1) / 2))); - double gy = std::clamp(zone_gap, 0, + double gy = std::clamp(gap, 0, std::max(0.0, std::floor((g.height - 1) / 2))); g.x += gx; g.y += gy; --- a/metadata/output.xml +++ b/metadata/output.xml @@ -7,6 +7,13 @@ +