1
0
Fork 0
Commit graph

93 commits

Author SHA1 Message Date
Havoc Pennington
423b5f5f39 add an event_serial argument and use it when the pointer is already
2003-11-24  Havoc Pennington  <hp@redhat.com>

	* src/display.c (meta_display_begin_grab_op): add an event_serial
	argument and use it when the pointer is already grabbed
	automatically on the button press. May fix bug #126871
2003-11-24 18:09:47 +00:00
Havoc Pennington
e98fad3e62 Merge reduced_resources mode patch from the branch. Offers wireframe and
2003-10-12  Havoc Pennington  <hp@redhat.com>

        Merge reduced_resources mode patch from the branch. Offers
	wireframe and no-animations.

	* src/window.c (implement_showing): no animation if we are
	in reduced resources mode

	* src/prefs.c: add REDUCED_RESOURCES pref

	* src/window.c (meta_window_update_keyboard_resize): fix to
	modify grab_anchor_window_pos to grab_wireframe_rect if
	appropriate instead of window->rect

	* src/display.h (struct _MetaDisplay): add grab_start_serial used
	to avoid responding to events that occurred prior to the grab
	initialization.

	Still broken in various ways, specifically EnterNotify that
	occurred prior to XGrabPointer is processed as if it occurred
	after.

	* src/window.c (meta_window_update_keyboard_move): add this
	instead of meta_window_warp_pointer() crack

	* src/effects.c (meta_effects_update_wireframe): draw a kind of
	grid for the wireframe, instead of just a rectangle, like twm

	* src/screen.c (meta_screen_new): line width of 3 for the XOR gc

        "Reduced resources" mode based on wireframe patch from
	Erwann Chenede. Still pretty buggy.

	* src/keybindings.c (process_keyboard_move_grab)
	(process_keyboard_resize_grab): add gruesome wireframe hacks

	* src/display.c (meta_display_end_grab_op): end wireframe
	(meta_display_begin_grab_op): begin wireframe

	* src/effects.c (meta_effects_end_wireframe)
	(meta_effects_update_wireframe, meta_effects_begin_wireframe):
	routines to draw the wireframe stuff

	* src/window.c (window_should_be_showing): hide window when
	doing wireframe, commented out as it breaks grab
	* src/window.c (meta_window_refresh_resize_popup): handle wireframe

	* src/screen.c (meta_screen_new): create a screen->root_xor_gc
	for use in drawing wireframes

	* src/frames.c (meta_frames_push_delay_exposes): repaint
	everything before we delay
2003-10-12 06:25:38 +00:00
Havoc Pennington
8849fad8f9 fix warnings (one was a real bug)
2003-09-29  Havoc Pennington  <hp@redhat.com>

	* src/main.c (find_accessibility_module): fix warnings (one was a
	real bug)

	* src/ui.c (meta_gdk_pixbuf_get_from_pixmap): fix warning that
	probably explains remaining crash on bug #116923. Jeez, need to
	use -Werror here or something.

        Fix #103575, spawn child processes on proper screen.

	* src/keybindings.c (error_on_command): pass --screen to
	metacity-dialog
	(handle_run_command): launch user command with DISPLAY reflecting
	the screen you launch it from

	* src/delete.c (delete_ping_timeout_func): pass --screen to
	metacity-dialog
2003-09-29 16:55:26 +00:00
Ray Strode
2fc880db19 Changed MRU list to be per workspace instead of per display, so sticky
2003-08-15  Ray Strode  <halfline@hawaii.rr.com>

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

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

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

	* src/display.h: Remove mru_list from MetaDisplay

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

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

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

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

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

	* src/workspace.h: Add mru_list to MetaWorkspace and add function
	declarations for meta_workspace_focus_default_window,
	meta_workspace_focus_mru_window, meta_workspace_focus_top_window.
