File tree Expand file tree Collapse file tree
src/panel/widgets/window-list Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,5 +336,12 @@ Set to -1 to only run it by clicking the button.
336336 </entry >
337337 </option >
338338 </group >
339+ <group >
340+ <_short >Window List</_short >
341+ <option name =" middle_click_close" type =" bool" >
342+ <_short >Middle Click Closes Windows</_short >
343+ <default >false</default >
344+ </option >
345+ </group >
339346 </plugin >
340347</wf-shell >
Original file line number Diff line number Diff line change 1111#include < gdk/gdkwayland.h>
1212#include < cmath>
1313
14-
1514#include " toplevel.hpp"
1615#include " gtk-utils.hpp"
1716#include " panel.hpp"
@@ -44,6 +43,8 @@ class WayfireToplevel::impl
4443
4544 Glib::ustring app_id, title;
4645
46+ WfOption<bool > middle_click_close{" panel/middle_click_close" };
47+
4748 public:
4849 WayfireWindowList *window_list;
4950
@@ -182,14 +183,20 @@ class WayfireToplevel::impl
182183
183184 bool on_button_press_event (GdkEventButton *event)
184185 {
185- if ((event->type == GDK_BUTTON_PRESS ) && (event->button == 3 ))
186- {
187- menu.popup (event->button , event->time );
188- return true ; // It has been handled.
189- } else
186+ if (event->type == GDK_BUTTON_PRESS )
190187 {
191- return false ;
188+ if (event->button == 3 )
189+ {
190+ menu.popup (event->button , event->time );
191+ return true ; // It has been handled.
192+ } else if ((event->button == 2 ) && middle_click_close)
193+ {
194+ zwlr_foreign_toplevel_handle_v1_close (handle);
195+ return true ;
196+ }
192197 }
198+
199+ return false ;
193200 }
194201
195202 void on_menu_minimize ()
You can’t perform that action at this time.
0 commit comments