Skip to content

Commit 185983c

Browse files
committed
panel : menu : made layer shell override optional
1 parent c10f2aa commit 185983c

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

metadata/panel.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@
189189
<default>42</default>
190190
<min>0</min>
191191
</option>
192+
<option name="menu_force_show_popup" type="bool">
193+
<_short>Force showing the menu popup</_short>
194+
<_long>Show the menu popup over other windows, even if it and the panel would be hidden otherwise.</_long>
195+
<default>true</default>
196+
</option>
192197
<option name="menu_min_category_width" type="int">
193198
<_short>Menu Minimum Category Width</_short>
194199
<default>200</default>

src/panel/widgets/menu.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,11 @@ void WayfireMenu::on_popover_shown()
518518
set_category("All");
519519
flowbox.unselect_all();
520520

521-
Gtk::Window *window = dynamic_cast<Gtk::Window*>(button->get_root());
522-
523-
gtk_layer_set_layer(window->gobj(), GTK_LAYER_SHELL_LAYER_OVERLAY);
521+
if (force_show_popup.value())
522+
{
523+
Gtk::Window *window = dynamic_cast<Gtk::Window*>(button->get_root());
524+
gtk_layer_set_layer(window->gobj(), GTK_LAYER_SHELL_LAYER_OVERLAY);
525+
}
524526
}
525527

526528
bool WayfireMenu::update_icon()
@@ -615,8 +617,14 @@ void WayfireMenu::setup_popover_layout()
615617
return false;
616618
}, false));
617619
button->get_popover()->add_controller(typing_gesture);
620+
618621
signals.push_back(button->get_popover()->signal_closed().connect([=] ()
619622
{
623+
if (!force_show_popup.value())
624+
{
625+
return;
626+
}
627+
620628
Gtk::Window *window = dynamic_cast<Gtk::Window*>(button->get_root());
621629
WfOption<std::string> panel_layer{"panel/layer"};
622630

src/panel/widgets/menu.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class WayfireMenu : public WayfireWidget
176176
WfOption<bool> fuzzy_search_enabled{"panel/menu_fuzzy_search"};
177177
WfOption<std::string> panel_position{"panel/position"};
178178
WfOption<std::string> menu_icon{"panel/menu_icon"};
179+
WfOption<bool> force_show_popup{"panel/menu_force_show_popup"};
179180
WfOption<int> menu_min_category_width{"panel/menu_min_category_width"};
180181
WfOption<int> menu_min_content_height{"panel/menu_min_content_height"};
181182
WfOption<bool> menu_show_categories{"panel/menu_show_categories"};

0 commit comments

Comments
 (0)