2003-08-15 22:09:55 +00:00
Padraig O'Briain
42182cbe77 Activate window before ending grab. This fixes bug #114037.
2003-07-01  Padraig O'Briain  <padraig.obriain@sun.com>

	* src/keybindings.c (process_tab_grab): Activate window before ending
	grab. This fixes bug #114037.
2003-07-01 14:59:09 +00:00
Rob Adams
34ec58af0a Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on windows.
2003-06-26  Rob Adams  <robadams@ucla.edu>

	Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on
	windows.  Disabled by default.  See #98387.

	* src/keybindings.c (handle_toggle_above): new function implements
	the keybinding

	* src/metacity.schemas.in: add toggle_above keybinding

	* src/prefs.[ch]: add toggle_above keybinding

	* src/window.[ch] (meta_window_make_above): new function to put a
	window into the above state
	(meta_window_unmake_above): new function takes a window out of the
	above state
2003-06-27 14:49:56 +00:00
Rob Adams
3edad8599c CVS2003-05-29 Rob Adams <robadams@ucla.edu>
CVS2003-05-29  Rob Adams  <robadams@ucla.edu>

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

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

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

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

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

: ----------------------------------------------------------------------
2003-05-30 20:24:00 +00:00
Havoc Pennington
1620fd5408 the mask display->ignored_modifier_mask wasn't being bound, due to "<"
2003-05-20  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (meta_change_keygrab): the mask
	display->ignored_modifier_mask wasn't being bound,
	due to "<" instead of "<=" (most people didn't notice
	as display->ignored_modifier_mask included Scroll_Lock).
	Red Hat bugzilla #91301 reported by Youssef Makki

	* src/display.c (meta_change_button_grab): make corresponding
	change for button grabs.
2003-05-21 03:45:58 +00:00
Rob Adams
7fc6c99987 Flip the workspace when using up/down/left/right for move window to, but
2003-05-16  Rob Adams  <robadams@ucla.edu>

	Flip the workspace when using up/down/left/right for move window
	to, but not when specifying a workspace explicitly as in move to
	workspace 4.  Possible fix for #105492.

	* src/keybindings.c (do_handle_move_to_workspace): new function
	moves a window to a workspace with the option to flip to that
	workspace.
	(handle_move_to_workspace): Use new do_handle_move_to_workspace
	function without flipping (a keybinding)
	(handle_move_to_workspace_flip): Use new
	do_handle_move_to_workspace function with flipping (a keybinding)
2003-05-17 00:00:55 +00:00
Havoc Pennington
4b02b0ddf1 fill in window->desc sooner since we use it sooner now.
2003-05-16  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new): fill in window->desc sooner
	since we use it sooner now.

	* src/display.c (meta_display_open): init
	display->grab_update_alarm

	* src/window.c (meta_window_new): initialize the always_sticky
	field
	(meta_window_new): initialize the update_icon_queued field

        Patch from Julien Olivier bug #92335 for converting "show desktop
	mode" to "all windows are minimized" when you open a new window,
	instead of just mapping all the windows again.

	* src/window.c (meta_window_activate): minimize all windows before
	coming out of show desktop mode.
	(meta_window_unminimize): don't toggle show desktop mode here

	* src/screen.c (meta_screen_minimize_all_except): new function
2003-05-16 21:59:08 +00:00
Havoc Pennington
a7c344bbc5 when moving window to another workspace, don't switch to that workspace.
2003-05-03  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (handle_move_to_workspace): when moving
	window to another workspace, don't switch to that workspace.

	* src/window.c (menu_callback): when moving window to another
	workspace, don't switch to that workspace.
2003-05-03 18:14:17 +00:00
Havoc Pennington
75fa56391d support diagonal keypad keybindings, from Dafydd Harries
2003-04-23  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (process_keyboard_move_grab): support
	diagonal keypad keybindings, from Dafydd Harries
