Add: alternative setting for right-click close window option to exclude pinned windows (#10204)

This commit is contained in:
MasonGulu
2023-07-19 17:24:22 -04:00
committed by GitHub
parent 092a3db745
commit 0be27778af
6 changed files with 35 additions and 9 deletions

View File

@@ -819,8 +819,11 @@ static void DispatchRightClickEvent(Window *w, int x, int y)
if (w->OnRightClick(pt, wid->index)) return;
}
/* Right-click close is enabled and there is a closebox */
if (_settings_client.gui.right_mouse_wnd_close && (w->window_desc->flags & WDF_NO_CLOSE) == 0) {
/* Right-click close is enabled and there is a closebox. */
if (_settings_client.gui.right_click_wnd_close == RCC_YES && (w->window_desc->flags & WDF_NO_CLOSE) == 0) {
w->Close();
} else if (_settings_client.gui.right_click_wnd_close == RCC_YES_EXCEPT_STICKY && (w->flags & WF_STICKY) == 0 && (w->window_desc->flags & WDF_NO_CLOSE) == 0) {
/* Right-click close is enabled, but excluding sticky windows. */
w->Close();
} else if (_settings_client.gui.hover_delay_ms == 0 && !w->OnTooltip(pt, wid->index, TCC_RIGHT_CLICK) && wid->tool_tip != 0) {
GuiShowTooltips(w, wid->tool_tip, TCC_RIGHT_CLICK);