1
0
Fork 0
Commit graph

145 commits

Author SHA1 Message Date
Havoc Pennington
72b08c82b1 sort source files into these directories according to which part of the WM
2007-12-19  Havoc Pennington  <hp@redhat.com>

	* src/ui, src/core, src/include: sort source files into these
	directories according to which part of the WM they are supposed to
	be in. In an eventual plan, we should also create
	src/compositor/render, src/compositor/fallback and move some of
	the compositor stuff into that.
	
	* autogen.sh: require a newer automake, so we don't have to use
	a recursive build

	* src/ui/tabpopup.c: put in a hack to make the build temporarily
	work, want to commit the large rearrangement before fixing this
	not to include workspace.h or frame.h

	* src/core/iconcache.c (meta_read_icons): temporarily break this
	to get the build to work, want to commit the large rearrangement
	before fixing this file not to include theme.h


svn path=/trunk/; revision=3491
2007-12-19 21:17:50 +00:00
Thomas Thurman
4564236abf Recur if the keypress ended a grab, so it can be processed in its own
2007-12-08  Thomas Thurman  <tthurman@gnome.org>

        * src/keybindings.c (meta_display_process_key_event): Recur if the
        keypress ended a grab, so it can be processed in its own right.
        Closes #112560.


svn path=/trunk/; revision=3464
2007-12-09 22:56:12 +00:00
Yair Hershkovitz
5194df842c Add support for RTL languages so that alt-tab, etc., go the other way. In
2007-05-25  Yair Hershkovitz  <yairhr@yahoo.com>

        * src/workspace.c (meta_workspace_get_neighbor): Add support
        for RTL languages so that alt-tab, etc., go the other way.
        * src/keybindings.c (handle_activate_menu): In RTL locales,
        pop up the menu on the right-hand side when the menu keystroke
        is pressed.
        * src/fixedtip.c (meta_fixed_tip_show): right-justify tooltips
        in RTL locales.
        * src/menu.c (popup_position_func): popup menus in RTL locales
        are flush with the right-hand side of the window where possible.
        * src/frames.c (show_tip_now, meta_frames_button_press_event):
        tooltips are aligned with the right-hand side of buttons in
        RTL locales.
        * src/ui.[ch] (meta_ui_get_direction, enum MetaUIDirection):
        New content.
        * src/window.c (meta_window_show_menu): "move left" appears above
        "move right" in the window menu for LTR locales, and vice versa
        for RTL locales.

        This is all to close bug #387893.


svn path=/trunk/; revision=3222
2007-05-25 14:36:12 +00:00
Elijah Newren
ebfbef86a0 Remove grab_start_serial, which we expect to be an ancient attempt to
2007-04-08  Elijah Newren  <newren gmail com>

	Remove grab_start_serial, which we expect to be an ancient attempt
	to workaround sloppy/mouse focus bugs that have since been
	correctly fixed.  May fix some race conditions.  May cause nasty
	bugs in sloppy/mouse focus modes.  We'll find out soon enough...
	See #304430.

	* src/display.c (event_callback):
	remove event->xany.serial >= display->grab_start_serial in several
	event callback handlers

	* src/display.[ch] (struct _MetaDisplay, meta_display_begin_grab_op):
	* src/keybindings.c (do_choose_window, handle_workspace_switch):
	* src/frames.c (meta_frames_button_press_event):
	* src/core.[ch] (meta_core_begin_grab_op):
	* src/window.c (meta_window_client_message, meta_window_begin_grab_op):
	don't require an event_serial to be passed to
	meta_display_begin_grab_op () and don't record it anymore.

	* src/ui.c (struct _EventFunc, filter_func,
	  meta_ui_get_last_event_serial)
	* src/core.h (meta_ui_get_last_event_serial):
	remove meta_ui_get_last_event_serial() function (don't ask me why
	it was declared in core.h) and the last_even_serial field of
	_EventFunc