2003-04-25 03:32:41 +00:00
Mark McLoughlin
6094763def Give me back my keys.
2003-02-28  Mark McLoughlin  <mark@skynet.ie>

        Give me back my keys.

        * src/keybindings.c: (meta_window_grab_keys): don't
        grab keys on DOCK windows.

        * src/window.c: (recalc_window_type): re-grab the
        keys.
2003-02-27 22:44:36 +00:00
Mark McLoughlin
6af9a11361 release the keyboard grab before sending the action message to the panel.
2003-02-26  Mark McLoughlin  <mark@skynet.ie>

        * src/keybindings.c: (handle_panel_keybinding): release
        the keyboard grab before sending the action message to
        the panel.
2003-02-26 01:55:25 +00:00
Mark McLoughlin
73cce3b174 Take control of the panel's global keybindings. The screenshot utility is
2003-02-24  Mark McLoughlin  <mark@skynet.ie>

        Take control of the panel's global keybindings. The
        screenshot utility is hooked up using a special case
        run_command and the menu and run dialog bindings are
        done using the _GNOME_PANEL_ACTION ClientMessage
        protocol.

        * src/display.[ch]: (meta_display_open): add some atoms.

        * src/keybindings.c:
        (handle_panel_keybinding): impl to handle a keybinding
        by sending an action message to the panel.

        * src/metacity.schemas.in: add schemas for the panel and
        screenshot keybindings and the screenshot commands.

        * src/prefs.[ch]: (update_command),
        (meta_prefs_get_gconf_key_for_command): impl special case
        handling for the screenshot commands. They are stored at
        the the end of the commands array but have named keys.
2003-02-24 02:16:09 +00:00
Havoc Pennington
fb9ad1eb13 when tabbing backward, we are still tabbing *from* the most recently used
2003-02-22  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_get_tab_next): when tabbing
	backward, we are still tabbing *from* the most recently used
	window, not from the least recently used window.

	* src/keybindings.c (struct _MetaKeyBinding): make keycode
	unsigned to match XEvent

	Patch for #84999 based on patch from Mark McLoughlin

	* src/prefs.c: add an add_shift field to MetaKeyPref to
	add shift when grabbing the given keybinding.

	* src/keybindings.c (rebuild_screen_binding_table)
	(rebuild_window_binding_table): refactor to share code,
	and honor add_shift field in MetaKeyPref
2003-02-22 20:31:51 +00:00
Havoc Pennington
9b03b75aaf nuke subdir ChangeLog, there can be only one true ChangeLog.
2003-02-04  Havoc Pennington  <hp@redhat.com>

	* src/themes/Simple/ChangeLog: nuke subdir ChangeLog,
	there can be only one true ChangeLog.

2003-01-30  Havoc Pennington  <hp@redhat.com>

	* src/keybindings.c (process_event): match handlers to key events
	using key codes, not key syms
2003-02-05 03:58:17 +00:00
Havoc Pennington
d02dbd62e9 only hop window to the current workspace if the window was previously
2003-01-21  Havoc Pennington  <hp@redhat.com>

	* src/display.c (event_callback): only hop window to the current
	workspace if the window was previously minimized. Should keep
	mozilla from popping windows over to your current workspace.

2003-01-20  Havoc Pennington  <hp@redhat.com>

        Attempt to fix #85916

	* src/keybindings.c (primary_modifier_still_pressed): new function
	(handle_workspace_switch): handle modifier release prior to
	getting the grab
	(do_choose_window): handle modifier release prior to getting the
	grab

	* src/keybindings.c (grab_keyboard): properly return failure
	if the GrabKeyboard doesn't work
2003-01-21 22:40:25 +00:00
Rob Adams
667a056066 Increase the number of run_command bindings in screen_bindings from 12 to
2003-01-14  Rob Adams <robadams@ucla.edu>

	* src/prefs.c: Increase the number of run_command bindings in
	screen_bindings from 12 to 32.

	* src/prefs.h: Increase the number of META_KEYBINDING_COMMAND_N
	macros from 12 to 32.

	* src/keybindings.c: Increase the number of run_command handlers
	from 12 to 32.
