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-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-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
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-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-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-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-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-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 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-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.
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-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-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-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-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-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
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-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-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 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-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-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-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
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-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-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-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-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-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-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-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-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-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.
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