Fix cases when titlebar is allowed offscreen and shouldn't be (and

2006-10-13  Carlo Wood <carlo@alinoe.com>

	Fix cases when titlebar is allowed offscreen and shouldn't be (and
	vice-versa).  #333995.

	* src/display.[ch] (struct _MetaDisplay): add grab_frame_action
	member

	* src/display.[ch] (meta_display_begin_grab_op):
	* src/window.[ch] (meta_window_begin_grab_op):
	* src/core.[ch] (meta_core_begin_grab_op):
	Add frame_action parameter (core & window versions pass it on to
	display)

	* src/display.c (event_callback):
	* src/window.c (meta_window_begin_grab_op,
	  meta_window_client_message, menu_callback):
	* frames.c (meta_frames_button_press_event):
	* keybindings.c (do_choose_window, handle_begin_move,
	  handle_begin_resize, handle_workspace_switch):
	Pass whether the action should be considered a 'frame_action',
	which will be used to determine whether to force the titlebar to
	remain onscreen, to meta_*_begin_grab_op

	* constraints.c (constrain_titlebar_visible):
	Replace previous ugly hack by using grab_frame_action (and whether
	the action is a user action) to determine whether to enforce the
	titlebar_visible constraint.
This commit is contained in:
Carlo Wood
2006-10-13 00:28:34 +00:00
committed by Elijah Newren
parent a34944d341
commit d79a571d0a
10 changed files with 64 additions and 8 deletions

View File

@ -1125,13 +1125,10 @@ constrain_titlebar_visible (MetaWindow *window,
return TRUE;
/* Allow the titlebar beyond the top of the screen only if the user wasn't
* clicking on the titlebar to start the move.
* FIXME: This is kind of a hack; nearly as ugly as the old infinite edge
* resistance.
* clicking on the frame to start the move.
*/
unconstrained_user_action =
info->is_user_action &&
window->display->grab_anchor_root_y >= window->display->grab_initial_window_pos.y;
info->is_user_action && !window->display->grab_frame_action;
/* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved