1. 15 Apr, 2006 1 commit
    • Thomas Thurman's avatar
      Add a tabbing function, bound to alt-f6 by default, to cycle through the · 2214fd75
      Thomas Thurman authored
      2006-04-14  Thomas Thurman   <thomas@thurman.org.uk>
      
              Add a tabbing function, bound to alt-f6 by default, to cycle
              through the windows of the current application. Fixes #164831.
      
              * src/common.h: two new MetaGrabOpts values for group switching
              * src/display.c (ping_data_free, meta_display_in_grab_op,
              IN_TAB_CHAIN): adapt to new MetaGrabOpts
              * src/display.h: new enum value for MetaTabList for group switching
              * src/keybindings.c (meta_display_process_key_event):
              adapt to new MetaGrabOpts
              (process_tab_grab): adapt to new MetaGrabOpts, and use switch
              statement for cancelling instead of if statement
              * src/metacity.schemas.in: new keybindings
              * src/prefs.c, src/prefs.h: handle new keybindings
              * src/window.h: define META_WINDOW_IN_GROUP_TAB_CHAIN macro
      2214fd75
  2. 13 Apr, 2006 1 commit
  3. 12 Apr, 2006 1 commit
    • Elijah Newren's avatar
      Patch from Ron Yorston to add a focus_new_windows option. Default is · 59d99fb9
      Elijah Newren authored
      2006-04-12  Elijah Newren  <newren gmail com>
      
      	Patch from Ron Yorston to add a focus_new_windows option.  Default
      	is 'smart' (focus by default but normal focus-stealing-prevention
      	can kick in); 'strict' is current other choice (like 'smart'
      	except that programs launched by the terminal will not be
      	focused).  Fixes remainder of #326159.  Should also close #152004
      	and a bunch of others.
      
      	* src/common.h:
      	Add a MetaFocusNewWindows enum giving the current types allowed
      
      	* src/display.h:
      	Update docs on allow_terminal_deactivation to note that it is only
      	relevant when focus_new_windows is 'strict'
      
      	* src/prefs.c:
      	* src/prefs.h:
      
      	* src/metacity.schemas.in: add the new gconf key and explanation
      
      	* src/prefs.[ch] (#define KEY_FOCUS_NEW_WINDOWS, static gboolean
      	  focus_new_windows, update_focus_new_windows, meta_prefs_init,
      	  change_notify, meta_prefs_get_focus_new_windows,
      	  meta_preference_to_string):
      	Add all the normal preference handling stuff for this new
      	focus-new-windows option.
      
      	* src/window.c (window_state_on_map, meta_window_set_user_time):
      	Don't focus windows launched from a terminal
      59d99fb9
  4. 10 Apr, 2006 1 commit
  5. 30 Jan, 2006 1 commit
    • Elijah Newren's avatar
      Track the active_screen, (event_callback): If the mouse enters a window on · 297e0e46
      Elijah Newren authored
      2006-01-30  Elijah Newren  <newren gmail com>
      
      	* src/display.[ch] (struct MetaDisplay), meta_display_open,
      	meta_display_set_input_focus_window,
      	meta_display_focus_the_no_focus_window): Track the active_screen,
      	(event_callback): If the mouse enters a window on a different
      	screen, activate the default window on the new screen.  May need
      	to be modified for click-to-focus; we'll wait for feedback.  Fixes
      	#319348.
      297e0e46
  6. 20 Jan, 2006 2 commits
    • Elijah Newren's avatar
      Fix unitialized value problem when in raise-on-click mode. Søren, · 6f318f1a
      Elijah Newren authored
      2006-01-20  Elijah Newren  <newren gmail com>
      
      	Fix unitialized value problem when in raise-on-click mode.  Søren,
      	#327572.
      
      	* src/display.c (meta_display_check_threshold_reached): make
      	function be a no op if raise_on_click!=FALSE
      
      	* src/display.h (struct MetaDisplay): point out that
      	grab_initial_[xy] and grab_threshold_movement_reached are only for
      	raise_on_click==FALSE mode.
      6f318f1a
    • Elijah Newren's avatar
      Prevent rapidly repeated visual bells from hanging metacity. Fixes · af14d9d2
      Elijah Newren authored
      2006-01-20  Elijah Newren  <newren gmail com>
      
      	Prevent rapidly repeated visual bells from hanging metacity.
      	Fixes #322032.
      
      	* src/display.h (struct MetaDisplay): add a last_bell_time field,
      	(XSERVER_TIME_IS_BEFORE_ASSUMING_REAL_TIMESTAMPS macro,
      	XERVER_TIME_IS_BEFORE macro): add parentheses around usage of
      	macro parameter
      
      	* src/display.c (meta_display_open): initialize last_bell_time,
      	(event_callback): don't allow more than one bell per second
      af14d9d2
  7. 15 Jan, 2006 1 commit
    • Elijah Newren's avatar
      Fix accidental overzealous focus holding by the terminal introduced by the · 9fdd3d16
      Elijah Newren authored
      2006-01-15  Elijah Newren  <newren@gmail.com>
      
      	Fix accidental overzealous focus holding by the terminal
      	introduced by the original patch in bug 326159.  Windows launched
      	from panel icons, the panel menu, or global keybindings should get
      	focus now.  #326159.
      
      	* src/display.c (meta_display_open, event_callback):
      	* src/display.h (struct MetaDisplay):
      	* src/keybindings.c (process_event):
      	* src/window.c (meta_window_set_user_time):
      	Add a new allow_terminal_deactivation field to MetaDisplay and use
      	it to track whether the user's last action was interaction with
      	the terminal or some outside action (global keybinding, clicking
      	on a dock, etc.) likely to launch a new window.
      
      	* src/window.c (window_state_on_map):
      	Allow the focus switch from a terminal to something else if
      	allow_terminal_deactiviation is true.
      
      	* src/keybindings.c (handle_panel_keybinding):
      	Remove some unneeded code.
      9fdd3d16
  8. 10 Jan, 2006 3 commits
    • Elijah Newren's avatar
      Whoops, I forgot to keep my copyright info updated with my previous · 5913b8c5
      Elijah Newren authored
      2006-01-10  Elijah Newren  <newren@gmail.com>
      
      	* src/bell.c:
      	* src/boxes.c:
      	* src/boxes.h:
      	* src/constraints.c:
      	* src/core.c:
      	* src/display.c:
      	* src/display.h:
      	* src/edge-resistance.c:
      	* src/frames.c:
      	* src/keybindings.c:
      	* src/main.c:
      	* src/prefs.c:
      	* src/prefs.h:
      	* src/screen.c:
      	* src/screen.h:
      	* src/window.c:
      	* src/window.h:
      	Whoops, I forgot to keep my copyright info updated with my previous
      	commits as Havoc had asked me to do.  Doing that now...
      5913b8c5
    • Elijah Newren's avatar
      Add a raise on click option, basically only because all the major distros · 52df880f
      Elijah Newren authored
      2006-01-10  Elijah Newren  <newren@gmail.com>
      
      	Add a raise on click option, basically only because all the major
      	distros are patching it in anyway.  See #326156.
      
      	* src/metacity.schemas.in: add the new gconf key and explanation
      
      	* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
      	  raise_on_click, update_raise_on_click, meta_prefs_init,
      	  change_notify, meta_prefs_get_raise_on_click,
      	  meta_preference_to_string):
      	Add all the normal preference handling stuff for this new
      	raise-on-click option.
      
      	* src/core.c (meta_core_show_window_menu):
      	* src/display.c (event_callback, meta_display_begin_grab_op):
      	* src/window.c (window_activate, meta_window_configure_request, ):
      	Only raise the window if in raise_on_click mode.
      
      	* src/display.c (meta_display_begin_grab_op,
      	  meta_display_end_grab_op, meta_display_check_threshold_reached):
      	* src/display.h (struct MetaDisplay):
      	* src/window.c (meta_window_handle_mouse_grab_op_event):
      	if not in raise-on-click mode only raise on button release if the
      	click didn't start a move or resize operation; needs a few extra
      	MetaDisplay fields to handle this
      
      	* src/core.c (meta_core_user_lower_and_unfocus):
      	no need to do the MRU shuffling if not maintaining the stacking
      	order == MRU order invariant
      
      	* src/frames.c (meta_frames_button_press_event):
      	* src/window.c (meta_window_begin_grab_op):
      	remove an unneeded window raising that is already handled elsewhere
      52df880f
    • Elijah Newren's avatar
      Fix window outline for minimized windows when using alt-esc. #325092. · 8c5b6c87
      Elijah Newren authored
      2006-01-09  Elijah Newren  <newren@gmail.com>
      
      	Fix window outline for minimized windows when using alt-esc.
      	#325092.
      
      	* src/display.c (meta_display_begin_grab_op): Specify the showing
      	type of tabbing operation (Alt tab vs. alt-esc) in addition to the
      	listing type of tabbing operation (docks vs normal windows) to
      	meta_screen_ensure_tab_popup().
      
      	* src/display.h (enum MetaTabShowType): new convenience enum
      
      	* src/screen.[ch] (meta_screen_ensure_tab_popup): require the
      	showing type be specified in addition to the tabbing type; put the
      	outline around the window instead of the icon when in alt-esc
      	mode.
      8c5b6c87
  9. 28 Dec, 2005 1 commit
    • Elijah Newren's avatar
      Make the workspace switcher work with dual-head (non-xinerama) setups. · 703f58cd
      Elijah Newren authored
      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.
      703f58cd
  10. 22 Dec, 2005 2 commits
  11. 19 Nov, 2005 1 commit
    • Elijah Newren's avatar
      Merge of all the changes on the constraints_experiments branch. This is · a7201d27
      Elijah Newren authored
      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()
      a7201d27
  12. 08 Oct, 2005 1 commit
  13. 03 Oct, 2005 1 commit
    • Elijah Newren's avatar
      Truncate ridiculously long titles to avoid crashing or letting the pager · ef5299ee
      Elijah Newren authored
      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
      ef5299ee
  14. 11 Jul, 2005 1 commit
    • Matthias Clasen's avatar
      React to cursor theme changes: (#308106) · 8ce054b2
      Matthias Clasen authored
      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.
      8ce054b2
  15. 26 May, 2005 1 commit
  16. 22 Feb, 2005 1 commit
    • Elijah Newren's avatar
      Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes #167545. · 61250726
      Elijah Newren authored
      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.
      61250726
  17. 20 Feb, 2005 1 commit
    • Elijah Newren's avatar
      Big patch to cover about 6 different issues in order to correct rare · 50312dd0
      Elijah Newren authored
      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
      50312dd0
  18. 07 Feb, 2005 1 commit
    • Elijah Newren's avatar
      Set a _METACITY_VERSION property (a utf8 string) on the WM check window. · 0aa903f0
      Elijah Newren authored
      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.
      0aa903f0
  19. 24 Jan, 2005 1 commit
    • Elijah Newren's avatar
      Restore original stacking when aborting an alt-esc window switch · 2d0d5e8c
      Elijah Newren authored
      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
      2d0d5e8c
  20. 10 Jan, 2005 1 commit
  21. 23 Dec, 2004 1 commit
    • Elijah Newren's avatar
      Wrap XSetInputFocus, making display->expected_focus_window a little more · 892cb8a8
      Elijah Newren authored
      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
      892cb8a8
  22. 04 Oct, 2004 2 commits
    • Elijah Newren's avatar
      Fix a variety of issues with autoraise (#134206) · 70e40c23
      Elijah Newren authored
      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
      70e40c23
    • Elijah Newren's avatar
      Fix a variety of focus race conditions in all focus modes, or at least · 16b9aff4
      Elijah Newren authored
      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
      16b9aff4
  23. 15 Sep, 2004 1 commit
    • Elijah Newren's avatar
      Focus correct window after minimizing via the tasklist (fixes #128200; see · 4b9fe2ca
      Elijah Newren authored
      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
      4b9fe2ca
  24. 27 Aug, 2004 1 commit
    • Havoc Pennington's avatar
      move the have_xrender variable initialization up in the file since it can · 1f7f29e0
      Havoc Pennington authored
      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
      1f7f29e0
  25. 26 Aug, 2004 1 commit
    • Elijah Newren's avatar
      Make dialogs that Metacity shows follow focus-stealing-prevention · 044d8999
      Elijah Newren authored
      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).
      044d8999
  26. 19 Aug, 2004 1 commit
    • Havoc Pennington's avatar
      track the last_xor_rect separately from the current window size, and then · 06a58f43
      Havoc Pennington authored
      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.
      06a58f43
  27. 31 Jul, 2004 1 commit
    • Rob Adams's avatar
      Fix some support for EWMH hints, and fix USER_TIME support to include the · e60da6c0
      Rob Adams authored
      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): Initial...
      e60da6c0
  28. 24 Jun, 2004 1 commit
    • Elijah Newren's avatar
      Add support for _NET_WM_USER_TIME · 28a54c6b
      Elijah Newren authored
      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
      28a54c6b
  29. 19 Jun, 2004 1 commit
    • Soeren Sandmann's avatar
      Fix bug 143333, support for update counter spec, and 109362, schedule · 4cfb5152
      Soeren Sandmann authored
      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
      4cfb5152
  30. 23 Feb, 2004 1 commit
    • Rob Adams's avatar
      Add my copyright notice to a number of files on which it should already · db108c1f
      Rob Adams authored
      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.
      db108c1f
  31. 10 Jan, 2004 1 commit
    • Thomas Fitzsimmons's avatar
      Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS. · a605da04
      Thomas Fitzsimmons authored
      2004-01-09  Thomas Fitzsimmons  <fitzsim@redhat.com>
      
      	Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS.
      
      	* src/display.c: include xprops.h
      	(process_request_frame_extents): new function
      	(meta_display_open): add _NET_FRAME_EXTENTS and
      	_NET_REQUEST_FRAME_EXTENTS atoms
      	(event_callback): handle frame extents message
      
      	* src/display.h (struct _MetaDisplay): add atom_net_frame_extents
      	and atom_net_request_frame_extents
      
      	* src/theme.c (meta_pango_font_desc_get_text_height): make font_desc
      	parameter const
      
      	* src/ui.c: include prefs.h
      	(meta_ui_theme_get_frame_borders): new function
      
      	* src/window.c (update_net_frame_extents): new function
      	(meta_window_move_resize_internal): update frame extents
      	property when frame geometry changes
      
      	* src/screen.c (set_supported_hint): add atom_net_frame_extents
      	and atom_net_request_frame_extents
      a605da04
  32. 13 Dec, 2003 2 commits
    • Rob Adams's avatar
      Revert prior change · 9bde925d
      Rob Adams authored
      9bde925d
    • Rob Adams's avatar
      Add increased robustness for dealing with all workspaces windows and MRU · 7630d22b
      Rob Adams authored
      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
      7630d22b
  33. 24 Nov, 2003 1 commit
  34. 21 Nov, 2003 1 commit
    • Havoc Pennington's avatar
      new function · d538690b
      Havoc Pennington authored
      2003-11-20  Havoc Pennington  <hp@redhat.com>
      
      	* src/window.c (meta_window_new_with_attrs): new function
      
      	* src/display.c, src/screen.c: create the compositor and feed
      	windows and events to it
      d538690b