2003-01-15 02:39:07 +00:00
Havoc Pennington
91641c2cf3 select ColormapChangeMask on toplevel windows, maybe a partial fix for
2002-12-18  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new): select ColormapChangeMask
	on toplevel windows, maybe a partial fix for #101478

2002-12-17  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_begin_grab_op): don't use "(null)"
	for null pointers, use "none", so I can distinguish
	glibc-generated (null) which is a bug.
	(key_event_description): ditto
	(meta_display_begin_grab_op): ditto

	* src/window.c (update_sm_hints): ditto

	* src/keybindings.c (reload_modmap): ditto
	(meta_display_process_key_event): ditto
2002-12-19 20:18:54 +00:00
Havoc Pennington
e0c8b245ef new functions to resize to fill screen
2002-12-08  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_fill_vertical)
	(meta_window_fill_horizontal): new functions to resize to
	fill screen

	* src/keybindings.c: add vert, horiz maximize

	* src/prefs.c: had vert, horiz maximize

	* src/metacity.schemas.in: shorten some overlong short
	descriptions that make the keybindings capplet look ugly.
	Add maximize_vertically, maximize_horizontally keys.
2002-12-08 21:09:05 +00:00
Havoc Pennington
c613fed9ef push an error trap around the whole window-key-grab loop
2002-11-06  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (grab_keys): push an error trap around the
	whole window-key-grab loop
	(ungrab_all_keys): avoid requiring return value from the error
	trap, unless in debugging mode
	(regrab_window_bindings, regrab_screen_bindings): push traps
	around the loops, for efficiency

	* src/display.c (event_callback): fix from Padraig O'Briain to
	compress extra MappingNotify events to avoid extra work.
2002-11-06 16:00:56 +00:00
Havoc Pennington
c6b475b251 Optimizations for managing new windows (do not all take effect if
2002-10-21  Havoc Pennington  <hp@redhat.com>

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

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

	* src/display.c (meta_change_button_grab): ditto

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

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

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

	* src/Makefile.am (INCLUDES): define G_LOG_DOMAIN
2002-10-21 21:44:35 +00:00
Havoc Pennington
95e5a13131 check above->mapped before deciding if it overlaps the window being
2002-10-20  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (handle_raise_or_lower): check above->mapped
	before deciding if it overlaps the window being raiselowered,
	fix from Stephane Chauveau
2002-10-20 15:22:40 +00:00
Havoc Pennington
eb647577c3 don't start the cycle process if the binding for switching windows has no
2002-10-18  Havoc Pennington  <hp@redhat.com>

	* src/keybindings.c (do_choose_window): don't start the cycle
	process if the binding for switching windows has no modifier bits,
	just focus the window immediately.

	* src/prefs.c, src/keybindings.c: add a keybinding to move between
	windows that goes in the opposite direction.  This is mostly
	useful if you want to bind unmodified keys to the switch windows
	functions, e.g. if you have "Forward" and "Back" keys on your
	keyboard. Patch from Shilad Sen <shilad sourcelight com>
2002-10-18 22:19:05 +00:00
Havoc Pennington
337812d51d workspaces are all per-screen now, fix accordingly
2002-10-16  Havoc Pennington  <hp@redhat.com>

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

	* src/core.c: fix multihead workspace stuff

	* src/keybindings.c: multihead-rama

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

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

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

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

	* src/window.c (window_query_root_pointer): return whether pointer
	is on window's screen
	(meta_window_handle_mouse_grab_op_event): don't use coordinates
	from other screens when updating a window operation on the current
	screen. I can't believe no one has reported this...
2002-10-16 20:12:24 +00:00
Havoc Pennington
f08337d939 Add a modifier key preference for the Alt+click stuff. Can be set to
2002-10-07  Havoc Pennington  <hp@redhat.com>

        Add a modifier key preference for the Alt+click stuff.
	Can be set to "disabled" as well.

	* src/run-metacity.sh: load .Xmodmap in the Xnest if it exists

	* src/display.c (meta_display_ungrab_window_buttons): ungrab
	AnyModifier in case the modifier changed since we grabbed
	(meta_display_open): rearrange code to use meta_display_close() to
	mop up when we can't find any screens, avoiding the need to
	keep the bail-out code in sync with meta_display_close.

	* src/keybindings.c (devirtualize_modifiers): move this function
	to a public place in display.c

	* src/metacity.schemas.in: add setting for the modifier key
	to use for Alt+left/middle/right click.

	* src/prefs.c (update_binding): add a missing newline to a warning
	(meta_prefs_get_mouse_button_mods): new function

	* src/ui.c (meta_ui_parse_modifier): new function
2002-10-07 23:14:40 +00:00
Christian Neumair
0134973907 src/keybindings.c: Make virtual desktops apply instantly and still show the pager popup 2002-09-09 18:16:25 +00:00
Havoc Pennington
cbb0b8e66c new function
2002-09-03  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_get_tab_current): new function

	* src/keybindings.c (do_choose_window): apply modified patch from
	JeyaSudha to still display tab popup if only one window is on the
	desktop.
2002-09-04 04:15:46 +00:00
Deepa Natarajan
c39a03ad59 add maximize and unmaximize keybinding setting. Partly fixes bug# 78999.
2002-08-21  Deepa Natarajan  <deepa.natarajan@wipro.com>

	* src/keybindings.c, src/metacity.schemas.in, src/prefs.[ch]:
	add  maximize and unmaximize keybinding setting. Partly fixes
	bug# 78999.
2002-08-21 06:47:16 +00:00
Havoc Pennington
9ed1636ffe leave has_fullscreen_func set to TRUE if the window is screen sized and
2002-08-15  Havoc Pennington  <hp@pobox.com>

	* src/window.c (recalc_window_features): leave has_fullscreen_func
	set to TRUE if the window is screen sized and undecorated, even if
	the window isn't resizable. idea from Christian - Manny Calavera -
	Neumair

	* src/keybindings.c (handle_toggle_fullscreen)
	(handle_toggle_maximize): these disabled fullscreen/maximize if
	the window wasn't resizable, should have used has_fullscreen_func
	has_maximize_func instead.

2002-08-15  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c: implement raise/lower

	* src/metacity.schemas.in: add raise/lower

	* src/prefs.c: add "raise" and "lower" prefs to keybindings

	* src/display.c (meta_display_set_grab_op_cursor): assert that
	the screen arg is non-NULL in appropriate cases
2002-08-15 05:14:49 +00:00
Havoc Pennington
154e38e71e raise window when moving to another workspace bug #88896
2002-08-10  Havoc Pennington  <hp@pobox.com>

	* src/window.c (menu_callback): raise window when moving to
	another workspace bug #88896

	* src/keybindings.c (switch_to_workspace): raise window when
	moving between spaces
2002-08-10 17:17:58 +00:00
Havoc Pennington
4c3a20c3f2 filter out key events that happen on popup menus etc.
2002-08-10  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (meta_display_process_key_event): filter out
	key events that happen on popup menus etc.

	* src/ui.c (meta_ui_window_is_widget): new function to check
	whether a window belongs to a GtkWidget such as the popup menu

	* src/prefs.c (change_notify): put in a no-op line for AIX
	compiler, #84252
2002-08-10 15:55:18 +00:00
Havoc Pennington
79857803de disable maximize, fullscreen, shade via keybindings on windows that don't
2002-08-09  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (handle_toggle_maximize): disable maximize,
	fullscreen, shade via keybindings on windows that don't support
	it.
