mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Add unfocus action
...to enable unfocusing currently focused window on desktop click.
Works with:
    <mouse>
      <default />
      <context name="Root">
        <mousebind button="Left" action="Press">
          <action name="Unfocus" />
        </mousebind>
      </context>
    </mouse>
Fixes: #1230
			
			
This commit is contained in:
		
							parent
							
								
									d2bcb94bae
								
							
						
					
					
						commit
						29a228674b
					
				
					 2 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -27,6 +27,9 @@ Actions are used in menus and keyboard/mouse bindings.
 | 
				
			||||||
*<action name="Focus" />*
 | 
					*<action name="Focus" />*
 | 
				
			||||||
	Give focus to window under cursor.
 | 
						Give focus to window under cursor.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*<action name="Unfocus" />*
 | 
				
			||||||
 | 
						Remove focus from the window that is currently focused.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*<action name="Raise" />*
 | 
					*<action name="Raise" />*
 | 
				
			||||||
	Restack the current window above other open windows.
 | 
						Restack the current window above other open windows.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,6 +79,7 @@ enum action_type {
 | 
				
			||||||
	ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
 | 
						ACTION_TYPE_TOGGLE_ALWAYS_ON_TOP,
 | 
				
			||||||
	ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
 | 
						ACTION_TYPE_TOGGLE_ALWAYS_ON_BOTTOM,
 | 
				
			||||||
	ACTION_TYPE_FOCUS,
 | 
						ACTION_TYPE_FOCUS,
 | 
				
			||||||
 | 
						ACTION_TYPE_UNFOCUS,
 | 
				
			||||||
	ACTION_TYPE_ICONIFY,
 | 
						ACTION_TYPE_ICONIFY,
 | 
				
			||||||
	ACTION_TYPE_MOVE,
 | 
						ACTION_TYPE_MOVE,
 | 
				
			||||||
	ACTION_TYPE_RAISE,
 | 
						ACTION_TYPE_RAISE,
 | 
				
			||||||
| 
						 | 
					@ -120,6 +121,7 @@ const char *action_names[] = {
 | 
				
			||||||
	"ToggleAlwaysOnTop",
 | 
						"ToggleAlwaysOnTop",
 | 
				
			||||||
	"ToggleAlwaysOnBottom",
 | 
						"ToggleAlwaysOnBottom",
 | 
				
			||||||
	"Focus",
 | 
						"Focus",
 | 
				
			||||||
 | 
						"Unfocus",
 | 
				
			||||||
	"Iconify",
 | 
						"Iconify",
 | 
				
			||||||
	"Move",
 | 
						"Move",
 | 
				
			||||||
	"Raise",
 | 
						"Raise",
 | 
				
			||||||
| 
						 | 
					@ -745,6 +747,9 @@ actions_run(struct view *activator, struct server *server,
 | 
				
			||||||
				desktop_focus_view(view, /*raise*/ false);
 | 
									desktop_focus_view(view, /*raise*/ false);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
							case ACTION_TYPE_UNFOCUS:
 | 
				
			||||||
 | 
								seat_focus_surface(&server->seat, NULL);
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
		case ACTION_TYPE_ICONIFY:
 | 
							case ACTION_TYPE_ICONIFY:
 | 
				
			||||||
			if (view) {
 | 
								if (view) {
 | 
				
			||||||
				view_minimize(view, true);
 | 
									view_minimize(view, true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue