1
0
Fork 0
Commit graph

264 commits

Author SHA1 Message Date
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
ca2fe384bc Don't allow removing a window from maximized or fullscreened state to
2005-11-22  Elijah Newren  <newren@gmail.com>

	Don't allow removing a window from maximized or fullscreened state
	to place the titlebar under the top panel.  Fixes #322075.

	* src/display.c (handle_net_moveresize_window): fix up previous
	comments now that I know a little more, modify the code just
	slightly to clarify that this is NOT a manual user move/resize
	operation

	* src/window.c (meta_window_unmaximize,
	  meta_window_unmake_fullscreen,
	  meta_window_shove_titlebar_onscreen):
	don't claim that these are manual user move/resize operations
2005-11-22 15:48:30 +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
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
ef5299ee92 Truncate ridiculously long titles to avoid crashing or letting the pager
2005-10-03  Elijah Newren  <newren@gmail.com>

	Truncate ridiculously long titles to avoid crashing or letting the
	pager crash.  Based on patch from Ray, incorporating suggestions
	from Havoc and some extensions of my own.  Fixes #315070.

	* src/display.c (set_utf8_string_hint, meta_display_open):
	* src/xprops.[ch] (meta_prop_set_utf8_string_hint):
	Move set_utf8_string_hint() to props.[ch], namespace it
	("meta_prop_"), and make it public

	* src/tabpopup.c (utf8_strndup, meta_ui_tab_popup_new):
	* src/util.[ch] (meta_g_utf8_strndup):
	Move utf8_strndup() to util.[ch], namespace it ("meta_g_"), and
	make it public

	* src/display.c (meta_display_open):
	* src/display.h (struct _MetaDisplay):
	add net_wm_visible_name and net_wm_visible_icon_name atoms to the
	list of atoms we work with

	* src/window-props.c (set_window_title, set_icon_title): If title
	length is greater than 512, truncate it and set
	_NET_WM_VISIBLE_NAME or _NET_WM_VISIBLE_ICON_NAME accordingly
2005-10-03 18:13:45 +00:00
Matthias Clasen
8ce054b21b React to cursor theme changes: (#308106)
2005-07-11  Matthias Clasen  <mclasen@redhat.com>

	React to cursor theme changes: (#308106)

	* src/prefs.h:
	* src/prefs.c: Expose the GConf keys for cursor theme
	and size as preferences META_PREF_CURSOR_THEME and
	META_PREF_CURSOR_SIZE with getters meta_prefs_get_cursor_theme()
	and meta_prefs_get_cursor_size().

	* src/display.c (meta_display_open): Initialize the cursor
	theme and size.

	* src/display.h:
	* src/display.c (meta_display_set_cursor_theme): New function
	to change the cursor theme and update all cursors.

	* src/screen.h
	* src/screen.c (meta_screen_update_cursor): New function to
	refesh the root cursor of a screen.

	* src/main.c (prefs_changed_callback): Update the cursor
	theme when the cursor preferences change.
2005-07-11 13:25:08 +00:00
Ray Strode
7b416a0a2d Actually commit the stuff mentioned in the last ChangeLog entry.
2005-05-26  Ray Strode  <rstrode@redhat.com>

	Actually commit the stuff mentioned in the last
	ChangeLog entry.
2005-05-26 19:58:17 +00:00
Elijah Newren
bea407e309 Prevent the visual bell from changing the focus window. Fixes #123366.
2005-02-25  Elijah Newren  <newren@gmail.com>

	Prevent the visual bell from changing the focus window.  Fixes
	#123366.

	* src/bell.c: (meta_bell_flash_screen): if not in click-to-focus
	mode and mouse_mode is also false, increment the focus sentinel so
	that we can ignore spurious EnterNotify and LeaveNotify events.

	* src.display.c: (event_callback): make sure to also ignore
	LeaveNotify events when the focus sentinel isn't clear
2005-02-25 20:14:08 +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
992f237090 Handle _NET_CURRENT_DESKTOP messages that come with timestamps. Fixes the
2005-02-20  Elijah Newren  <newren@gmail.com>

	* src/display.c: (event_callback): Handle _NET_CURRENT_DESKTOP
	messages that come with timestamps.  Fixes the metacity portion of
	#161361 other than the portion handled by #128380.
2005-02-20 23:38:31 +00:00
Elijah Newren
1f0fd137f5 Patch from Joe Marcus Clarke to fix a possible crash on logout. #167935.
2005-02-20  Elijah Newren  <newren@gmail.com>

	Patch from Joe Marcus Clarke to fix a possible crash on logout.
	#167935.  Thanks for fixing my mistakes, Joe!

	* src/display.c: (meta_display_open): initialize
	display->grab_old_window_stacking to NULL.
2005-02-20 17:23:20 +00:00
Elijah Newren
50312dd0e8 Big patch to cover about 6 different issues in order to correct rare
2005-02-20  Elijah Newren  <newren@gmail.com>

	Big patch to cover about 6 different issues in order to correct
	rare problems with timestamps (make sure window selected in
	tasklist actually gets focus, sanity check timestamps to avoid
	rogue apps hosing the system, correct the updating of
	net_wm_user_time, correctly handle timestamps of 0 when comparing
	xserver timestamps for those who have had their systems up for
	over 25 days or so, add some debugging information to verbose
	logs, some code cleanups).  Fixes all issues listed in #167358.

	* src/display.h: (struct _MetaDisplay): clarify comment on
	last_focus_time, introduce a new variable--last_user_time,
	(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
	separate macro and then introduce a new macro with this name that
	uses the old one but adds additional special-case checks for
	timestamps that are 0, (comment to
	meta_display_set_input_focus_window): add information about how
	last_user_time should be used in this function

	* src/display.c (santiy_check_timestamps): new function,
	(meta_display_open): intialize display->last_user_time,
	(meta_display_get_current_time_roundtrip): use the timestamp,
	which is known to be good, in order to sanity_check_timestamps,
	(event_callback): use the new meta_window_ste_user_time() function
	in order to correct problems, use the timestamp of KeyPress and
	ButtonPress events, which are known to be good, in order to
	sanity_check_timestamps, (timestamp_too_old): new function for
	common behavior of meta_display_focus_the_no_focus_window and
	meta_display_set_input_focus_window, with added checking for
	display->last_user_time in addition to display->last_focus_time,
	(meta_display_set_input_focus_window): replace some of the code
	with a call to timestamp_too_old(),
	(meta_display_focus_the_no_focus_window): replace some of th ecode
	with a call to timestamp_too_old()

	* src/window.h: (meta_window_set_user_time): new function to
	abstract the many things that need to be done when updating the
	net_wm_user_time of any window

	* src/window.c: (meta_window_activate): add debugging spew, make
	sure the comparison is made with last_user_time NOT
	last_focus_time, use meta_window_set_user_time() function in order
	to correct problems, (meta_window_client_message): add a newline
	to a debugging message to make them easier to read,
	(meta_window_set_user_time): new function

	* src/window-props.c (reload_net_wm_user_time): use the new
	meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
Elijah Newren
754a75546d trivial fix to a log message: change %d to %lu (see debugging log from bug
2005-02-16  Elijah Newren  <newren@gmail.com>

	* src/display.c: (event_callback): trivial fix to a log message:
	change %d to %lu (see debugging log from bug 167358).
2005-02-16 09:36:24 +00:00
Elijah Newren
fe1416c65f Avoid using CurrentTime when focusing, handle it better in case we miss
2005-02-08  Elijah Newren  <newren@gmail.com>

	Avoid using CurrentTime when focusing, handle it better in case we
	miss any cases.  Fixes #166732.

	* src/window.c: (meta_window_shade): use
	meta_display_get_current_time_roundtrip() to ensure we have a
	valid timestamp, (meta_window_unshade): same

	* src/display.c: (meta_display_set_input_focus_window): If
	CurrentTime was passed, get one from the XServer in addition to
	throwing a warning, (meta_display_focus_the_no_focus_window): same
2005-02-09 03:18:46 +00:00
Elijah Newren
0aa903f0d4 Set a _METACITY_VERSION property (a utf8 string) on the WM check window.
2005-02-06  Elijah Newren  <newren@gmail.com>

	Set a _METACITY_VERSION property (a utf8 string) on the WM check
	window.  #165350.

	* src/display.h: (struct MetaDisplay): add a atom_metacity_version
	field

	* src/display.c: (meta_display_open): initialize the
	_METACITY_VERSION property on the WM check window to the current
	version of Metacity.
2005-02-07 04:37:35 +00:00
Arvind Samptur
cf102c12f4 Don't wireframe when accessibility is on, it apparently causes a desktop
2005-01-26  Arvind Samptur  <arvind.samptur@wipro.com>

        Don't wireframe when accessibility is on, it apparently
        causes a desktop wide freeze.

        * src/prefs.[ch] (meta_prefs_init) (change_notify)
        (update_gnome_accessibility) (meta_preference_to_string)
        (meta_prefs_get_gnome_accessibility) : Add code to monitor
        accessibility status.

        * src/display.c (meta_display_begin_grab_op): Check
        accessibility status before going ahead with wireframe.
        Fixes #159538
2005-01-26 08:43:38 +00:00
Elijah Newren
2dcaa941b4 don't forget to initialize display->grab_old_window_stacking. Thanks to
2005-01-24  Elijah Newren  <newren@gmail.com>

	* src/display.c: (meta_display_begin_grab_op): don't forget to
	initialize display->grab_old_window_stacking.  Thanks to Sebastien
	Bacher and the bleeding edge Ubuntu users for catching the
	occasional crash this could cause so quickly, and for verifying
	that the patch worked (I couldn't duplicate).  Fixes #165093.
2005-01-24 17:39:26 +00:00
Elijah Newren
2d0d5e8cac Restore original stacking when aborting an alt-esc window switch
2005-01-23  Elijah Newren  <newren@gmail.com>

	Restore original stacking when aborting an alt-esc window switch
	operation.  Fixes #123576.

	* src/display.c: (GRAB_OP_IS_WINDOW_SWITCH): new macro,
	(meta_display_close): clear grab_old_window_stacking if non-NULL,
	(event_callback): restore stack positions if alt-esc op cancelled
	with button press, (meta_display_begin_grab_op): store the old
	stacking positions, (meta_display_end_grab_op): free the old stack
	positions

	* src/display.h: (struct _MetaDisplay): add a
	grab_old_window_stacking list

	* src/keybindings.c: (process_tab_grab): restore stack positions
	if alt-esc op cancelled with an errant key press

	* src/stack.c: (compare_just_window_stack_position): new
	GCompareFunc function, (meta_stack_get_positions): get current
	stack positions, (compare_pointers): new GCompareFunc function,
	(lists_contain_same_windows): simple utility func to see if two
	lists contains the same windows, (meta_stack_set_positions): new
	function to set the positions of all the windows in the stack

	* src/stack.h: (meta_stack_get_postions,
	meta_stack_set_positions): new functions
2005-01-24 05:58:30 +00:00
Elijah Newren
7d747092a6 Remove the hack from bug 128200; it isn't needed anymore with the fix from
2005-01-09  Elijah Newren  <newren@gmail.com>

	* src/display.c (meta_display_open):
	* src/display.h (struct _MetaDisplay):
	* src/window.c (meta_window_free, meta_window_client_message,
	meta_window_notify_focus):

	Remove the hack from bug 128200; it isn't needed anymore with the
	fix from bug #160470.
2005-01-10 00:27:00 +00:00
Elijah Newren
be29c69653 Don't focus the panel on click. Fixes #160470 (and 100470 and removes the
2005-01-09  Elijah Newren  <newren@gmail.com>

	Don't focus the panel on click.  Fixes #160470 (and 100470 and
	removes the need for the hack from 128200)

	* doc/how-to-get-focus-right.txt: Update section on focusing
	non-decorated windows (specifically, DOCKS and DESKTOPS)

	* src/display.c (event_callback): don't focus dock windows on
	click
2005-01-09 19:27:22 +00:00
Elijah Newren
78e54ee7ee Allow users to move the window around immediately after double-clicking to
2004-12-28  Elijah Newren  <newren@gmail.com>

	Allow users to move the window around immediately after
	double-clicking to shade (#90290)

	* src/display.c (event_callback): only end the grab op if either
	there is no frame or else the frame is not mapped
2004-12-28 22:31:10 +00:00
Elijah Newren
0bf6bffb16 Spew warning if CurrentTime is passed to the function, but don't exit
2004-12-27  Elijah Newren  <newren@gmail.com>

	* src/display.c (meta_display_set_input_focus_window,
	meta_display_focus_the_no_focus_window): Spew warning if
	CurrentTime is passed to the function, but don't exit prematurely.
	(fixes #162353)
2004-12-28 05:55:58 +00:00
Elijah Newren
892cb8a8dd Wrap XSetInputFocus, making display->expected_focus_window a little more
2004-12-22  Elijah Newren  <newren@gmail.com>

	Wrap XSetInputFocus, making display->expected_focus_window a
	little more reliable (see #154598)

	* src/display.h: (struct _MetaDisplay): add a large comment about
	the expected_focus_window, add a last_focus_time field,
	(XSERVER_TIME_IS_BEFORE): new macro moved from window.c but fixed
	for 64-bit systems, (meta_display_set_input_focus_window): new
	function

	* src/display.c (meta_display_open): initialize last_focus_time,
	add a comment about brokenness of trying to set intial focus
	window, (meta_display_set_input_focus_window): new function that
	wraps XSetInputFocus,
	(meta_display_focus_the_no_focus_window): make this function
	closer to a wrapping of XSetInputFocus for the no_focus_window.

	* src/window.c (XSERVER_TIME_IS_LATER): remove this macro in favor
	of the improved one added to display.h

	* src/display.c (meta_display_open):
	* src/window.c (meta_window_focus):
	use meta_display_focus_the_no_focus_window and
	meta_display_set_input_focus instead of XSetInputFocus
2004-12-23 06:44:56 +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
d8d77bd65b Focus the desktop when showing it. Fixes #159257.
2004-12-19  Elijah Newren  <newren@gmail.com>

	Focus the desktop when showing it.  Fixes #159257.

	* src/display.c (event_callback): obtain a timestamp to pass to
	meta_screen_show_desktop

	* src/keybindings.c (handle_toggle_desktop): obtain a timestamp to
	pass to meta_screen_show_desktop

	* src/screen.c (meta_screen_show_desktop): add a timestamp
	parameter, get the most recently used window of type DESKTOP (if
	there is one) and focus it

	* src/screen.h (meta_screen_show_desktop): add a timestamp
	parameter
2004-12-20 02:46:42 +00:00
Elijah Newren
8b26849517 Fix the alt-tab order--if the most recently used window is not focused,
2004-10-25  Elijah Newren  <newren@math.utah.edu>

	Fix the alt-tab order--if the most recently used window is not
	focused, start alt tabbing with that window instead of the one
	after it (fixes #156251)

	* src/display.c (find_tab_forward): add a skip_first parameter,
	(find_tab_backward): add a skip_last parameter,
	(meta_display_get_tab_next): if a beginning window wasn't given
	and the focused window isn't the tab chain, don't skip the MRU
	window
2004-10-25 16:17:19 +00:00
Elijah Newren
81fe64991c Fix middle-frame-click-to-lower focus inconsistency (#154601)
2004-10-08  Elijah Newren  <newren@math.utah.edu>

	Fix middle-frame-click-to-lower focus inconsistency (#154601)

	* src/core.c (meta_core_user_lower_and_unfocus): focus the default
	window in all focus modes, not just click-to-focus (EnterNotify
	events will not handle this case for sloppy and mouse focus)

	* src/display.c (event_callback): replace window->has_focus with
	window == display->expected_focus_window to avoid a race issue
2004-10-08 22:34:34 +00:00
Elijah Newren
79b4de04fc Alter the meaning of expected_focus_window; doesn't affect current
2004-10-08  Elijah Newren  <newren@math.utah.edu>

         Alter the meaning of expected_focus_window; doesn't affect
	 current operation but assists in fixing some other bugs
	 (#154598)

	* src/display.c (meta_display_focus_the_no_focus_window): set the
	expected_focus_window to NULL.

	* src/window.c (meta_window_notify_focus): don't NULL the
	expected_focus_window when that window receives a FocusIn event
2004-10-08 21:57:01 +00:00
Elijah Newren
714fb3d539 if the root window gets focused, set the focus to the default window; this
2004-10-04  Elijah Newren  <newren@math.utah.edu>

	* src/display.c (event_callback): if the root window gets focused,
	set the focus to the default window; this fixes the
	"focus-follows-mouse" behavior seen for click-to-focus mode after
	cancelling log out (fixes #153220)
2004-10-04 21:21:38 +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
e8877141b7 Ooops, forgot to update the patch to account for change in bug 152000 2004-10-04 20:43:55 +00:00
Elijah Newren
546fe7b5b3 When no window becomes focused, focus the default window instead of
2004-10-04  Elijah Newren  <newren@math.utah.edu>

	* src/display.c (event_callback): When no window becomes focused,
	focus the default window instead of punting to the
	no_focus_window.  Also, change the warning to a verbose
	message--this will happen frequently due to brain-damage in the X
	protocol.  (see #125492)
2004-10-04 20:39:21 +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
3b9ec3ce50 Fix some uninitialized variable errors reported by valgrind (see #153338)
2004-09-22  Elijah Newren  <newren@math.utah.edu>

	Fix some uninitialized variable errors reported by valgrind (see
	#153338)

	* src/display.c (meta_display_open): initialize
	display->grab_resize_timeout_id, and display->grab_have_keyboard

	* src/ui.c (meta_ui_create_frame_window): initialize attrs.width
	and attrs.height
2004-09-22 18:57:36 +00:00
Elijah Newren
9d9c744490 Remove some redundant code regarding focusing the default window (#152117)
2004-09-15  Elijah Newren  <newren@math.utah.edu>

	* src/display.c (event_callback): Remove some redundant code
	regarding focusing the default window (#152117)
2004-09-16 03:10:11 +00:00
Elijah Newren
a880f5d401 Fix unwanted loss of focus to the mouse window when using keynav (fixes
2004-09-15  Elijah Newren  <newren@math.utah.edu>

	Fix unwanted loss of focus to the mouse window when using keynav
	(fixes #101190)

	* src/display.c (event_callback): Ignore EnterNotify events with
	xcrossing.mode of either NotifyGrab or NotifyUngrab
2004-09-15 15:46:25 +00:00
Elijah Newren
4b9fe2cae7 Focus correct window after minimizing via the tasklist (fixes #128200; see
2004-09-15  Elijah Newren  <newren@math.utah.edu>

	Focus correct window after minimizing via the tasklist (fixes
	#128200; see also #107681)

	* src/display.h (struct _MetaDisplay): track the
	previously_focused_window

	* src/display.c (meta_display_open): initialize
	previously_focused_window

	* src/window.c (meta_window_free): clear the
	previously_focused_window if it's being freed,
	(meta_window_client_message): if we get a request to minimize the
	previously_focused_window and the focus_window is a dock or the
	desktop, focus the default window, (meta_window_notify_focus):
	update the previously_focused_window
2004-09-15 15:38:09 +00:00
Havoc Pennington
1f7f29e059 move the have_xrender variable initialization up in the file since it can
2004-08-26  Havoc Pennington  <hp@redhat.com>

	* configure.in: move the have_xrender variable initialization up
	in the file since it can be set as part of composite check

2004-08-19  Havoc Pennington  <hp@redhat.com>

	Fixes from Rich Wareham

	* src/display.h (struct _MetaDisplay): add render extension check
	to the display

	* src/display.c: check for render

	* configure.in: don't build compositing manager by default, don't
	want any nasty surprises; check for render separately from
	compositing manager

	* src/frame.c: use an ARGB visual when available for the window
	frame, so we can be all cool-ass
2004-08-27 02:17:49 +00:00
Elijah Newren
044d8999a3 Make dialogs that Metacity shows follow focus-stealing-prevention
2004-08-25  Elijah Newren  <newren@math.utah.edu>

	Make dialogs that Metacity shows follow focus-stealing-prevention
	conventions. (fixes one issue in #149028; see comments 47-54)

	* src/delete.c (delete_ping_reply_func,
	delete_ping_timeout_func): Make callback functions take a
	timestamp arg, (delete_ping_timeout_func): pass the timestamp to
	metacity-dialog

	* src/display.c (meta_display_ping_timeout): add a timestamp to
	the call to the ping_timeout_func, (meta_display_ping_window,
	process_pong_message): add a timestamp to the call to the
	ping_reply_func

	* src/display.h (MetaWindowPingFunc typedef): add a timestamp to
	this function typedef

	* src/keybindings.c (error_on_command): require a timestamp and
	pass the timestamp on to metacity-dialog, (handle_run_command):
	pass a timestamp to error_on_command

	* src/metacity-dialog.c (copy_of_gdk_x11_window_set_user_time):
	new function (temporary; only for use while using gtk+-2.4),
	(kill_window_question, warn_about_no_sm_support,
	error_about_command): make these functions take a timestamp and
	call copy_of_gdk_x11_window_set_user_time, (main): require the
	first two args to the program to be "--timestamp <timestamp>"

	* src/session.c (warn_about_lame_clients_and_finish_inter): pass a
	timestamp of 0 to metacity-dialog to prevent focus (it's a popup
	not generated by and kind of user request).
2004-08-26 00:59:12 +00:00
Soeren Sandmann
9cee95f210 Move wireframe code before grab is released to prevent endless loops with
Fri Aug 20 12:54:12 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* src/display.c (meta_display_end_grab_op): Move wireframe code
	before grab is released to prevent endless loops with fullscreen
	windows.
2004-08-20 10:56:41 +00:00
Havoc Pennington
06a58f43c0 track the last_xor_rect separately from the current window size, and then
2004-08-18  Havoc Pennington  <hp@redhat.com>

	* src/display.h (struct _MetaDisplay): track the last_xor_rect
	separately from the current window size, and then use that to
	paint the wireframe including the frame, and taking into
	account shaded windows.

	* src/window.c (meta_window_get_xor_rect): new function to compute
	the xor rect; it is not really 100% right, because it uses the
	frame dimensions from the window at the start of the move/resize.
	But probably won't break in practice.
2004-08-19 02:05:24 +00:00
Elijah Newren
118a1fb76a activating the current workspace should be a no-op. This prevents a race
2004-08-07  Elijah Newren  <newren@math.utah.edu>

	* src/display.c (event_callback): activating the current workspace
	should be a no-op.  This prevents a race condition in focus window
	choice when activating a window via the taskbar.  Fix for #149589.
2004-08-08 04:11:33 +00:00
Elijah Newren
e81659d2ff Focusing a window upon unshowing the desktop in various ways (panel applet
2004-08-06  Elijah Newren  <newren@math.utah.edu>

	* src/display.c (event_callback): Focusing a window upon unshowing
	the desktop in various ways (panel applet or keybinding) was
	inconsistent for sloppy and click focus modes.  Fix this by
	calling meta_workspace_focus_default_window after unshowing the
	desktop via a _NET_SHOWING_DESKTOP message.  (resolves #149543)
2004-08-07 03:13:56 +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
Rob Adams
e60da6c006 Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31  Rob Adams  <readams@readams.net>

	Fix some support for EWMH hints, and fix USER_TIME support to
	include the DEMANDS_ATTENTION hint.  Also includes some code for
	implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
	this is disabled pending feature thaw.

	* COMPLIANCE: update with new information

	* src/display.c (meta_display_open): add new hints to list

	* src/display.h (_MetaDisplay): Add new atoms to struct

	* src/screen.c (set_supported_hint): update the list of support
	hints.
	(set_desktop_viewport_hint): new function sets the viewport hint
	to (0,0) as required by the spec for WMs with no viewport support.
	(set_desktop_geometry_hint): new function to set the desktop size
	hint to the size of the display, since we don't implement large
	desktop support, as required by the spec.
	(meta_screen_resize): update the geometry hint on screen resize

	* src/window.c (meta_window_new_with_attrs): Initialize
	demands_attention state
	(set_net_wm_state): Set demands_attention hint in the window state
	(meta_window_show): If we don't pop up a window because of
	USER_TIME, set DEMANDS_ATTENTION on the window.
	(meta_window_focus): When a window receives focus, remove
	DEMANDS_ATTENTION hint
	(meta_window_client_message): Allow other apps to set
	DEMANDS_ATTENTION on a window.  Also, if the _NET_ACTIVE_WINDOW
	hint includes a timestamp, use it.
	(update_net_wm_state): Read DEMANDS_ATTENTION state also

	* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 19:56:10 +00:00
Elijah Newren
28a54c6bb4 Add support for _NET_WM_USER_TIME
2004-06-17  Elijah Newren  <newren@math.utah.edu>

	Add support for _NET_WM_USER_TIME

	* src/display.c:
	(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
	(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
	(doesn't work since keyboard isn't grabbed) and ButtonPress (does
	work), this is just a fallback for applications that don't update
	this themselves.

	* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field

	* src/screen.c: (meta_screen_apply_startup_properties): Check for
	TIMESTAMP provided from startup sequence as well.

	* src/stack.c:
	s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
	(meta_window_set_stack_position): New function which calls the
	meta_window_set_stack_position_no_sync function followed immediately
	by calling meta_stack_sync_to_server.

	* src/window-props.c:
	(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
	(reload_wm_hints): also load atom_net_wm_user_time

	* src/window.c:
	new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
	(meta_window_new_with_attrs): add timestamp attributes,
	(window_takes_focus_on_map): use TIMESTAMP from startup
	notification and _NET_WM_USER_TIME to decide whether to focus new
	windows,
	(meta_window_show): if app doesn't take focus on map, place it
	just below the focused window in the stack
	(process_property_notify): check for changes to _NET_WM_USRE_TIME,
	(meta_window_stack_just_below): new function

	* src/window.h:
	(_MetaWindow struct): new fields for initial_timestamp,
	initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
	(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
Soeren Sandmann
4cfb5152f7 Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Fix bug 143333, support for update counter spec, and 109362,
	schedule compensation events when events are ignored.

	* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
	_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
	METACITY_SYNC_COUNTER stuff.
	(meta_display_begin_op): Setup the sync counter

	* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
	Add new atoms.

	* src/window.c (send_sync_request): new function.
	(meta_window_move_resize_internal): send a sync request before
	resizing.
	(check_move_resize_frequence): Rework logic to also check the SYNC
	case. If an event is ignored return the remaining time.
	(update_resize_timeout): Timeout that gets called when a
	compensation event is scheduled.
	(uddate_resize): schedule compensation events when an event is
	ignored.
	(meta_window_handle_mouse_grap_op_event): When an alarm is
	received and sync was turned off, turn it back on.

	* src/window.h (struct MetaWindow)  Add some variables
2004-06-19 00:45:24 +00:00
Elijah Newren
4b9a23e8eb Fix unwanted mouse grab op on rapid click-and-release 2004-04-16 03:38:19 +00:00