2002-08-09 14:22:00 +00:00
Craig Black
4fcc9f052e Patch to provide extra cues to the user when using window menu move and
2002-08-08  Craig Black  <blackc@speakeasy.net>

  Patch to provide extra cues to the user when using
  window menu move and resize, #85724.

  * src/common.h: add new cursors

  * src/display.c: (grab_op_is_mouse)
  (meta_display_create_x_cursor), (xcursor_for_op),
  (meta_display_set_grab_op_cursor),
  (meta_display_begin_grab_op):
  The keyboard move and resize grab ops now also use the mouse.
  Allow the grab cursor to be changed during the grab op.
  Hold onto the initial grab position in case of reset.

  * src/display.h: save the initial grab position

  * src/keybindings.c: (process_keyboard_move_grab),
  (process_keyboard_resize_grab), (handle_begin_move),
  (handle_begin_resize):
  The keyboard move and resize grab ops now also use the mouse.

  * src/window.c: (meta_window_client_message), (menu_callback),
  (update_move), (update_resize),
  (meta_window_handle_mouse_grab_op_event), (warp_pointer),
  (meta_window_warp_pointer), (meta_window_begin_grab_op),
  (meta_window_update_resize_grab_op):
  When moving or resizing a window use the last grab position
  in computing change increment.
  Provide support for warping the mouse pointer.

  * src/window.h: new warp pointer and grab op helper functions
2002-08-09 04:27:23 +00:00
Havoc Pennington
00dcef82e3 disable animation when shading windows, just doesn't really convey the
2002-07-28  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_shade): disable animation when shading
	windows, just doesn't really convey the idea anyway.

	* src/effects.c: Move to using a shaped window instead of
	IncludeInferiors to do the animations, looks a lot better
	because we don't have to grab the server.

	* src/window.c (meta_window_change_workspace): remove bogus
	assertion that was causing a crash
	(meta_window_new): auto-fullscreen huge undecorated windows.

	* src/keybindings.c (switch_to_workspace): use
	meta_window_change_workspace() to avoid same bug in cut-and-paste
	code from there
2002-08-06 04:11:23 +00:00
Craig Black
ae148bc89f change alt+tab to a windowless grab, fixes #83499
2002-08-03  Craig Black  <blackc@speakeasy.net>

  * src/keybindings.c: (meta_display_process_key_event),
  (process_tab_grab), (do_choose_window): change alt+tab
  to a windowless grab, fixes #83499
2002-08-03 23:30:48 +00:00
Havoc Pennington
197c81178c handle NULL screen from screen_for_xwindow
2002-07-23  Havoc Pennington  <hp@redhat.com>

	* src/keybindings.c (meta_display_process_key_event): handle
	NULL screen from screen_for_xwindow

	* src/display.c (meta_display_screen_for_xwindow): put an error
	trap around the XGetWindowAttributes(), should fix the popular
	"closing a window results in a crash" bug.

	* src/util.c (print_backtrace): support optional backtrace
	feature using gnu libc backtrace() call
2002-07-23 19:12:02 +00:00
Havoc Pennington
812f783084 adapt to virtual modifiers (meta_display_process_mapping_event): we need
2002-07-13  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c: adapt to virtual modifiers
	(meta_display_process_mapping_event): we need to reload the
	binding tables now when the modmap changes.

	* src/prefs.c (update_binding): parse virtual modifiers, not
	plain modmask

	* src/common.h (MetaVirtualModifer): new enum

	* src/ui.c (meta_ui_parse_accelerator): use
	egg_accelerator_parse_virtual()

	* src/Makefile.am: add eggaccelerators.[hc] for the virtual
	accelerator parsing function
