1. 13 Oct, 2006 1 commit
    • Carlo Wood's avatar
      Fix cases when titlebar is allowed offscreen and shouldn't be (and · d79a571d
      Carlo Wood authored
      2006-10-13  Carlo Wood <carlo@alinoe.com>
      
      	Fix cases when titlebar is allowed offscreen and shouldn't be (and
      	vice-versa).  #333995.
      
      	* src/display.[ch] (struct _MetaDisplay): add grab_frame_action
      	member
      
      	* src/display.[ch] (meta_display_begin_grab_op):
      	* src/window.[ch] (meta_window_begin_grab_op):
      	* src/core.[ch] (meta_core_begin_grab_op):
      	Add frame_action parameter (core & window versions pass it on to
      	display)
      
      	* src/display.c (event_callback):
      	* src/window.c (meta_window_begin_grab_op,
      	  meta_window_client_message, menu_callback):
      	* frames.c (meta_frames_button_press_event):
      	* keybindings.c (do_choose_window, handle_begin_move,
      	  handle_begin_resize, handle_workspace_switch):
      	Pass whether the action should be considered a 'frame_action',
      	which will be used to determine whether to force the titlebar to
      	remain onscreen, to meta_*_begin_grab_op
      
      	* constraints.c (constrain_titlebar_visible):
      	Replace previous ugly hack by using grab_frame_action (and whether
      	the action is a user action) to determine whether to enforce the
      	titlebar_visible constraint.
      d79a571d
  2. 01 Oct, 2006 2 commits
    • Elijah Newren's avatar
      Stick an emacs comment directive at the beginning of all the code files so · 0201fcfc
      Elijah Newren authored
      2006-10-01  Elijah Newren  <newren gmail com>
      
      	* src/*.[ch]: Stick an emacs comment directive at the beginning of
      	all the code files so that people using emacs will be more likely
      	to get coding style correct in their patches.  We still need a
      	similar vi directive.  #358866
      0201fcfc
    • Elijah Newren's avatar
      Patch from Carlo Wood to ensure that maximized and minimized properties · 07e4cacf
      Elijah Newren authored
      2006-10-01  Elijah Newren  <newren gmail com>
      
      	Patch from Carlo Wood to ensure that maximized and minimized
      	properties are maintained across restarts.  #358042.
      
      	* src/constraints.c (place_window_if_needed): fix up partial
      	maximization handling and add minimize_after_placement handling.
      
      	* src/display.[ch] (struct MetaDisplay, meta_display_open): add a
      	new display->display_opening flag to allow handling startup
      	differently where needed.
      
      	* src/window-props.c (reload_net_wm_state): handle
      	_net_wm_state_hidden as well, setting
      	window->minimize_after_placement appropriately
      
      	* src/window.[ch] (struct MetaWindow, meta_window_new_with_attrs):
      	add a window->minimize_after_placement field
      
      	* src/window.c (meta_window_new_with_attrs): only unminimize the
      	window and its transients if the display isn't being opened,
      	(unmaximize_window_before_freeing): don't reset the state unless
      	the window is becoming withdrawn, if the screen is being closed be
      	sure to save the unmaximized state of the window so the next
      	window manager can restore it
      07e4cacf
  3. 18 Sep, 2006 1 commit
    • Elijah Newren's avatar
      Partial audit to fix timestamp usage. One step towards fixing #355180; see · 5c587726
      Elijah Newren authored
      2006-09-18  Elijah Newren  <newren gmail com>
      
      	Partial audit to fix timestamp usage.  One step towards fixing
      	#355180; see important comments in that bug.
      
      	* src/core.[ch] (meta_core_unshade, meta_core_shade):
      	* src/delete.c (meta_window_present_delete_dialog,
      	  delete_ping_timeout_func):
      	* src/display.[ch] (meta_display_open, meta_display_close,
      	  event_callback, meta_display_begin_grab_op,
      	  process_selection_clear, meta_display_unmanage_screen,
      	  meta_display_unmanage_windows_for_screen):
      	* src/frames.c (meta_frames_button_press_event):
      	* src/keybindings.c (handle_toggle_shade):
      	* src/main.c (main):
      	* src/screen.[ch] (update_num_workspaces, meta_screen_new,
      	  meta_screen_free, prefs_changed_callback):
      	* src/window.[ch] (meta_window_free, finish_minimize,
      	  implement_showing, meta_window_show, meta_window_maximize,
      	  meta_window_make_fullscreen_internal,
      	  meta_window_unmake_fullscreen, meta_window_shade,
      	  meta_window_unshade, window_activate, send_sync_request,
      	  meta_window_client_message, menu_callback,
      	  meta_window_update_keyboard_resize):
      	Remove usage of CurrentTime, meta_display_get_current_time() and
      	meta_display_get_current_time_roundtrip() where possible, or
      	document why it isn't possible, or at very least add a FIXME with
      	some explanation of my laziness and what needs to be done.
      5c587726
  4. 13 Sep, 2006 1 commit
    • Elijah Newren's avatar
      Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+ · 3b047877
      Elijah Newren authored
      2006-09-13  Elijah Newren  <newren gmail com>
      
      	* src/common.h (MetaWindowMenuFunc):
      	* src/core.[ch] (meta_core_user_lower_and_unfocus,
      	  meta_core_user_focus, meta_core_show_window_menu,
      	  meta_core_begin_grab_op, meta_core_end_grab_op):
      	* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
      	  meta_window_delete):
      	* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
      	  sanity_check_timestamps, meta_display_open, event_callback,
      	  meta_spew_event, meta_display_set_grab_op_cursor,
      	  meta_display_begin_grab_op, meta_display_end_grab_op,
      	  meta_display_ping_timeout, meta_display_ping_window,
      	  process_pong_message, timestamp_too_old,
      	  meta_display_set_input_focus_window):
      	* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
      	  meta_screen_grab_all_keys, meta_window_grab_all_keys,
      	  meta_window_ungrab_all_keys, error_on_generic_command,
      	  error_on_command, error_on_terminal_command):
      	* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
      	  error_about_command, main):
      	* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
      	  meta_screen_show_desktop, meta_screen_apply_startup_properties):
      	* src/session.c (warn_about_lame_clients_and_finish_interact):
      	* src/window.[ch] (struct _MetaWindow,
      	  intervening_user_event_occurred, window_activate,
      	  meta_window_delete, meta_window_focus,
      	  meta_window_send_icccm_message, meta_window_client_message,
      	  menu_callback, meta_window_show_menu, struct EventScannerData,
      	  check_use_this_motion_notify, meta_window_begin_grab_op,
      	  meta_window_set_user_time):
      	* src/workspace.[ch] (focus_ancestor_or_mru_window,
      	  meta_workspace_activate_with_focus, meta_workspace_activate,
      	  meta_workspace_focus_default_window,
      	  focus_ancestor_or_mru_window):
      	Fix issues on 64-bit machines with timestamps by using guint32
      	(like gtk+ does) instead of Time.  #348305
      3b047877
  5. 21 Aug, 2006 1 commit
    • Elijah Newren's avatar
      Allow drags & resizes to be reverted by hitting escape. Based on patch · 7489dbc3
      Elijah Newren authored
      2006-08-21  Elijah Newren  <newren gmail com>
      
      	Allow drags & resizes to be reverted by hitting escape.  Based on
      	patch from Thomas Andersen.  #126497.
      
      	* src/display.c (grab_op_is_mouse_only): new function,
      	(meta_display_begin_grab_op): grab the keyboard when moving or
      	resizing too so that we can get escape keypresses
      
      	* src/display.h (struct _MetaDisplay): add a comment to remind
      	that grab_was_cancelled is only used in wireframe mode
      
      	* src/keybindings.[ch] (process_mouse_move_resize_grab): add new
      	function for handling keypresses during mouse-only moving and
      	resizing, (meta_window_grab_all_keys): add a timestamp parameter
      	and pass it to meta_window_focus(),
      	(meta_display_process_key_event): make sure
      	process_mouse_move_resize_grab() gets called when needed,
      	(process_keyboard_move_grab, process_keyboard_resize_grab):
      	rearrange some code slightly and improve the comments to make it
      	more readable
      7489dbc3
  6. 04 May, 2006 1 commit
    • Søren Sandmann's avatar
      Delete unused META_PRIORITY_COMPOSITE · addc04f4
      Søren Sandmann authored
      Thu May  4 13:30:04 2006  Søren Sandmann  <sandmann@redhat.com>
      
      	* src/ui.h: Delete unused META_PRIORITY_COMPOSITE
      
      	* src/ui.c: Delete argument from meta_ui_get_display().
      
      	* src/c-window.c: Remove the xid->window hashtable and associated
      	code.
      
      	* src/c-screen.[ch]: Rename MetaScreenInfo to MetaCompScreen. Put the
      	xid->windows table here instaed of as a static variable. Also make
      	sure that CompWindows are freed when the screen is unredirected.
      
      	* src/display.c: Delete non USE_GDK_DISPLAY case, as it didn't
      	work and hasn't been compiled for a long time.
      
      	* src/display.[ch] (meta_display_open): Remove argument as it was
      	always NULL (and couldn't possibly be anything else in the
      	USE_GDK_DISPLAY case).
      addc04f4
  7. 15 Apr, 2006 2 commits
    • Elijah Newren's avatar
      Patch from Andy Morum to fix the build with --disable-xsync. #336605 · 5bf3e39e
      Elijah Newren authored
      2006-04-15  Elijah Newren  <newren gmail com>
      
      	* src/display.h: Patch from Andy Morum to fix the build with
      	--disable-xsync.  #336605
      5bf3e39e
    • 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
  8. 13 Apr, 2006 1 commit
  9. 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
  10. 10 Apr, 2006 1 commit
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 22 Dec, 2005 2 commits
  17. 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
  18. 08 Oct, 2005 1 commit
  19. 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
  20. 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
  21. 26 May, 2005 1 commit
  22. 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
  23. 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
  24. 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
  25. 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
  26. 10 Jan, 2005 1 commit
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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