svn path=/trunk/; revision=3182
2007-04-09 05:49:57 +00:00
Elijah Newren
addf369006 Fix move/resize events in relation to combinations of ConfigureRequest and
2007-04-08  Elijah Newren  <newren gmail com>

	Fix move/resize events in relation to combinations of
	ConfigureRequest and WM_NORMAL_HINTS change notifications (plus a
	few code cleanups).  Fixes #426519.

	* src/window.c (meta_window_move_resize_now):
	move to the user_rect position, not some weird combination of rect
	and user_rect

	* src/window.c (meta_window_configure_request):
        set user_rect in response to ConfigureRequest events (after the
	ConfigureRequest values have been constrained) and add a big
	comment explaining this change, remove unused only_resize variable
	and irrelevant huge FIXME comment about it

	* src/window.[ch] (meta_window_get_client_root_coords):
	new function

	* src/display.c (meta_display_begin_grab_op):
	* src/keybindings.c (process_keyboard_move_grab):
	* src/window.c (meta_window_unmaximize,
	  meta_window_move_resize_internal, meta_window_begin_wireframe,
	  update_move, meta_window_refresh_resize_popup,
	  warp_grab_pointer)
	combine multi-step client rect root coord setting into a single
	function call to meta_window_get_client_root_coords()

svn path=/trunk/; revision=3181
2007-04-09 03:43:55 +00:00
Elijah Newren
0a8bdcdcb3 Add an (unbound by default) keybinding for setting spew marks in verbose
2007-04-07  Elijah Newren  <newren gmail com>

	* src/prefs.[ch] (screen_bindings array,
	  META_KEYBINDING_SET_SPEW_MARK definition):
	* src/keybindings.c (handle_spew_mark, screen_handlers array):
	Add an (unbound by default) keybinding for setting spew marks in
	verbose debugging logs.  I'm not sure why this was ever removed;
	I've wanted it so many times.

	* HACKING:
	valgrind wants --log-file not --logfile.

svn path=/trunk/; revision=3174
2007-04-07 22:16:35 +00:00
Elijah Newren
da7d198757 turn mouse_mode off to prevent focus issues with the run application
2007-04-03  Elijah Newren  <newren gmail com>

	* src/keybindings.c (handle_panel_keybinding): turn mouse_mode off
	to prevent focus issues with the run application dialog.  Fixes
	#374752.

svn path=/trunk/; revision=3149
2007-04-03 20:19:12 +00:00
Justin Mason
c68c26b7f8 implement handle_move_to_{side|corner}_* to allow the user to flip a
2006-11-05  Justin Mason  <jm@jmason.org>

        * src/keybindings.c: implement handle_move_to_{side|corner}_* to
        allow the user to flip a window to the side or corner of the
        screen. Fixes #317884.
        * src/prefs.h: keybindings for the above.
        * src/metacity.schemas.in: keybindings for the above.
2006-11-05 22:23:44 +00:00
Carlo Wood
d79a571d0a Fix cases when titlebar is allowed offscreen and shouldn't be (and
2006-10-13  Carlo Wood <carlo@alinoe.com>

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

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

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

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

	* constraints.c (constrain_titlebar_visible):
	Replace previous ugly hack by using grab_frame_action (and whether
	the action is a user action) to determine whether to enforce the
	titlebar_visible constraint.
2006-10-13 00:28:34 +00:00
Elijah Newren
0201fcfc6c Stick an emacs comment directive at the beginning of all the code files so
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
2006-10-01 22:30:10 +00:00
Elijah Newren
5c587726ae Partial audit to fix timestamp usage. One step towards fixing #355180; see
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.
2006-09-18 17:27:24 +00:00
Elijah Newren
3b0478776d Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
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
2006-09-13 16:32:33 +00:00
Elijah Newren
555d7dc90c Avoid a stuck grab, preventing focus from being transferred between
2006-09-09  Elijah Newren  <newren gmail com>

	Avoid a stuck grab, preventing focus from being transferred
	between windows.  Thanks to Fryderyk Dziarmagowski for steps to
	reproduce.  Fixes at least part of #354422.

	* src/display.c (meta_display_begin_grab_op,
	meta_display_end_grab_op): pass timestamp to
	meta_screen_ungrab_all_keys, meta_screen_ungrab_all_keys, and
	meta_window_ungrab_all_keys

	* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard): add a
	timestamp parameter and remove call to
	meta_display_get_current_time(), (meta_screen_grab_all_keys,
	meta_screen_ungrab_all_keys, meta_window_ungrab_all_keys): add a
	timestamp parameter and pass it on to grab_keyboard and
	ungrab_keyboard