2002-07-14 03:16:41 +00:00
Havoc Pennington
42639fc9fb option to display error when a command fails to run.
2002-07-11  Havoc Pennington  <hp@pobox.com>

	* src/metacity-dialog.c (main): option to display error when a
	command fails to run.

	* src/keybindings.c (handle_run_command): run commands
	in response to keybindings.

	* src/prefs.c: add command keybinding stuff

	* src/metacity.schemas.in: add keybindings for running commands,
	and keys to store the commands themselves.
2002-07-11 04:10:44 +00:00
Havoc Pennington
93902aabfd fix short description for begin_resize, patch from Jayaraj, #87654
2002-07-09  Havoc Pennington  <hp@pobox.com>

	* src/metacity.schemas.in: fix short description for
	begin_resize, patch from Jayaraj, #87654

	* src/keybindings.c (handle_begin_resize): apply patch from
	Jayaraj to actually handle the begin resize keybinding.
2002-07-10 03:51:01 +00:00
Havoc Pennington
8c3437fd27 put _NET_DESKTOP_NAMES in the array of atom names, so desktop names might
2002-07-06  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_open): put _NET_DESKTOP_NAMES in the
	array of atom names, so desktop names might work and we don't read
	uninitialized memory.

	* src/main.c (main): add VERSION/timestamp verbose message.

	* src/keybindings.c: implement cycle_windows cycle_panels

	* src/metacity.schemas.in: add the cycle_windows cycle_panels
	keybindings

	* src/prefs.h (META_KEYBINDING_FOCUS_PREVIOUS): replace
	FOCUS_PREVIOUS key binding with CYCLE_WINDOWS and CYCLE_PANELS
	(not good names really, but I don't have ideas).

	* src/common.h: add a grab op for alt+esc window cycling
2002-07-06 16:50:48 +00:00
Havoc Pennington
d826e620a9 use new macros to get whether we allow move/resize correct
2002-07-02  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_show_menu): use new macros to get
	whether we allow move/resize correct

	* src/frame.c (meta_frame_get_flags): use new macros to get
	whether we can move/resize correct, considering
	maximized/fullscreen for the move case.

	* src/window.h (META_WINDOW_ALLOWS_RESIZE,
	META_WINDOW_ALLOWS_MOVE): new macros

	* src/keybindings.c (process_keyboard_resize_grab): finish the
	right/left resize, patch from Jayaraj #78179.

	Has the same old move/resize bug, if it hits a constraint it
	starts to break because we move without resizing.
2002-07-03 02:32:40 +00:00
Mark McLoughlin
b6177f74a7 rename from {un}grab_all_keys_and_keyboard and only do an XKeyboardGrab,
2002-07-02  Mark McLoughlin  <mark@skynet.ie>

        * src/keybindings.c:
        (grab_keyboard), (ungrab_keyboard): rename from
        {un}grab_all_keys_and_keyboard and only do an XKeyboardGrab,
        the XKeyGrab isn't neccessary.
        (meta_screen_grab_all_keys), (meta_screen_ungrab_all_keys),
        (meta_window_grab_all_keys), (meta_window_ungrab_all_keys):
        update for above change.
        (handle_workspace_switch): don't use a MetaWindow when
        workspace switching, use the root window instead.
2002-07-02 05:03:28 +00:00
Mark McLoughlin
086f3d807e Fix broken workspace switching from my previous commit.
2002-07-01  Mark McLoughlin  <mark@skynet.ie>

        Fix broken workspace switching from my previous commit.

        * src/display.c: (meta_display_begin_grab_op): don't
        leak a pointer grab if we fail to grab the keyboard.

        * src/keybindings.c: (meta_screen_grab_keys): check
        screen->all_keys_grabbed.
        (meta_screen_grab_all_keys): regrab our standard
        bindings if we fail.
        (handle_workspace_switch): revert to our previous
        behaviour of using the last focused window to do
        the grab upon. Only use the RootWindow if there
        isn't anything else to use.

        * src/screen.c: (meta_screen_new): initialise
        all_keys_grabbed.
