1
0
Fork 0
Commit graph

78 commits

Author SHA1 Message Date
Kyle Ambroff
fac7010411 If no valid window is found in the MRU list, then set focus to the desktop
2006-01-15  Kyle Ambroff  <kambroff@csus.edu>

	* src/workspace.c (focus_ancestor_or_mru_window):
	If no valid window is found in the MRU list, then set focus to the
	desktop window. (#317405)
2006-01-16 06:07:29 +00:00
Elijah Newren
703f58cdf7 Make the workspace switcher work with dual-head (non-xinerama) setups.
2005-12-27  Elijah Newren  <newren@gmail.com>

	Make the workspace switcher work with dual-head (non-xinerama)
	setups.  Fixes #319423.

	* src/display.c (meta_display_open, event_callback,
	  meta_display_focus_the_no_focus_window):
	* src/display.h (struct MetaDisplay,
	  meta_display_focus_the_no_focus_window):
	* src/keybindings.c (primary_modifier_still_pressed):
	* src/screen.c (meta_screen_new):
	* src/screen.h (struct MetaScreen):
	* src/window.c (meta_window_new_with_attrs, meta_window_show):
	* src/workspace.c (meta_workspace_focus_default_window):
	Replace display->no_focus_window with a no_focus_window for each
	screen.

	* src/display.[ch] (meta_display_xwindow_is_a_no_focus_window,
	  event_callback):
	* src/window.c (meta_window_new_with_attrs):
	New utility function, meta_display_xwindow_is_a_no_focus_window(),
	for checking if the given xwindow is a no_focus_window for one of
	the screens.
2005-12-28 06:24:30 +00:00
Elijah Newren
53cba6ed37 Oops, I only meant to commit the changes to rationales.txt in the last commit 2005-12-22 07:08:38 +00:00
Elijah Newren
7e821f37fd Add xinerama and multi-head tracker bugs 2005-12-22 06:18:38 +00:00
Elijah Newren
a7201d27d1 Merge of all the changes on the constraints_experiments branch. This is
2005-11-18  Elijah Newren  <newren@gmail.com>

	Merge of all the changes on the constraints_experiments branch.
	This is just a summary, to get the full ChangeLog of those
	changes (approx. 2000 lines):
	  cvs -q -z3 update -Pd -r constraints_experiments
	  cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog

	Bugs fixed:
	  unfiled - constraints.c is overly complicated[1]
	  unfiled - constraints.c is not robust when all constraints
	            cannot simultaneously be met (constraints need to be
	            prioritized)
	  unfiled - keep-titlebar-onscreen constraint is decoration
	            unaware (since get_outermost_onscreen_positions()
	            forgets to include decorations)
	  unfiled - keyboard snap-moving and snap-resizing snap to hidden
	            edges
	   109553 - gravity w/ simultaneous move & resize doesn't work
	   113601 - maximize vertical and horizontal should toggle and be
	            constrained
	   122196 - windows show up under vertical panels
	   122670 - jerky/random resizing of window via keyboard[2]
	   124582 - keyboard and mouse snap-resizing and snap-moving
	            erroneously moves the window multidimensionally
	   136307 - don't allow apps to resize themselves off the screen
	            (*cough* filechooser *cough*)
	   142016, 143784 - windows should not span multiple xineramas
	            unless placed there by the user
	   143145 - clamp new windows to screensize and force them
	            onscreen, if they'll fit
	   144126 - Handle pathological strut lists sanely[3]
	   149867 - fixed aspect ratio windows are difficult to resize[4]
	   152898 - make screen edges consistent; allow easy slamming of
	            windows into the left, right, and bottom edges of the
	            screen too.
	   154706 - bouncing weirdness at screen edge with keyboard moving
	            or resizing
	   156699 - avoid struts when placing windows, if possible (nasty
	            a11y blocker)
	   302456 - dragging offscreen too restrictive
	   304857 - wireframe moving off the top of the screen is misleading
	   308521 - make uni-directional resizing easier with
	            alt-middle-drag and prevent the occasional super
	            annoying resize-the-wrong-side(s) behavior
	   312007 - snap-resize moves windows with a minimum size
	            constraint
	   312104 - resizing the top of a window can cause the bottom to
	            grow
	   319351 - don't instantly snap on mouse-move-snapping, remove
	            braindeadedness of having order of releasing shift and
	            releasing button press matter so much

	   [1] fixed in my opinion, anyway.
	   [2] Actually, it's not totally fixed--it's just annoying
	       instead of almost completely unusable.  Matthias had a
	       suggestion that may fix the remainder of the problems (see
	       http://tinyurl.com/bwzuu).
	   [3] This bug was originally about not-quite-so-pathological
	       cases but was left open for the worse cases. The code from
	       the branch handles the remainder of the cases mentioned in
	       this bug.
	   [4] Actually, although it's far better there's still some minor
	       issues left: a slight drift that's only noticeable after
	       lots of resizing, and potential problems with partially
	       onscreen constraints due to not clearing any
	       fixed_directions flags (aspect ratio windows get resized in
	       both directions and thus aren't fixed in one of them)

	New feature:
	    81704 - edge resistance for user move and resize operations;
	            in particular 3 different kinds of resistance are
	            implemented:
             	 Pixel-Distance: window movement is resisted when it
	     	   aligns with an edge unless the movement is greater than
	     	   a threshold number of pixels
             	 Timeout: window movement past an edge is prevented until
	     	   a certain amount of time has elapsed during the
	     	   operation since the first request to move it past that
	     	   edge
             	 Keyboard-Buildup: when moving or resizing with the
	     	   keyboard, once a window is aligned with a certain edge
	     	   it cannot move past until the correct direction has
	     	   been pressed enough times (e.g. 2 or 3 times)

	Major changes:
	  - constraints.c has been rewritten; very few lines of code from
	    the old version remain.  There is a comment near the top of
	    the function explaining the basics of how the new framework
	    works.  A more detailed explanation can be found in
	    doc/how-constraints-works.txt
	  - edge-resistance.[ch] are new files implementing edge-resistance.
	  - boxes.[ch] are new files containing low-level error-prone
	    functions used heavily in constraints.c and edge-resistance.c,
	    among various places throughout the code.  testboxes.c
	    contains a thorough testsuite for the boxes.[ch] functions
	    compiled into a program, testboxes.
	  - meta_window_move_resize_internal() *must* be told the gravity
	    of the associated operation (if it's just a move operation,
	    the gravity will be ignored, but for resize and move+resize
	    the correct value is needed)
	  - the craziness of different values that
	    meta_window_move_resize_internal() accepts has been documented
	    in a large comment at the beginning of the function.  It may
	    be possible to clean this up some, but until then things will
	    remain as they were before--caller beware.
	  - screen and xinerama usable areas (i.e. places not covered by
	    e.g. panels) are cached in the workspace now, as are the
	    screen and xinerama edges.  These get updated with the
	    workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 14:58:50 +00:00
Elijah Newren
7ef871f73a Fix a crash that occurs when removing some virtual desktops and windows
2005-10-08  Elijah Newren  <newren@gmail.com>

	Fix a crash that occurs when removing some virtual desktops and
	windows happen to be on those desktops.  #318306.

	* src/workspace.c (meta_workspace_relocate_windows): Since windows
	cannot be on more than one workspace at a time, remove the window
	from the old workspace before adding it to the new one.
2005-10-08 23:18:05 +00:00
Elijah Newren
29e38a2f53 Add my copyright notice to a number of files on which it should already
2005-10-08  Elijah Newren  <newren@gmail.com>

	Add my copyright notice to a number of files on which it should
	already exist.
2005-10-08 19:38:54 +00:00
Elijah Newren
ea4cd88285 Patch from Björn Lindqvist fix the workspace switcher tabpopup to display
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Björn Lindqvist fix the workspace switcher tabpopup to
	display the right windows and to fix the
	pick-a-new-window-to-focus algorithm in order to not select
	windows that aren't showing.  Fixes #170475.

	* src/tabpopup.c (meta_convert_meta_to_wnck,
	meta_select_workspace_expose_event): factor out conversion code
	from meta_select_workspace_expose_event() into the new
	meta_convert_meta_to_wnck() function

	* src/tabpopup.c (meta_select_workspace_expose_event):
	* src/workspace.c (focus_ancestor_or_mru_window):
	replace the buggy window->minimized logic with
	!meta_window_showing_on_its_workspace (window)
2005-10-03 19:06:17 +00:00
Elijah Newren
612507260a Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes #167545.
2005-02-21  Elijah Newren  <newren@gmail.com>

	Handle keynav vs. mousenav in mouse and sloppy focus modes.  Fixes
	#167545.

	* doc/how-to-get-focus-right.txt: Update due to this new method
	for handling keynav vs. mousenav, plus various other updates that
	I previously forgot.

	* src/display.h: (struct _MetaDisplay): add a mouse_mode boolean

	* src/display.c: (meta_display_open): initialize mouse_mode to
	true, (event_callback): have EnterNotify and LeaveNotify events
	set mouse_mode to true when focusing a window

	* src/keybindings.c: (process_tab_grab): set mouse_mode to false
	when using alt-tab/alt-esc, (do_choose_window): likewise,
	(do_handle_move_to_workspace): set mouse_mode to false on
	move-window-to-workspace-<n> keybindings

	* src/window.c (idle_calc_showing): if we're in keynav mode while
	using sloppy or mouse focus, use metacity_sentinel to avoid
	EnterNotify events being generated from events other than mouse
	movement.

	* src/workspace.c (meta_workspace_activate_with_focus): add a
	FIXME in a potentially duplicate section of code,
	(meta_workspace_focus_default_window): use the same focus choice
	as click-to-focus if in keynav mode.
2005-02-22 02:11:25 +00:00
Elijah Newren
de5588c10e Focus parents of dismissed transient windows in preference to the window
2005-02-02  Elijah Newren  <newren@gmail.com>

	Focus parents of dismissed transient windows in preference to the
	window that most recently had keyboard focus.  Fixes #157360.

	* doc/how-to-get-focus-right.txt: Note the distinction between
	"most recently used window" and "most recent to have keyboard
	focus" that we are now making.

	* src/workspace.c: (focus_ancestor_or_mru_window): rename from
	meta_workspace_focus_mru_window, and first check whether we need
	to focus an ancestor window before looking for the mru window,
	(record_ancestor): helper function for
	focus_ancestor_or_mru_window,
	(meta_workspace_focus_default_window): update due to the function
	rename from meta_workspace_focus_mru_window to
	focus_ancestor_or_mru_window
2005-02-02 18:46:09 +00:00
Elijah Newren
e46fc46701 Rename meta_window_visible_on_workspace to
2004-12-22  Elijah Newren  <newren@gmail.com>

	* src/core.c (meta_core_user_lower_and_unfocus):
	* src/display.c (meta_display_get_current_tab):
	* src/stack.c (get_default_focus_window, meta_stack_list_windows):
	* src/window.c (set_net_wm_state, meta_window_should_be_showing,
	implement_showing, meta_window_activate,
	meta_window_notify_focus):
	* src/window.h:
	* src/workspace.c (meta_workspace_list_windows):

	Rename meta_window_visible_on_workspace to
	meta_window_located_on_workspace (whether or not the window was
	showing wasn't taken into account, which made "visible"
	confusing).  Fixes #136314.
2004-12-23 00:20:33 +00:00
Elijah Newren
f4f8699d84 Partially resolve the conflicting requirements of windows on multiple
2004-12-22  Elijah Newren  <newren@gmail.com>

	Partially resolve the conflicting requirements of windows on
	multiple workspaces and hidden being a global quantity for windows
	(fixes bug 156182; the remainder of the work is bug 87531 and is a
	libwnck issue)

	* src/display.c (event_callback):
	* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
	* src/workspace.c (meta_workspace_add_window,
	meta_workspace_contains_window,
	meta_workspace_queue_calc_showing):
	* src/workspace.h:

	Remove meta_workspace_contains_window, replace with simple
	comparison utilizing window->workspace

	* src/place.c (meta_window_place):
	* src/window.c (meta_window_shares_some_workspace):
	* src/window.h:

	Remove meta_window_shares_some_workspace, replace with a simple
	comparison utilizing window->workspace

	* src/session.c (save_state),
	* src/window.c (meta_window_new_with_attrs,
	meta_window_apply_session_info, meta_window_free,
	window_showing_on_its_workspace,
	meta_window_change_workspace_without_transients,
	meta_window_unstick, meta_window_set_current_workspace_hint,
	meta_window_get_workspaces):
	* src/window.h:
	* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
	meta_workspace_remove_window):

	Only one workspace now
2004-12-22 23:52:52 +00:00
Elijah Newren
e84778d1eb Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16  Elijah Newren  <newren@math.utah.edu>

	Make the "showing desktop" mode be per-workspace instead of
	per-screen. (fixes #142198)

	* src/keybindings.c (handle_toggle_desktop): access
	showing_desktop through the active workspace

	* src/screen.c (meta_screen_new): remove initialization of
	screen->showing_desktop,
	(meta_screen_update_showing_desktop_hint): rename and make not
	static and access showing_desktop through the active workspace,
	(queue_windows_showing): replace meta_display_list_windows() with
	screen->active_workspace->windows,
	(meta_screen_minimize_all_on_active_workspace_except): renamed
	from meta_screen_minimize_all_except since it now only works on
	the active workspace, (meta_screen_show_desktop,
	meta_screen_unshow_desktop): access showing_desktop through the
	active workspace

	* src/screen.h (struct _MetaScreen): remove showing_desktop field,
	(meta_screen_minimize_all_on_active_workspace_except): rename from
	meta_screen_minimize_all_except,
	(meta_screen_update)_showing_desktop_hint): export this function too

	* src/window.c (maybe_leave_show_desktop_mode): access
	showing_desktop through the active workspace and use new name for
	meta_screen_minimize_all_on_active_workspace_except,
	(window_should_be_showing): access showing_desktop through the
	active workspace

	* src/workspace.c (meta_workspace_new): initialize
	workspace->showing_desktop, (meta_workspace_activate_with_focus):
	add note that old can be NULL, update showing_desktop_hint if
	different on this workspace than the previous one

	* src/workspace.h (struct _MetaWorkspace): add showing_desktop
	field
2004-10-17 04:28:29 +00:00
Elijah Newren
70e40c235c Fix a variety of issues with autoraise (#134206)
2004-10-04  Elijah Newren  <newren@math.utah.edu>

	Fix a variety of issues with autoraise (#134206)

	* src/display.h: (struct _MetaDisplay): add an autoraise_window
	parameter

	* src/display.[hc] (meta_display_focus_the_no_focus_window): new
	function, (meta_display_queue_autoraise_callback): new function,
	(meta_display_remove_autoraise_callback): new function

	* src/display.c (meta_display_open): intialize
	display->autoraise_window too, (meta_display_close): remove any
	pending autoraise callback, (window_raise_with_delay_callback):
	clear out auto_raise->display->autoraise_window too,
	(event_callback): call meta_display_queue_autoraise_callback
	instead of having the code inline, call
	meta_display_focus_the_no_focus_window to handle focusing that
	window

	* src/window.c (meta_window_focus): If there's a window with an
	autoraise timeout that isn't the window being focused, remove the
	autoraise timeout

	* src/workspace.c (meta_workspace_focus_default_window): If no
	autoraise timeout is queued for the given window then queue one
	now, call meta_display_focus_the_no_focus_window to handle
	focusing that window, (meta_workspace_focus_mru_window): call
	meta_display_focus_the_no_focus_window to handle focusing that
	window
2004-10-04 21:09:08 +00:00
Elijah Newren
16b9aff47c Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04  Elijah Newren  <newren@math.utah.edu>

	Fix a variety of focus race conditions in all focus modes, or at
	least make them harder to trigger (fixes #152000)

	* src/core.[ch] (meta_core_user_lower_and_unfocus): add a
	timestamp parameter; pass it along to
	meta_workspace_focus_default_window

	* src/display.[ch] (meta_display_get_current_time_roundtrip): new
	function

	* src/display.c (event_callback): pass a timestamp to the
	meta_workspace_activate and meta_workspace_focus_default_window
	function calls

	* src/frames.c (meta_frames_button_press_event): pass a timestamp
	to meta_core_user_lower_and_unfocus

	* src/keybindings.c (handle_activate_workspace): pass a timestamp
	to meta_workspace_activate, (process_workspace_switch_grab): pass
	a timestamp to meta_workspace_focus_default_window and
	meta_workspace_activate, (handle_toggle_desktop): pass a timestamp
	to meta_workspace_focus_default_window,
	(do_handle_move_to_workspace): pass a timestamp to
	meta_workspace_activate_with_focus, (handle_workspace_switch):
	meta_workspace_activate

	* src/screen.c (meta_screen_new): pass a timestamp to
	meta_workspace_activate

	* src/window.c (meta_window_free): pass a timestamp to
	meta_workspace_focus_default_window, (idle_calc_showing): don't
	increment the focus sentinel here, (meta_window_minimize): pass a
	timestamp to meta_workspace_focus_default_window,
	(meta_window_client_message), pass a timestamp to
	meta_workspace_focus_default_window

	* src/workspace.h (meta_workspace_activate): add timestamp
	parameter, (meta_workspace_activate_with_focus): add timestamp
	parameter, (meta_workspace_focus_default_window): add timestamp
	parameter

	* src/workspace.c (meta_workspace_focus_mru_window): make this
	function take a timestamp and use it for meta_window_focus or
	XSetInputFocus, (meta_workspace_activate_with_focus): make this
	function take a timestamp and pass it along to meta_window_focus
	and meta_workspace_focus_default_window,
	(meta_workspace_activate): make this function take a timestamp and
	pass it to meta_workspace_activate_with_focus),
	(meta_workspace_focus_default_window): make this function take a
	timestamp, warn if its 0 but try to handle that case sanely, and
	pass the timestamp on to meta_window_focus or
	meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 20:32:59 +00:00
Elijah Newren
7ee43e5a36 Don't focus a window that is minimized (fixes #147947)
2004-09-17  Elijah Newren  <newren@math.utah.edu>

	* src/workspace.c (meta_workspace_focus_mru_window): Don't focus a
	window that is minimized (fixes #147947)
2004-09-17 19:49:32 +00:00
Elijah Newren
cffe7e9566 Focus the no_focus_window if no suitable window is in the mru list (should
2004-09-15  Elijah Newren  <newren@math.utah.edu>

	Focus the no_focus_window if no suitable window is in the mru list
	(should fix the almost contrived extra issue found in #147475)

	* doc/how-to-get-focus-right.txt: We no longer need to lie about
	only focusing panels upon explicit request.

	* src/workspace.c: (meta_workspace_focus_top_window): removed this
	function--it was more code than needed and was unreliable anyway,
	(meta_workspace_focus_mru_window): if a suitable window isn't in
	the mru list, focus the no_focus_window instead of calling
	focus_top_window.
2004-09-15 16:53:20 +00:00
Elijah Newren
101a097f02 Prevent focus inconsistencies by only providing one focus method (fixes
2004-09-15  Elijah Newren  <newren@math.utah.edu>

	Prevent focus inconsistencies by only providing one focus method
	(fixes #151990)

	* src/screen.c (meta_screen_show_desktop): remove call to
	meta_workspace_focus_top_window (it was merely focusing a window
	that was going to be hidden anyway, and likely the one that
	already had focus)

	* src/workspace.[hc]: remove meta_workspace_focus_mru_window and
	meta_workspace_focus_top_window from workspace.h, make them static
	functions in workspace.c
2004-09-15 16:42:52 +00:00
Elijah Newren
522e9916b6 Prevent an assertion failure that can occur after increasing the number of
2004-08-27  Elijah Newren  <newren@math.utah.edu>

	Prevent an assertion failure that can occur after increasing the
	number of workspaces; also fix a warning and stacking order when a
	window is denied focus (fixes #150615)

	* src/window.c (meta_window_stack_just_below): the position of the
	window should be set equal to that of the one we want to be below,
	not 1 lower than that number

	* src/workspace.c (maybe_add_to_list): new function to add
	on_all_workspace windows to an mru_list, (meta_workspace_new):
	call maybe_add_to_list for all windows on the screen in order to
	initialize the mru_list
2004-08-27 17:22:54 +00:00
Elijah Newren
385248044d prevent keyboard from "getting locked" upon workspace switch, by making
2004-08-06  Elijah Newren  <newren@math.utah.edu>

	* src/workspace.c (meta_workspace_focus_default_window): prevent
	keyboard from "getting locked" upon workspace switch, by making
	sure that the no_focus_window has focus if no other window does.
	(fixes #147475)
2004-08-06 18:13:55 +00:00
Elijah Newren
cd09a27aa6 Fix some bugs (reported in #120100) regarding the focus window when using
2004-08-02  Elijah Newren  <newren@math.utah.edu>

	Fix some bugs (reported in #120100) regarding the focus window
	when using the workspace switcher.

	* src/display.c (event_callback): When switching workspaces due to
	a _NET_CURRENT_DESKTOP message, make sure to focus the default
	window as well.

	* src/workspace.c (meta_workspace_focus_default_window,
	meta_workspace_focus_mru_window): Make DOCK or DESKTOP windows
	have lower priority than others when choosing a window to focus.
	(For the former function, this means don't focus them at all; for
	the latter, this means only focus them (via the
	meta_workspace_focus_top_window call) if no other mru window can
	be found.)
2004-08-02 19:23:03 +00:00
Elijah Newren
9d1d8fa062 Make choice of focus window be consistent for each focus mode. Fixes
2004-06-24  Elijah Newren  <newren@math.utah.edu>

	Make choice of focus window be consistent for each focus mode.
	Fixes #135810.

	* src/delete.c: (meta_window_delete): In some #if 0'ed code,
	replace meta_workspace_focus_mru_window with
	meta_workspace_focus_default_window (just in case the code becomes
	un-#if 0'ed out).

	* src/screen.c, src/screen.h: Change
	meta_screen_focus_mouse_window to meta_screen_get_mouse_window,
	and don't focus the window when found but rather return it.

	* src/window.c: (meta_window_free, meta_window_minimize): replace
	meta_workspace_focus_mru_window with
	meta_workspace_focus_default_window.

	* src/workspace.c: (meta_workspace_focus_default_window): Focus
	appropriately for the given focus method:
	   click-to-focus: focus MRU window (== toplevel window)
	   sloppy focus:   focus the window under the pointer if there is
	                   such a window, otherwise focus the mru window
	   mouse focus:    focus the window under the pointer if there is
	                   such a window, otherwise don't focus anything
2004-06-24 20:02:46 +00:00
Rob Adams
16a8add6f8 only move on MRU list if the window belongs on the workspace, since the
2004-02-27  Rob Adams  <readams@readams.net>

	* src/window.c (meta_window_notify_focus): only move on MRU list
	if the window belongs on the workspace, since the FocusIn event
	could be for a window whose workspace we've since switched away
	from.  Possible fix for #122016.

	* src/workspace.c (meta_workspace_contains_window): search for the
	workspace in window->workspaces rather than the window in
	workspace->windows.  Since the number of workspaces is at most 36,
	this is a O(1) lookup rather than a O(n) lookup.  Sorry; couldn't
	resist.
2004-02-28 02:53:56 +00:00
Rob Adams
db108c1fc3 Add my copyright notice to a number of files on which it should already
2004-02-23  Rob Adams  <readams@readams.net>

	Add my copyright notice to a number of files on which it should
	already exist.

	* src/window.c (meta_window_notify_focus): modify code to move to
	front of MRU list so that we can have an assert that it was there
	in the first place.  This code may be causing some crashes.  See
	#131196.
2004-02-23 01:48:29 +00:00
Elijah Newren
339719568f Prepend windows to mru list when switching workspaces. Fixes #134368 2004-02-15 14:27:43 +00:00
Rob Adams
fd13022dc4 If we're moving a window and receive a _NET_CURRENT_DESKTOP message
2004-02-14  Rob Adams  <readams@readams.net>

	If we're moving a window and receive a _NET_CURRENT_DESKTOP
	message indicating a workspace switch, bring along the drag window
	to the new workspace, solving a potentially weird bug where the
	window would be lost on the old workspace.  This also makes it
	possible to implement edge flipping in an external program with
	just a few lines of code.  Patch for #131630 from ed@catmur.co.uk.

	* src/keybindings.c (switch_to_workspace): remove function -- no
	longer needed.
	(handle_activate_workspace): call meta_workspace_activate instead
	of switch_to_workspace

	* src/workspace.c (meta_workspace_activate_with_focus): if we're
	in a move grab op, bring along the drag window.
2004-02-15 05:29:49 +00:00
Rob Adams
104786735a initialize grab_wireframe_active to FALSE. Fix for #128090.
2003-12-17  Rob Adams  <readams@readams.net>

	* src/display.c (meta_display_open): initialize
	grab_wireframe_active to FALSE.  Fix for #128090.

2003-12-17  Rob Adams  <readams@readams.net>

	* src/tabpopup.c (meta_ui_tab_popup_new): Don't try to call
	utf8_strndup on a null title for an entry.  Fix for #128566.

	* src/workspace.c (meta_workspace_free): Call g_list_free on the
	mru_list, since with sticky windows that MRU list could well not
	be emtpy.  See #122016.
2003-12-17 16:01:00 +00:00
Rob Adams
191b3f2c21 set on_all_workspaces in all cases _before_ adding to the workspaces, so
2003-12-13  Rob Adams  <readams@readams.net>

	* src/window.c (meta_window_new_with_attrs): set on_all_workspaces
	in all cases _before_ adding to the workspaces, so that windows
	initially on all workspaces are added correctly to the MRU lists.
	Fix for #120907.

	* src/workspace.c (meta_workspace_add_window): handle sticky
	windows so that we add to add mru lists if needed
	(meta_workspace_remove_window): handle sticky windows so that they
	are removed from all mru lists if needed.
2003-12-14 19:19:40 +00:00
Rob Adams
9bde925d3d Revert prior change 2003-12-13 23:00:06 +00:00
Rob Adams
7630d22b8d Add increased robustness for dealing with all workspaces windows and MRU
2003-12-13  Rob Adams  <readams@readams.net>

	Add increased robustness for dealing with all workspaces windows
	and MRU lists.
	Also add very preliminary _NET_WM_USER_TIME
	support, limited to simply listening for the property and keeping
	an internal variable updated, and also treating some input events
	as though they were user time updates.

	* src/window.c (meta_window_new_with_attrs): set on_all_workspaces
	in all cases _before_ adding to the workspaces, so that windows
	initially on all workspaces are added correctly to the MRU lists.
	Fix for #120907.
	(process_property_notify): add net_wm_user_time support.

	* src/workspace.c (meta_workspace_add_window): handle sticky
	windows so that we add to add mru lists if needed
	(meta_workspace_remove_window): handle sticky windows so that they
	are removed from all mru lists if needed.

	* src/display.[ch] (meta_display_open): add net_wm_user_time support.
	(event_callback): simulate user time update on key and button presses.

	* src/screen.c (set_supported_hint): add net_wm_user_time support.

	* src/window-props.c (init_net_wm_user_time): new function for
	user_time support
	(reload_net_wm_user_time): new function for user_time support
	(meta_display_init_window_prop_hooks): add hook for user_time
2003-12-13 18:28:14 +00:00
Havoc Pennington
a92be6e319 unstick window to get it out of mru_list it should not be in; assert that
2003-12-12  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_free): unstick window to get it out of
	mru_list it should not be in; assert that window has been removed
	from all mru_list. Perhaps fixes #122016 crash.
2003-12-13 03:58:55 +00:00
Rob Adams
de44b2d794 Fix a bug with partial-width panel struts caused by incorrect computation
2003-09-19  Rob Adams <readams@readams.net>

	Fix a bug with partial-width panel struts caused by incorrect
	computation of rectangle widths, and another when using different
	screen resolutions on xineramas.  See #122404.  Also fix a crash
	bug with the MRU list when sticking and unsticking windows.  See
	#120809.

	* src/constraints.c (get_outermost_onscreen_positions): Fix
	off-by-one error with partial-width struts.

	* src/window.c (meta_window_update_struts): Fix off-by-one error
	with partial-width struts.
	(meta_window_stick): assign back to GList after g_list_append
	(meta_window_unstick): assign back to GList after g_list_append

	* src/workspace.c (ensure_work_areas_validated): For right and
	bottom struts, compute strut relative to root window and not to
	xinerama edge in compliance with EWMH recommendations.
2003-09-20 04:58:25 +00:00
Ray Strode
2fc880db19 Changed MRU list to be per workspace instead of per display, so sticky
2003-08-15  Ray Strode  <halfline@hawaii.rr.com>

	Changed MRU list to be per workspace instead of per display, so
	sticky windows don't hijack the window focus after workspace
	switching (Bug #97635).

	* src/delete.c (meta_window_delete): Use
	meta_workspace_focus_top_window instead of
	meta_screen_focus_top_window.

	* src/display.c (meta_display_open): Stop using display->mru_list.
	(find_tab_forward):
	(find_tab_backward):
	(meta_display_get_tab_list): Use workspace->mru_list instead of
	display->mru_list and remove unneeded calls to
	meta_window_visible_on_workspace

	* src/display.h: Remove mru_list from MetaDisplay

	* src/keybindings.c (handle_toggle_desktop): Use
	meta_workspace_focus_top_window instead of
	meta_screen_focus_top_window.

	* src/screen.c (meta_screen_focus_top_window):
	(meta_screen_focus_default_window): Remove functions.
	(meta_screen_show_desktop): Use meta_workspace_focus_top_window
	instead of meta_screen_focus_top_window.

	* src/screen.h: Remove meta_screen_focus_top_window and
	meta_screen_focus_default_window declarations.

	* src/window.c (meta_window_new): Stop using display->mru_list.
	(meta_window_free): Use meta_workspace_focus_top_window
	instead of meta_screen_focus_top_window and stop using
	display->mru_list.
	(meta_window_stick): Add sticky window to all workspace MRU lists.
	(meta_window_unstick): Remove non-sticky window from the workspace
	MRU lists it doesn't belong in.
	(meta_window_notify_focus): Move newly focused window to the front
	of active workspace's MRU list.

	* src/workspace.c (meta_workspace_new): Initialize
	workspace->mru_list to NULL.
	(meta_workspace_add_window): Add window to workspace's MRU list.
	(meta_workspace_remove_window): Remove window from workspace's MRU
	list.
	(meta_workspace_activate_with_focus): Use
	meta_workspace_focus_default_window instead of
	meta_screen_focus_default_window.
	(meta_workspace_focus_default_window):
	(meta_workspace_focus_mru_window):
	(meta_workspace_focus_top_window): Add functions.

	* src/workspace.h: Add mru_list to MetaWorkspace and add function
	declarations for meta_workspace_focus_default_window,
	meta_workspace_focus_mru_window, meta_workspace_focus_top_window.
2003-08-15 22:09:55 +00:00
Havoc Pennington
fa075eb8f1 nuke the lists of struts here, to improve confidence that we never try to
2003-06-26  Havoc Pennington  <hp@pobox.com>

	* src/workspace.c (meta_workspace_invalidate_work_area): nuke the
	lists of struts here, to improve confidence that we never try to
	use them after a window with rects in the list gets freed.
	(it wasn't broken before I don't think, just making the
	code more robust against future mods)

	* src/window.c (meta_window_update_struts): replace magic "75"
	with a macro

	* src/constraints.c (constraint_hints_applies_func): don't apply
	hints to maximized or fullscreen, rather than only fullscreen
	(constrain_move): add paranoia max number of iterations to the
	heuristic loop
2003-06-28 16:12:32 +00:00
Rob Adams
971f3f1207 Update constraints code to support the new _NET_WM_STRUT_PARTIAL EWMH
2003-06-10  Rob Adams  <robadams@ucla.edu>

	Update constraints code to support the new _NET_WM_STRUT_PARTIAL
	EWMH draft specification.  See #86682.  Also, fix a bug involving
	work area invalidation on metacity startup.  Fix for #108497.
	Finally, some minor fixes for full screen windows.

	* src/window.h: Add new MetaStruts structure to store strut rects
	for a window.  Remove has_struts and do_not_cover flag, and
	support new MetaStruts instead of the four ints.

	* src/window.c (meta_window_new): change initialization to work
	with new struts.  Also, move meta_window_update_struts call to
	after the workspaces are initialized to fix #108497.  Remove
	do_not_cover and related code.
	(process_property_notify): add strut_partial
	(update_struts): change function name to meta_window_update_struts
	and expose in external MetaWindow API.  Support partial width
	struts and the new strut rects.

	* src/workspace.h: add new GSLists containing pointers to all
	relevant struts for this workspace.

	* src/workspace.c (meta_workspace_new): initialize the list of
	strut rects for this workspace.
	(meta_workspace_free): free the strut rect lists
	(ensure_work_areas_validated): support new struts and new strut
	rect lists.  Unleash the per-xinerama work areas.

	* src/constraints.c (get_outermost_onscreen_positions): Use the
	current window position along with the new per-workspace strut
	rects to compute the constraints that apply to a particular
	window.
	(constraint_hint_applies_func): don't do hints constraints on
	fullscreen windows
	(update_position_limits): for maximized windows use the work areas
	to set the position limits; for other windows rely on the struts
	constraints to be computed later in
	get_outermost_onscreen_positions
	(meta_window_constrain): don't apply aspect ratio hints to full
	screen windows

	* src/display.c (meta_display_open): add _NET_WM_STRUT_PARTIAL atom
	(meta_rectangle_equal): new helper function for MetaRectangles
	(event_queue_callback): #ifndef out if USE_GDK_DISPLAY not set to
	avoid compiler warning

	* src/display.h: add atom_net_wm_strut_partial, and add
	meta_rectangle_equal.

	* src/screen.c (meta_screen_rect_intersects_xinerama): change
	_window_intersects_ to _rect_intersects_ which is more useful now.
	(meta_screen_resize_func): update struts on windows with struts
	since struts are relative to the screen size, and this function is
	called when the screen size updates.

	* src/screen.h (meta_screen_rect_intersects_xinerama): change
	_window_intersects_ to _rect_intersects_ which is more useful now.

	* src/window-props.c (meta_display_init_window_prop_hooks): add
	hook for strut_partial

	* src/tools/metacity-window-demo.c: Support partial-width struts
	on the dock window tests for metacity testing purposes.
2003-06-26 03:09:38 +00:00
Rob Adams
3edad8599c CVS2003-05-29 Rob Adams <robadams@ucla.edu>
CVS2003-05-29  Rob Adams  <robadams@ucla.edu>

	Use a new property _METACITY_SENTINEL to eliminate a race
	condition that causes focus to behave badly with sloppy/mouse
	focus when lots of windows are mapped/unmapped, such as with a
	workspace switch.  The EnterNotify events on a display are ignored
	until the PropertyNotify sent after all the window maps is
	received.  This is a fix for #110970.

	* src/display.[ch]: New _METACITY_SENTINEL atom.
	(event_callback): ignore EnterNotify if the sentinel isn't clear,
	and decrement the sentinel counter when the PropertyNotify is
	received.
	(meta_display_increment_focus_sentinel): new function.  Increments
	the sentinel counter and updates the property on a root window on
	this display.
	(meta_display_decrement_focus_sentinel): Decrement the sentinel
	counter.
	(meta_display_focus_sentinel_clear): returns whether the sentinel
	counter is zero.

	* src/window.c (idle_calc_showing): after showing windows, call
	meta_display_increment_focus_sentinel on each display for windows
	to be shown.

	* src/workspace.[ch] (meta_workspace_activate_with_focus): new
	function activates a workspace and focuses a particular window
	after the workspace is activated.
	(meta_workspace_activate): now just a wrapper for
	meta_workspace_activate_with_focus

	* src/keybindings.c: use new meta_workspace_activate_with_focus
	function to ensure that focus will follow the focused window
	through the workspace switch.

: ----------------------------------------------------------------------
2003-05-30 20:24:00 +00:00
Havoc Pennington
c27d89218c Patch from Rob Adams addresses #95014 (placement issues), makes first fit
2003-02-23  Havoc Pennington  <hp@pobox.com>

	Patch from Rob Adams addresses #95014 (placement issues),
	makes first fit algorithm "center tile", adds most code
	for per-xinerama workspaces (#86682) but disables it for now.

	* src/workspace.c (meta_workspace_get_work_area_for_xinerama)
	(meta_workspace_get_work_area_all_xineramas): new xinerama
	functions, maintain workspace->work_areas with a different
	work area for each xinerama. However for now all the work
	areas are the same, because haven't quite figured out how
	_NET_WM_STRUT is supposed to work

	* src/window.c: adapt to new meta_window_* xinerama APIs
	(meta_window_get_work_area_current_xinerama): new xinerama
	API
	(meta_window_get_work_area_for_xinerama): new xinerama API
	(constrain_position): be a bit more clever about which xinerama's
	work area we choose to use.

	* src/stack.c: adapt to new Xinerama API

	* src/screen.c (reload_xinerama_infos): invalidate all work areas
	(meta_screen_get_xinerama_for_rect): new function
	(meta_screen_window_intersects_xinerama): new function

	* src/place.c (find_first_fit): change to use
	"center tiling" (center a screen full of tiled windows,
	rather than aligning them top left). Adapt to new
	xinerama functions.
2003-02-23 17:09:46 +00:00
Havoc Pennington
82bd20911c Fix for the "mangles focus window when switching workspaces and using
2003-01-21  Havoc Pennington  <hp@pobox.com>

        Fix for the "mangles focus window when switching workspaces
	and using mouse focus" bug

	* src/stack.c (meta_stack_get_default_focus_window_at_point): new
	function

	* src/screen.c (meta_screen_focus_mouse_window): new function
	(meta_screen_focus_default_window): new function

	* src/workspace.c (meta_workspace_activate): use the
	new meta_screen_focus_default_window()

2003-01-17  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_handle_mouse_grab_op_event): fix event
	compression code to use GDK algorithm suggested by Owen, should be
	more efficient.
2003-01-22 04:54:04 +00:00
Havoc Pennington
90748385c2 redo using new calc_workspace_layout to fix #98302
2003-01-05  Havoc Pennington  <hp@pobox.com>

	* src/workspace.c (meta_workspace_get_neighbor): redo using new
	calc_workspace_layout to fix #98302

	* src/util.c (topic_name): shorten default prefix

	* src/screen.c (meta_screen_calc_workspace_layout): enhance this
	to handle all the funky layouts and calculate more information
	than before
2003-01-05 18:36:01 +00:00
Havoc Pennington
8d314aead8 make this always return FALSE for now, to avoid bug reports.
2002-12-08  Havoc Pennington  <hp@pobox.com>

	* src/prefs.c (meta_prefs_get_application_based): make this always
	return FALSE for now, to avoid bug reports.

	* src/util.c (ensure_logfile): put "opened log file" message on
	stderr so it will normally land in ~/.xsession-errors

	* configure.in: remove extra AC_ARG_PROGRAM

	* src/display.c (event_callback): handle the toggle-verbose message

	* src/tools/metacity-message.c: add a toggle-verbose message, been
	meaning to do this for a while.

	* src/util.c (meta_set_verbose): if verbose mode is enabled and we
	don't support it, then exit.

	* src/prefs.c: allow building without gconf (currently means some
	prefs are no-ops)

	* src/util.c, src/util.h: support defining macros to
	kill all verbose output entirely. (Removes the code and strings
	associated with it)

	* configure.in: don't get METACITY_PROPS_LIBS if not building the
	config dialog.
	(HAVE_GCONF): allow building sans gconf, if you are size-sensitive
	and not using gnome.
	(WITH_VERBOSE_MODE): add ability to disable all the verbose debug
	spew strings, to shrink the binary.
	(--disable-sm): allow SM support to be forced on or off
	(--disable-startup-notification): allow forcing this on or off
2002-12-08 19:17:17 +00:00
Havoc Pennington
6557627d8f remove unused variable
2002-11-20  Havoc Pennington  <hp@pobox.com>

	* src/window-props.c (set_icon_title): remove unused variable

	* src/screen.c (meta_screen_new): read an existing
	_NET_CURRENT_DESKTOP and restore it if set. Makes a restart even
	less visible.

	* src/workspace.c (set_active_space_hint): don't set the hint
	during the process of unmanaging a screen
2002-11-21 04:48:53 +00:00
Mark McLoughlin
bc3b64f922 impl for nice debugging. (meta_workspace_get_neighbor): fix broken logic
2002-11-08  Mark McLoughlin  <mark@skynet.ie>

        * src/workspace.c:
        (meta_motion_direction_to_string),
        (meta_screen_corner_to_string): impl for nice debugging.
        (meta_workspace_get_neighbor): fix broken logic and
        cleanup debugging.
2002-11-07 23:13:12 +00:00
Havoc Pennington
a64b868dbd apply patch from Nikos Mouat to fix this function
2002-11-05  Havoc Pennington  <hp@redhat.com>

	* src/workspace.c (meta_workspace_get_neighbor): apply patch from
	Nikos Mouat to fix this function
2002-11-05 19:25:06 +00:00
Havoc Pennington
6a1abc7482 new function, and remove workspace->name field, instead just get the name
2002-11-03  Havoc Pennington  <hp@pobox.com>

	* src/workspace.c (meta_workspace_get_name): new function,
	and remove workspace->name field, instead just get the
	name from prefs each time

	* src/screen.c (meta_screen_update_workspace_names): update the
	gconf key to persist workspace names here, instead of changing
	the names we use

	* src/util.c (topic_name): add META_DEBUG_PREFS

	* src/prefs.c: change NUM_COMMANDS to 32 to allow more custom
	commands, implement workspace names

	* src/metacity.schemas.in: add workspace_names/name_NN gconf keys.
2002-11-03 19:06:39 +00:00
Havoc Pennington
c6b475b251 Optimizations for managing new windows (do not all take effect if
2002-10-21  Havoc Pennington  <hp@redhat.com>

	Optimizations for managing new windows (do not all take effect if
	METACITY_DEBUG=1). Bug #96404

	* src/keybindings.c (meta_change_keygrab): use error trap nesting
	and conditionalize on meta_is_verbose() to avoid a ton of XSync

	* src/display.c (meta_change_button_grab): ditto

	Throughout: move to new error trap setup to save on XSync calls,
	new setup is:

	* src/errors.c (meta_error_trap_push_with_return): new function,
	an error trap that needs to care about return value and thus
	sync even if an outer trap still exists
	(meta_error_trap_pop_with_return): new function
	(meta_error_trap_pop): add "last_request_was_roundtrip"
	argument allowing us to avoid XSync() if we just did
	a GetProperty or whatever.

	* src/util.c (meta_warning): flush the warning file descriptor

	* src/Makefile.am (INCLUDES): define G_LOG_DOMAIN
2002-10-21 21:44:35 +00:00
Havoc Pennington
337812d51d workspaces are all per-screen now, fix accordingly
2002-10-16  Havoc Pennington  <hp@redhat.com>

	* src/workspace.c: workspaces are all per-screen now, fix
	accordingly

	* src/core.c: fix multihead workspace stuff

	* src/keybindings.c: multihead-rama

	* src/screen.c (meta_screen_show_desktop): new functions to
	replace display equivalents

	* src/display.c (meta_display_get_workspace_by_screen_index): get
	rid of this
	(meta_display_get_workspace_by_index): get rid of this
	(event_callback): handle _NET_SHOWING_DESKTOP message per-screen

	* src/screen.c (meta_screen_get_workspace_by_index): new function

	* src/screen.h (struct _MetaScreen): move workspace list, and
	showing_desktop flag, to be per-screen

	* src/window.c (window_query_root_pointer): return whether pointer
	is on window's screen
	(meta_window_handle_mouse_grab_op_event): don't use coordinates
	from other screens when updating a window operation on the current
	screen. I can't believe no one has reported this...
2002-10-16 20:12:24 +00:00
Mark McLoughlin
791ab07bd4 default to topleft starting corner. (meta_screen_update_workspace_layout):
2002-10-01  Mark McLoughlin  <mark@skynet.ie>

        * src/screen.c: (meta_screen_new): default to
        topleft starting corner.
        (meta_screen_update_workspace_layout): handle
        new property format : orient,x,y,starting corner.
        Fixes #89373.

        * src/screen.h: add MetaScreenCorner enum.
2002-10-01 19:57:26 +00:00
Havoc Pennington
cfa98e02fc fix compiler warnings
2002-09-12  Havoc Pennington  <hp@redhat.com>

	* src/workspace.c (meta_workspace_screen_index)
	(meta_workspace_index): fix compiler warnings

	* src/tools/metacity-window-demo.c (menu_items): add a test for
	dialogs with no transient parent

	* src/place.c (find_first_fit): Try placing window at origin of
	first Xinerama, even if there are no windows to place next to;
	makes placement work when no other windows are open on the screen.
2002-09-12 20:46:03 +00:00
Mark McLoughlin
689bcd14aa move from workspace.c. (update_num_workspaces): set the hint here. Fixes
2002-08-14  Mark McLoughlin  <mark@skynet.ie>

        * src/screen.c: (set_number_of_spaces_hint), move from
        workspace.c.
        (update_num_workspaces): set the hint here. Fixes #90123.

        * src/workspace.c:
        (meta_workspace_new), (meta_workspace_free): don't set
        the hint here.
        (update_num_workspaces): move to screen.c
2002-08-14 00:08:30 +00:00
Mark McLoughlin
8984fd358b set active_workspace to NULL. Also actually activate the first workspace
2002-08-02  Mark McLoughlin  <mark@skynet.ie>

        * src/screen.c: (meta_screen_new): set active_workspace
        to NULL. Also actually activate the first workspace instead
        of just setting active_workspace. Fixes #87367.
        (meta_screen_ensure_workspace_popup): don't re-use our
        iterator for setting the entries list, stop iterating
        when we've gone beyond the last workspace (there may
        be empty spaces in the last row).

        * src/workspace.c: (meta_workspace_activate): if no workspace
        was previously activated, return.
2002-08-04 20:17:37 +00:00