2006-09-09 20:19:56 +00:00
Elijah Newren
88b9efd0b7 Patch from Ed Catmur to fix keybindings with hex-values (coming from
2006-08-21  Elijah Newren  <newren gmail com>

	Patch from Ed Catmur to fix keybindings with hex-values (coming
	from special extended keyboard keys).  #140448.

	* src/keybindings.c (struct _MetaKeyBinding): change keycode from
	KeyCode to unsigned int (comment from Elijah: why???),
	(reload_keycodes): only grab keysyms for keybindings that have
	them, (count_bindings, rebuild_binding_table): bindings can be
	valid either due to a valid keysym or a valid keycode,
	(display_get_keybinding_action, meta_change_keygrab,
	process_tab_grab, process_workspace_switch_grab): handle keycode
	as well as keysym

	* src/prefs.[ch] (struct MetaKeyCombo, update_binding,
	update_list_binding): handle keycode as well as keysym

	* src/ui.[ch] (meta_ui_accelerator_parse): new function special
	cases strings of the form "0x[0-9a-fA-F]+" and otherwise calling
	gtk_accelerator_parse(), (meta_ui_parse_accelerator,
	meta_ui_parse_modifier): call meta_ui_accelerator_parse instead of
	gtk_accelerator_parse.
2006-08-21 19:06:26 +00:00
Elijah Newren
7489dbc34e Allow drags & resizes to be reverted by hitting escape. Based on patch
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
2006-08-21 18:38:21 +00:00
Elijah Newren
d4973e8d1b Patch from Thomas Andersen to return the window to maximized state if the
2006-08-07  Elijah Newren  <newren gmail com>

	* src/keybindings.c (process_keyboard_move_grab): Patch from
	Thomas Andersen to return the window to maximized state if the
	window was "shaken loose" from maximized state during a resize but
	the resize is later aborted.  #346719.
2006-08-07 19:24:41 +00:00
Thomas Thurman
fee1fb094a Allow any keybinding pref to be specified either with <foo>, a string, or
2004-04-17  Thomas Thurman <thomas@thurman.org.uk>

        * keybindings.c (count_bindings, rebuild_binding_table):
        * prefs.c (change_notify, screen_bindings,
        window_bindings, init_bindings, update_binding,
        find_and_update_list_binding, update_list_binding,
        meta_prefs_get_window_binding): Allow any keybinding pref
        to be specified either with <foo>, a string, or <foo>_list,
        a list of strings, or both. Fixes #164831.
2006-04-17 17:23:09 +00:00
Thomas Thurman
2214fd75d9 Add a tabbing function, bound to alt-f6 by default, to cycle through the
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
2006-04-15 02:05:44 +00:00
Björn Lindqvist
ea50cc7239 *** empty log message *** 2006-04-13 13:16:42 +00:00
Elijah Newren
8ceb613668 We had that prev_window code in multiple places and it was all identical.
2006-02-13  Elijah Newren  <newren gmail com>

	* src/keybindings.c (process_tab_grab):
	We had that prev_window code in multiple places and it was all
	identical.  Let's just stick it in one place to make the function
	easier to read.
2006-02-13 19:26:40 +00:00
Thomas Thurman
500bbefc6a Allow alt-escape to cancel alt-tabbing, and vice versa. Fixes #141425.
2006-02-13  Thomas Thurman <thomas thurman org uk>

	* src/keybindings.c (process_tab_grab):
	Allow alt-escape to cancel alt-tabbing, and vice versa.  Fixes
	#141425.
2006-02-13 19:16:32 +00:00
Thomas Thurman
ce3299e815 Disable alt-f7 if a window can't be moved, and alt-f8 if it can't be
2006-02-11  Thomas Thurman <thomas thurman org uk>

        Disable alt-f7 if a window can't be moved, and alt-f8 if it
        can't be resized.  Fixes #328920.

        * src/keybindings.c (handle_begin_move, handle_begin_resize):
        check window->has_*_func before beginning operation
2006-02-12 03:17:10 +00:00
Elijah Newren
32d4bd6b63 Patch from Kjartan Maraas to fix a lot of tiny issues (unused variable
2006-01-20  Elijah Newren  <newren gmail com>

	* src/async-getprop.c:
	* src/common.h:
	* src/display.c:
	* src/eggaccelerators.c:
	* src/frames.c:
	* src/gradient.c:
	* src/iconcache.c:
	* src/keybindings.c:
	* src/metaaccellabel.c:
	* src/place.c:
	* src/prefs.c:
	* src/preview-widget.c:
	* src/screen.c:
	* src/session.c:
	* src/stack.c:
	* src/tabpopup.c:
	* src/theme-viewer.c:
	* src/theme.c:
	* src/window-props.c:
	* src/window.c:
	* src/workspace.c:
	* src/tools/metacity-window-demo.c:
	* src/wm-tester/test-gravity.c:
	* src/wm-tester/test-resizing.c:
	* src/wm-tester/test-size-hints.c:
	Patch from Kjartan Maraas to fix a lot of tiny issues (unused
	variable removal, making unused variables used again, correction
	of types passed/declared for printf arguments, removal of unneeded
	breaks and returns, dead code removal, dead code revival, renaming
	to prevent shadowed variables, declaring unexported functions as
	static) spotted by the intel compiler.  #321439
2006-01-20 22:03:56 +00:00
Elijah Newren
9fdd3d165d Fix accidental overzealous focus holding by the terminal introduced by the
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.
2006-01-15 17:03:57 +00:00
Elijah Newren
5913b8c5ab Whoops, I forgot to keep my copyright info updated with my previous
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...
2006-01-10 19:43:21 +00:00
Elijah Newren
f6270596de Don't "steal" focus from terminal windows for new window mappings as the
2006-01-10  Elijah Newren  <newren@gmail.com>

	Don't "steal" focus from terminal windows for new window mappings
	as the difference in usage between terminals and other apps seems
	to suggest this difference in treatment.  See #326159 for details,
	feedback welcome.

	* src/window.[ch] (__window_is_terminal): New function, currently
	an ugly hack and should be replaced by a new property set by
	applications if the behavior works to our liking,
	(window_state_on_map): don't transfer focus to new windows from
	terminals unless the new window is a transient of the focused
	terminal

	* src/keybindigns.c (handle_panel_keybinding): panel run dialog
	keybinding should be counted as an explicit transfer of focus to
	the new window, so override the
	don't-transfer-focus-from-terminals in this case
2006-01-10 18:33:53 +00:00
Elijah Newren
703f58cdf7 Make the workspace switcher work with dual-head (non-xinerama) setups.
2005-12-27  Elijah Newren  <newren@gmail.com>

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

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

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

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

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

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

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

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

	Add my copyright notice to a number of files on which it should
	already exist.
2005-10-08 19:38:54 +00:00
Elijah Newren
4aaf6e3eb4 Patch from Ross Cohen to make alt-esc consistent with alt-tab by leaving
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Ross Cohen to make alt-esc consistent with alt-tab by
	leaving stacking of unselected windows unchanged.  Fixes #314285.

	* src/keybindings.c (process_tab_grab): before raising and showing
	the next candidate, reset the stack positions to what they were
	at the beginning of the grab
2005-10-03 20:05:44 +00:00
Elijah Newren
12daca5cb1 Patch from Ross Cohen to make alt-esc (show windows instantly) actually
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Ross Cohen to make alt-esc (show windows instantly)
	actually show minimized windows too.  Fixes #107072.

	* src/keybindings.c (process_tab_grab): initialize tab_unminimized
	to FALSE for the target window when starting the grab, when
	advancing through the list check to find the previous window and
	re-minimize it if it was tab-unminimized, unminimize the new
	window we're alt-esc'ing to if it's minimized, (do_choose_window):
	raise and unminimize the initial window as well in alt-esc'ing

	* src/window.h (struct _MetaWindow): add a tab_unminimized field

	* src/window.c (meta_window_new_with_attrs): initialize
	tab_unminimized to false
2005-10-03 20:02:31 +00:00
Ray Strode
2972ab6df6 Improve the behavior of keyboard move/resize and edge snapping. Still not
2005-08-03  Ray Strode  <rstrode@redhat.com>

	Improve the behavior of keyboard move/resize and edge
	snapping.  Still not perfect, bug 310888.

	* src/effects.c (draw_xor_rect): Make the outside of a
	wireframe rectangle line up with the outside edge of its
	window, instead of centering the wireframe edges on the
	window edges.

	* src/keybindings.c (process_keyboard_move_grab): allow
	edge snapping in wireframe mode.  Adjust code to take
	into account changed semantics of find_next_*_edge
	functions.
	(process_keyboard_resize_grab_op_change): new function
	to take some orthogonal logic out of
	process_keyboard_resize_grab_op.  Only allow keyboard
	resize cursor to go to flat edges, not corners.
	(process_keyboard_resize_grab):  allow edge snapping in
	wireframe mode.  Fix up snapping logic.

	* src/place.c (get_{vertical,horizontal}_edges): use
	GArray instead of int *, since the number of output
	edges isn't known until the middle of the function now.
	Use xor rect extents instead of window extends if in
	wireframe mode.
	(meta_window_find_next_{vertical,horizontal}_edge: add
	new source_edge_position parameter to specify which edge
	on the active window to start from when looking for next
	edge on the screen. Return the coordinate of the edge
	found and not the coordinate of where the window should be
	moved to snap to where the edge was found.

	* src/window.c (update_move): all the user to specify
	an edge to resize with mouse in keyboard resize mode.
	window
2005-08-03 02:22:00 +00:00
Ray Strode
7b416a0a2d Actually commit the stuff mentioned in the last ChangeLog entry.
2005-05-26  Ray Strode  <rstrode@redhat.com>

	Actually commit the stuff mentioned in the last
	ChangeLog entry.
2005-05-26 19:58:17 +00:00
Elijah Newren
612507260a Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes #167545.
2005-02-21  Elijah Newren  <newren@gmail.com>

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

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

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

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

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

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

	* src/workspace.c (meta_workspace_activate_with_focus): add a
	FIXME in a potentially duplicate section of code,
	(meta_workspace_focus_default_window): use the same focus choice
	as click-to-focus if in keynav mode.
2005-02-22 02:11:25 +00:00
Elijah Newren
2d0d5e8cac Restore original stacking when aborting an alt-esc window switch
2005-01-23  Elijah Newren  <newren@gmail.com>

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

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

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

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

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

	* src/stack.h: (meta_stack_get_postions,
	meta_stack_set_positions): new functions
2005-01-24 05:58:30 +00:00
Elijah Newren
d8d77bd65b Focus the desktop when showing it. Fixes #159257.
2004-12-19  Elijah Newren  <newren@gmail.com>

	Focus the desktop when showing it.  Fixes #159257.

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

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

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

	* src/screen.h (meta_screen_show_desktop): add a timestamp
	parameter
2004-12-20 02:46:42 +00:00
Elijah Newren
ccd4414a0f Patch from Soeren to fix the modifier key breakage introduced by an Xorg
2004-10-20  Elijah Newren  <newren@math.utah.edu>

	Patch from Soeren to fix the modifier key breakage introduced by
	an Xorg change. (fixes #151554)

	* src/keybindings.c: include X11/XKBlib.h if available,
	(handle_spew_mark): remove this unused function declaration,
	(end_keyboard_grab): new function, uses XKB if available,
	(process_tab_grab): use end_keyboard_grab to determine whether to
	end the grab, (error_on_command): make key a const char *,
	(process_workspace_switch_grab): use end_keyboard_grab to
	determine whether to end the grab
2004-10-20 23:16:08 +00:00
Elijah Newren
e84778d1eb Make the "showing desktop" mode be per-workspace instead of per-screen.
2004-10-16  Elijah Newren  <newren@math.utah.edu>

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

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

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

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

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

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

	* src/workspace.h (struct _MetaWorkspace): add showing_desktop
	field
2004-10-17 04:28:29 +00:00
Elijah Newren
3c974b87b4 Fix from Rob to correct requested number of keycodes (#155247)
2004-10-15  Elijah Newren  <newren@math.utah.edu>

	* src/keybindings.c (reload_keymap): Fix from Rob to correct
	requested number of keycodes (#155247)
2004-10-15 22:43:52 +00:00
Vincent Untz
b03558dc4d Add a keybinding to launch a terminal
2004-10-13  Vincent Untz  <vincent@vuntz.net>

	Add a keybinding to launch a terminal

	* src/keybindings.c: (handle_run_terminal): new function,
	(error_on_generic_command): new function, (error_on_command): wrapper
	around error_on_generic_command(), (error_on_terminal_command): new
	function

	* src/metacity.schemas.in: add run_command_terminal key

	* src/prefs.[ch]: (meta_prefs_init): cache the terminal command and
	register a gconf callback to update it, (change_notify): handle the
	notification of terminal command changes, (meta_preference_to_string):
	add the terminal command case, (update_terminal_command): new function,
	(meta_prefs_get_terminal_command): new function,
	(meta_prefs_get_gconf_key_for_terminal_command): new function
2004-10-13 08:32:10 +00:00
Elijah Newren
16b9aff47c Fix a variety of focus race conditions in all focus modes, or at least
2004-10-04  Elijah Newren  <newren@math.utah.edu>

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

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

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

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

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

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

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

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

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

	* src/workspace.c (meta_workspace_focus_mru_window): make this
	function take a timestamp and use it for meta_window_focus or
	XSetInputFocus, (meta_workspace_activate_with_focus): make this
	function take a timestamp and pass it along to meta_window_focus
	and meta_workspace_focus_default_window,
	(meta_workspace_activate): make this function take a timestamp and
	pass it to meta_workspace_activate_with_focus),
	(meta_workspace_focus_default_window): make this function take a
	timestamp, warn if its 0 but try to handle that case sanely, and
	pass the timestamp on to meta_window_focus or
	meta_workspace_focus_mru_window or XSetInputFocus
2004-10-04 20:32:59 +00:00
Elijah Newren
7b1e571919 Focus the default window after the user dismisses the workspace switcher
2004-09-22  Elijah Newren  <newren@math.utah.edu>

	* src/keybindings.c (process_workspace_switch_grab): Focus the
	default window after the user dismisses the workspace switcher
	popup (fixes #123803; note that an alternate fix was made
	independently by David Baron for sloppy and mouse focus users)
2004-09-22 19:15:26 +00:00
Kjartan Maraas
43cc3b8606 A load of fixes of issues reported by sparse. Closes bug #152849
2004-09-17  Kjartan Maraas  <kmaraas@gnome.org>

	* src/bell.c: (meta_bell_flash_screen):
	* src/compositor.c:
	* src/effects.c: (meta_effects_draw_box_animation):
	* src/fixedtip.c: (meta_fixed_tip_show):
	* src/frame.c: (find_argb_visual):
	* src/frames.c: (unsigned_long_hash), (meta_frames_manage_window),
	(meta_frames_apply_shapes):
	* src/iconcache.c: (find_largest_sizes), (find_best_size):
	* src/keybindings.c: (meta_spawn_command_line_async_on_screen):
	* src/main.c: (main):
	* src/menu.c: (meta_window_menu_new):
	* src/prefs.c: (meta_prefs_get_visual_bell),
	(meta_prefs_bell_is_audible), (meta_prefs_get_visual_bell_type),
	(meta_prefs_get_action_double_click_titlebar),
	(meta_prefs_get_auto_raise), (meta_prefs_get_auto_raise_delay),
	(meta_prefs_get_reduced_resources):
	* src/screen.c: (meta_create_offscreen_window):
	* src/tabpopup.c: (meta_ui_tab_popup_get_selected):
	* src/theme-parser.c: (meta_theme_load):
	* src/theme.c: (meta_gtk_widget_get_font_desc):
	* src/tools/metacity-mag.c: (mouse_press), (begin_area_grab):
	* src/util.c: (meta_unsigned_long_hash): A load of fixes of issues
	reported by sparse. Closes bug #152849
2004-09-16 23:18:22 +00:00
Elijah Newren
044d8999a3 Make dialogs that Metacity shows follow focus-stealing-prevention
2004-08-25  Elijah Newren  <newren@math.utah.edu>

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

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

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

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

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

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

	* src/session.c (warn_about_lame_clients_and_finish_inter): pass a
	timestamp of 0 to metacity-dialog to prevent focus (it's a popup
	not generated by and kind of user request).
2004-08-26 00:59:12 +00:00
Havoc Pennington
06a58f43c0 track the last_xor_rect separately from the current window size, and then
2004-08-18  Havoc Pennington  <hp@redhat.com>

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

	* src/window.c (meta_window_get_xor_rect): new function to compute
	the xor rect; it is not really 100% right, because it uses the
	frame dimensions from the window at the start of the move/resize.
	But probably won't break in practice.
2004-08-19 02:05:24 +00:00
Elijah Newren
d0d0925e29 Choose correct window to focus when "un-showing" the desktop. Fixes
2004-06-24  Elijah Newren  <newren@math.utah.edu>

	* src/keybindings.c: (handle_toggle_desktop): Choose correct
	window to focus when "un-showing" the desktop.  Fixes #144900.
2004-06-24 20:47:31 +00:00
Rob Adams
db108c1fc3 Add my copyright notice to a number of files on which it should already
2004-02-23  Rob Adams  <readams@readams.net>

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

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

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

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

	* src/workspace.c (meta_workspace_activate_with_focus): if we're
	in a move grab op, bring along the drag window.
2004-02-15 05:29:49 +00:00