2002-07-01 03:20:29 +00:00
Mark McLoughlin
6b72d622a5 Fixes not being able to tab out of a workspace which contains no windows.
2002-06-26  Mark McLoughlin  <mark@skynet.ie>

        Fixes not being able to tab out of a
        workspace which contains no windows.

        * src/core.c: (meta_core_begin_grab_op): upd
        for meta_display_begin_grab_op change.
        (meta_core_get_grab_frame): allow for
        grab_window == NULL.

        * src/display.[ch]:
        (meta_display_screen_for_xwindow): implement.
        (meta_display_begin_grab_op): grab on the root window
        if window == NULL.
        (meta_display_end_grab_op): use grab_screen instead of
        grab_window.

        * src/keybindings.c:
        (grab_all_keys_and_keyboard): split out from
        meta_window_grab_all_keys.
        (ungrab_all_keys_and_keyboard): split out from
        meta_window_ungrab_all_keys.
        (meta_screen_grab_all_keys), (meta_screen_ungrab_all_keys):
        implement grabbing and ungrabbing on the root window.
        (meta_display_process_key_event): if window == NULL,
        check the event is from the same screen and process. Only
        happens with workspace switching.
        (process_workspace_switch_grab): kill window param and
        don't use grab_window.
        (handle_tab_forward), (handle_begin_move): upd for
        meta_display_begin_grab_op change.
        (handle_workspace_switch): remove brokeness. Always do
        the grab op on the root window.

        * src/keybindings.h: add meta_screen_{un}grab_all_keys.

        * src/window.c: (meta_window_client_message), (menu_callback):
        update for meta_display_begin_grab_op change.
2002-06-27 05:08:32 +00:00
Havoc Pennington
b0d3660c91 handle UNKNOWN keyboard resizing state
2002-06-19  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_resize_gravity_from_grab_op): handle UNKNOWN
	keyboard resizing state

	* src/keybindings.c (process_keyboard_resize_grab): implement
	keyboard resize key handling somewhat (only vertical resize works,
	left/right arrow not implemented, and visual feedback of the
	edge we're resizing isn't implemented)

	* src/window.c (menu_callback): start keyboard resize grab when
	it's chosen from the menu
2002-06-19 04:12:49 +00:00
Havoc Pennington
82a43d88f5 don't pass a null string to printf
2002-06-15  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (meta_display_process_key_event): don't pass a
	null string to printf

	* src/display.c (key_event_description): don't pass a null string
	to printf

	* src/keybindings.c (meta_set_keybindings_disabled): allow
	enable/disable keybindings regardless of debug mode.
2002-06-16 03:03:08 +00:00
Erwann Chenede -
4dfc8d16be verify the active window has the appropriate close/minimize function
2002-06-10 Erwann Chenede - <erwann.chenede@sun.com>

        * src/keybindings.c : (handle_close_window, handle_minimize_window)
	verify the active window has the appropriate close/minimize function
	before closing or minimizing the window.
2002-06-10 10:17:54 +00:00
Havoc Pennington
b168954ed3 Cleanups to workspace popup patch. Space before all parens in a couple
2002-06-08  Havoc Pennington  <hp@pobox.com>

        Cleanups to workspace popup patch. Space before all parens
	in a couple places.

	* src/prefs.c (meta_prefs_get_keybinding_action): fix brace
	indentation, and use while instead of for loop. Take a "mask"
	argument to avoid ambiguity issues.

	* src/keybindings.c (handle_workspace_switch): rename from
	handle_workspace_forward since there's no directionality here
	(handle_workspace_switch): add a FIXME about how screwed it is
	that we need a window in order to do our grab. Should be able to
	grab on a dummy window like no_focus_window or the root window.
	(process_workspace_switch_grab): rename from tab_grab for clarity,
	no tab involved here.

	* src/common.h (enum): have only one grab op for all workspace
	switching directions, instead of one for each.
2002-06-09 04:04:19 +00:00