2005-02-06 Elijah Newren <newren@gmail.com>
Set a _METACITY_VERSION property (a utf8 string) on the WM check
window. #165350.
* src/display.h: (struct MetaDisplay): add a atom_metacity_version
field
* src/display.c: (meta_display_open): initialize the
_METACITY_VERSION property on the WM check window to the current
version of Metacity.
2005-01-26 Arvind Samptur <arvind.samptur@wipro.com>
Don't wireframe when accessibility is on, it apparently
causes a desktop wide freeze.
* src/prefs.[ch] (meta_prefs_init) (change_notify)
(update_gnome_accessibility) (meta_preference_to_string)
(meta_prefs_get_gnome_accessibility) : Add code to monitor
accessibility status.
* src/display.c (meta_display_begin_grab_op): Check
accessibility status before going ahead with wireframe.
Fixes#159538
2005-01-24 Elijah Newren <newren@gmail.com>
* src/display.c: (meta_display_begin_grab_op): don't forget to
initialize display->grab_old_window_stacking. Thanks to Sebastien
Bacher and the bleeding edge Ubuntu users for catching the
occasional crash this could cause so quickly, and for verifying
that the patch worked (I couldn't duplicate). Fixes#165093.
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-09 Elijah Newren <newren@gmail.com>
Don't focus the panel on click. Fixes#160470 (and 100470 and
removes the need for the hack from 128200)
* doc/how-to-get-focus-right.txt: Update section on focusing
non-decorated windows (specifically, DOCKS and DESKTOPS)
* src/display.c (event_callback): don't focus dock windows on
click
2004-12-28 Elijah Newren <newren@gmail.com>
Allow users to move the window around immediately after
double-clicking to shade (#90290)
* src/display.c (event_callback): only end the grab op if either
there is no frame or else the frame is not mapped
2004-12-27 Elijah Newren <newren@gmail.com>
* src/display.c (meta_display_set_input_focus_window,
meta_display_focus_the_no_focus_window): Spew warning if
CurrentTime is passed to the function, but don't exit prematurely.
(fixes#162353)
2004-12-22 Elijah Newren <newren@gmail.com>
Wrap XSetInputFocus, making display->expected_focus_window a
little more reliable (see #154598)
* src/display.h: (struct _MetaDisplay): add a large comment about
the expected_focus_window, add a last_focus_time field,
(XSERVER_TIME_IS_BEFORE): new macro moved from window.c but fixed
for 64-bit systems, (meta_display_set_input_focus_window): new
function
* src/display.c (meta_display_open): initialize last_focus_time,
add a comment about brokenness of trying to set intial focus
window, (meta_display_set_input_focus_window): new function that
wraps XSetInputFocus,
(meta_display_focus_the_no_focus_window): make this function
closer to a wrapping of XSetInputFocus for the no_focus_window.
* src/window.c (XSERVER_TIME_IS_LATER): remove this macro in favor
of the improved one added to display.h
* src/display.c (meta_display_open):
* src/window.c (meta_window_focus):
use meta_display_focus_the_no_focus_window and
meta_display_set_input_focus instead of XSetInputFocus
2004-12-22 Elijah Newren <newren@gmail.com>
Partially resolve the conflicting requirements of windows on
multiple workspaces and hidden being a global quantity for windows
(fixes bug 156182; the remainder of the work is bug 87531 and is a
libwnck issue)
* src/display.c (event_callback):
* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
* src/workspace.c (meta_workspace_add_window,
meta_workspace_contains_window,
meta_workspace_queue_calc_showing):
* src/workspace.h:
Remove meta_workspace_contains_window, replace with simple
comparison utilizing window->workspace
* src/place.c (meta_window_place):
* src/window.c (meta_window_shares_some_workspace):
* src/window.h:
Remove meta_window_shares_some_workspace, replace with a simple
comparison utilizing window->workspace
* src/session.c (save_state),
* src/window.c (meta_window_new_with_attrs,
meta_window_apply_session_info, meta_window_free,
window_showing_on_its_workspace,
meta_window_change_workspace_without_transients,
meta_window_unstick, meta_window_set_current_workspace_hint,
meta_window_get_workspaces):
* src/window.h:
* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
meta_workspace_remove_window):
Only one workspace now
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-25 Elijah Newren <newren@math.utah.edu>
Fix the alt-tab order--if the most recently used window is not
focused, start alt tabbing with that window instead of the one
after it (fixes#156251)
* src/display.c (find_tab_forward): add a skip_first parameter,
(find_tab_backward): add a skip_last parameter,
(meta_display_get_tab_next): if a beginning window wasn't given
and the focused window isn't the tab chain, don't skip the MRU
window
2004-10-08 Elijah Newren <newren@math.utah.edu>
Fix middle-frame-click-to-lower focus inconsistency (#154601)
* src/core.c (meta_core_user_lower_and_unfocus): focus the default
window in all focus modes, not just click-to-focus (EnterNotify
events will not handle this case for sloppy and mouse focus)
* src/display.c (event_callback): replace window->has_focus with
window == display->expected_focus_window to avoid a race issue
2004-10-08 Elijah Newren <newren@math.utah.edu>
Alter the meaning of expected_focus_window; doesn't affect
current operation but assists in fixing some other bugs
(#154598)
* src/display.c (meta_display_focus_the_no_focus_window): set the
expected_focus_window to NULL.
* src/window.c (meta_window_notify_focus): don't NULL the
expected_focus_window when that window receives a FocusIn event
2004-10-04 Elijah Newren <newren@math.utah.edu>
* src/display.c (event_callback): if the root window gets focused,
set the focus to the default window; this fixes the
"focus-follows-mouse" behavior seen for click-to-focus mode after
cancelling log out (fixes#153220)
2004-10-04 Elijah Newren <newren@math.utah.edu>
Fix a variety of issues with autoraise (#134206)
* src/display.h: (struct _MetaDisplay): add an autoraise_window
parameter
* src/display.[hc] (meta_display_focus_the_no_focus_window): new
function, (meta_display_queue_autoraise_callback): new function,
(meta_display_remove_autoraise_callback): new function
* src/display.c (meta_display_open): intialize
display->autoraise_window too, (meta_display_close): remove any
pending autoraise callback, (window_raise_with_delay_callback):
clear out auto_raise->display->autoraise_window too,
(event_callback): call meta_display_queue_autoraise_callback
instead of having the code inline, call
meta_display_focus_the_no_focus_window to handle focusing that
window
* src/window.c (meta_window_focus): If there's a window with an
autoraise timeout that isn't the window being focused, remove the
autoraise timeout
* src/workspace.c (meta_workspace_focus_default_window): If no
autoraise timeout is queued for the given window then queue one
now, call meta_display_focus_the_no_focus_window to handle
focusing that window, (meta_workspace_focus_mru_window): call
meta_display_focus_the_no_focus_window to handle focusing that
window
2004-10-04 Elijah Newren <newren@math.utah.edu>
* src/display.c (event_callback): When no window becomes focused,
focus the default window instead of punting to the
no_focus_window. Also, change the warning to a verbose
message--this will happen frequently due to brain-damage in the X
protocol. (see #125492)
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-15 Elijah Newren <newren@math.utah.edu>
Fix unwanted loss of focus to the mouse window when using keynav
(fixes#101190)
* src/display.c (event_callback): Ignore EnterNotify events with
xcrossing.mode of either NotifyGrab or NotifyUngrab
2004-09-15 Elijah Newren <newren@math.utah.edu>
Focus correct window after minimizing via the tasklist (fixes
#128200; see also #107681)
* src/display.h (struct _MetaDisplay): track the
previously_focused_window
* src/display.c (meta_display_open): initialize
previously_focused_window
* src/window.c (meta_window_free): clear the
previously_focused_window if it's being freed,
(meta_window_client_message): if we get a request to minimize the
previously_focused_window and the focus_window is a dock or the
desktop, focus the default window, (meta_window_notify_focus):
update the previously_focused_window
2004-08-26 Havoc Pennington <hp@redhat.com>
* configure.in: move the have_xrender variable initialization up
in the file since it can be set as part of composite check
2004-08-19 Havoc Pennington <hp@redhat.com>
Fixes from Rich Wareham
* src/display.h (struct _MetaDisplay): add render extension check
to the display
* src/display.c: check for render
* configure.in: don't build compositing manager by default, don't
want any nasty surprises; check for render separately from
compositing manager
* src/frame.c: use an ARGB visual when available for the window
frame, so we can be all cool-ass
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).
Fri Aug 20 12:54:12 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* src/display.c (meta_display_end_grab_op): Move wireframe code
before grab is released to prevent endless loops with fullscreen
windows.
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-07 Elijah Newren <newren@math.utah.edu>
* src/display.c (event_callback): activating the current workspace
should be a no-op. This prevents a race condition in focus window
choice when activating a window via the taskbar. Fix for #149589.
2004-08-06 Elijah Newren <newren@math.utah.edu>
* src/display.c (event_callback): Focusing a window upon unshowing
the desktop in various ways (panel applet or keybinding) was
inconsistent for sloppy and click focus modes. Fix this by
calling meta_workspace_focus_default_window after unshowing the
desktop via a _NET_SHOWING_DESKTOP message. (resolves#149543)
2004-08-02 Elijah Newren <newren@math.utah.edu>
Fix some bugs (reported in #120100) regarding the focus window
when using the workspace switcher.
* src/display.c (event_callback): When switching workspaces due to
a _NET_CURRENT_DESKTOP message, make sure to focus the default
window as well.
* src/workspace.c (meta_workspace_focus_default_window,
meta_workspace_focus_mru_window): Make DOCK or DESKTOP windows
have lower priority than others when choosing a window to focus.
(For the former function, this means don't focus them at all; for
the latter, this means only focus them (via the
meta_workspace_focus_top_window call) if no other mru window can
be found.)
2004-07-31 Rob Adams <readams@readams.net>
Fix some support for EWMH hints, and fix USER_TIME support to
include the DEMANDS_ATTENTION hint. Also includes some code for
implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
this is disabled pending feature thaw.
* COMPLIANCE: update with new information
* src/display.c (meta_display_open): add new hints to list
* src/display.h (_MetaDisplay): Add new atoms to struct
* src/screen.c (set_supported_hint): update the list of support
hints.
(set_desktop_viewport_hint): new function sets the viewport hint
to (0,0) as required by the spec for WMs with no viewport support.
(set_desktop_geometry_hint): new function to set the desktop size
hint to the size of the display, since we don't implement large
desktop support, as required by the spec.
(meta_screen_resize): update the geometry hint on screen resize
* src/window.c (meta_window_new_with_attrs): Initialize
demands_attention state
(set_net_wm_state): Set demands_attention hint in the window state
(meta_window_show): If we don't pop up a window because of
USER_TIME, set DEMANDS_ATTENTION on the window.
(meta_window_focus): When a window receives focus, remove
DEMANDS_ATTENTION hint
(meta_window_client_message): Allow other apps to set
DEMANDS_ATTENTION on a window. Also, if the _NET_ACTIVE_WINDOW
hint includes a timestamp, use it.
(update_net_wm_state): Read DEMANDS_ATTENTION state also
* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-06-17 Elijah Newren <newren@math.utah.edu>
Add support for _NET_WM_USER_TIME
* src/display.c:
(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
(doesn't work since keyboard isn't grabbed) and ButtonPress (does
work), this is just a fallback for applications that don't update
this themselves.
* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field
* src/screen.c: (meta_screen_apply_startup_properties): Check for
TIMESTAMP provided from startup sequence as well.
* src/stack.c:
s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
(meta_window_set_stack_position): New function which calls the
meta_window_set_stack_position_no_sync function followed immediately
by calling meta_stack_sync_to_server.
* src/window-props.c:
(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
(reload_wm_hints): also load atom_net_wm_user_time
* src/window.c:
new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
(meta_window_new_with_attrs): add timestamp attributes,
(window_takes_focus_on_map): use TIMESTAMP from startup
notification and _NET_WM_USER_TIME to decide whether to focus new
windows,
(meta_window_show): if app doesn't take focus on map, place it
just below the focused window in the stack
(process_property_notify): check for changes to _NET_WM_USRE_TIME,
(meta_window_stack_just_below): new function
* src/window.h:
(_MetaWindow struct): new fields for initial_timestamp,
initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
(meta_window_stack_just_below): new function
Sat Jun 19 02:21:08 2004 Soeren Sandmann <sandmann@daimi.au.dk>
Fix bug 143333, support for update counter spec, and 109362,
schedule compensation events when events are ignored.
* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
METACITY_SYNC_COUNTER stuff.
(meta_display_begin_op): Setup the sync counter
* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
Add new atoms.
* src/window.c (send_sync_request): new function.
(meta_window_move_resize_internal): send a sync request before
resizing.
(check_move_resize_frequence): Rework logic to also check the SYNC
case. If an event is ignored return the remaining time.
(update_resize_timeout): Timeout that gets called when a
compensation event is scheduled.
(uddate_resize): schedule compensation events when an event is
ignored.
(meta_window_handle_mouse_grap_op_event): When an alarm is
received and sync was turned off, turn it back on.
* src/window.h (struct MetaWindow) Add some variables
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-01-09 Thomas Fitzsimmons <fitzsim@redhat.com>
Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS.
* src/display.c: include xprops.h
(process_request_frame_extents): new function
(meta_display_open): add _NET_FRAME_EXTENTS and
_NET_REQUEST_FRAME_EXTENTS atoms
(event_callback): handle frame extents message
* src/display.h (struct _MetaDisplay): add atom_net_frame_extents
and atom_net_request_frame_extents
* src/theme.c (meta_pango_font_desc_get_text_height): make font_desc
parameter const
* src/ui.c: include prefs.h
(meta_ui_theme_get_frame_borders): new function
* src/window.c (update_net_frame_extents): new function
(meta_window_move_resize_internal): update frame extents
property when frame geometry changes
* src/screen.c (set_supported_hint): add atom_net_frame_extents
and atom_net_request_frame_extents
2003-01-04 Rob Adams <readams@readams.net>
Maintain the button grab for sloppy and mouse focus all the time.
This fixes a number of problem introduced by trying to drop the
grab; we now do this only for click to focus mode. This has the
unfortunate effect that #102209 reappears for sloppy and mouse
focus, but this seems unavoidable, because of limitations in the X
protocol. See #115072.
* src/display.c (meta_display_grab_focus_window_button): #if 0 the
section on not grabbing unless in click-to-focus mode.
* src/window.c (meta_window_notify_focus): drop focus button grab
on FocusIn and acquire it on FocusOut only when in click-to-focus
mode.
2003-12-25 Havoc Pennington <hp@redhat.com>
* src/compositor.c (meta_compositor_process_event): change to
track all children of the root window, not only mapped children;
this keeps us from losing track of the stacking order
* src/display.c (event_callback): don't do any of the compositor
event handling inline, do it all in compositor.c
2003-12-17 Rob Adams <readams@readams.net>
* src/display.c (meta_display_open): initialize
grab_wireframe_active to FALSE. Fix for #128090.
2003-12-17 Rob Adams <readams@readams.net>
* src/tabpopup.c (meta_ui_tab_popup_new): Don't try to call
utf8_strndup on a null title for an entry. Fix for #128566.
* src/workspace.c (meta_workspace_free): Call g_list_free on the
mru_list, since with sticky windows that MRU list could well not
be emtpy. See #122016.
2003-12-13 Rob Adams <readams@readams.net>
Add increased robustness for dealing with all workspaces windows
and MRU lists.
Also add very preliminary _NET_WM_USER_TIME
support, limited to simply listening for the property and keeping
an internal variable updated, and also treating some input events
as though they were user time updates.
* src/window.c (meta_window_new_with_attrs): set on_all_workspaces
in all cases _before_ adding to the workspaces, so that windows
initially on all workspaces are added correctly to the MRU lists.
Fix for #120907.
(process_property_notify): add net_wm_user_time support.
* src/workspace.c (meta_workspace_add_window): handle sticky
windows so that we add to add mru lists if needed
(meta_workspace_remove_window): handle sticky windows so that they
are removed from all mru lists if needed.
* src/display.[ch] (meta_display_open): add net_wm_user_time support.
(event_callback): simulate user time update on key and button presses.
* src/screen.c (set_supported_hint): add net_wm_user_time support.
* src/window-props.c (init_net_wm_user_time): new function for
user_time support
(reload_net_wm_user_time): new function for user_time support
(meta_display_init_window_prop_hooks): add hook for user_time
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-23 Havoc Pennington <hp@redhat.com>
* src/compositor.c: move xcompmgr code in here (minus drop
shadows), untested since Keith's server just crashes at the
moment. "It compiles"
2003-11-20 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_new_with_attrs): new function
* src/display.c, src/screen.c: create the compositor and feed
windows and events to it