2005-07-23 Elijah Newren <newren@gmail.com>
* src/window.c: (meta_window_activate): revert the patch from
#128380--change _NET_ACTIVE_WINDOW behavior to what it originally
was.
2005-06-02 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_configure_request): If a window
requests to be raised and is denied, set the demands attention
hint. Fixes#305882.
2005-06-02 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_focus): if the window has a modal
transient which is being unmanaged, don't focus it. Fixes the
Metacity issue reported in #305362.
2005-05-26 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_configure_request): Patch from Greg
Hudson to make sure window position is calculated correctly for
reconfigure requests when part of the XWindowChanges structure is
uninitialized. Fixes#305257.
2005-05-26 Elijah Newren <newren@gmail.com>
* src/window.c: (meta_window_new_with_attrs): put all transients
of the new window, if any exist, in the calc_showing queue. Fixes
#303284.
2005-02-23 Elijah Newren <newren@gmail.com>
* src/window.c: (meta_window_new_with_attrs): Fix crash that
occurs when stupid apps claim that a window is its own parent.
#168207
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-20 Elijah Newren <newren@gmail.com>
* src/window.c: (meta_window_activate): when receiving a
_NET_ACTIVE_WINDOW message, switch to the desktop where the window
is located before activating instead of moving the window to the
current desktop. Thanks to Lubos Lunak for catching this issue.
Fixes#128380.
2005-02-20 Elijah Newren <newren@gmail.com>
* src/window.c (meta_window_show): Ignore all focus and
focus-stealing-prevention code in meta_window_show when not
showing the window for the first time. Fixes#167199.
2005-02-20 Elijah Newren <newren@gmail.com>
Big patch to cover about 6 different issues in order to correct
rare problems with timestamps (make sure window selected in
tasklist actually gets focus, sanity check timestamps to avoid
rogue apps hosing the system, correct the updating of
net_wm_user_time, correctly handle timestamps of 0 when comparing
xserver timestamps for those who have had their systems up for
over 25 days or so, add some debugging information to verbose
logs, some code cleanups). Fixes all issues listed in #167358.
* src/display.h: (struct _MetaDisplay): clarify comment on
last_focus_time, introduce a new variable--last_user_time,
(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
separate macro and then introduce a new macro with this name that
uses the old one but adds additional special-case checks for
timestamps that are 0, (comment to
meta_display_set_input_focus_window): add information about how
last_user_time should be used in this function
* src/display.c (santiy_check_timestamps): new function,
(meta_display_open): intialize display->last_user_time,
(meta_display_get_current_time_roundtrip): use the timestamp,
which is known to be good, in order to sanity_check_timestamps,
(event_callback): use the new meta_window_ste_user_time() function
in order to correct problems, use the timestamp of KeyPress and
ButtonPress events, which are known to be good, in order to
sanity_check_timestamps, (timestamp_too_old): new function for
common behavior of meta_display_focus_the_no_focus_window and
meta_display_set_input_focus_window, with added checking for
display->last_user_time in addition to display->last_focus_time,
(meta_display_set_input_focus_window): replace some of the code
with a call to timestamp_too_old(),
(meta_display_focus_the_no_focus_window): replace some of th ecode
with a call to timestamp_too_old()
* src/window.h: (meta_window_set_user_time): new function to
abstract the many things that need to be done when updating the
net_wm_user_time of any window
* src/window.c: (meta_window_activate): add debugging spew, make
sure the comparison is made with last_user_time NOT
last_focus_time, use meta_window_set_user_time() function in order
to correct problems, (meta_window_client_message): add a newline
to a debugging message to make them easier to read,
(meta_window_set_user_time): new function
* src/window-props.c (reload_net_wm_user_time): use the new
meta_window_ste_user_time() function in order to correct problems
2005-02-12 Elijah Newren <newren@gmail.com>
Raise the ancestor of a window instead of the window itself.
Fixes#166894.
* src/window.c: (find_root_ancestor): new function,
(meta_window_raise): get the ancestor of the given window and
raise it if possible instead of the window
2005-02-12 Elijah Newren <newren@gmail.com>
Don't unconditionally place splashscreens (and other
not-to-befocused windows) below the focus window. Fixes#167042.
* src/window.c: (intervening_user_event_occurred): new function
taken from the timestamp comparison portion of the old
window_takes_focus_on_map function, (window_state_on_map): new
function with remainder of old window_takes_focus_on_map function
that determines both whether the window will take focus and
whether it should be placed on top, (meta_window_show): use
place_on_top_on_map to determine window stacking instead of trying
to infer it from takes_focus_on_map
2005-02-11 Elijah Newren <newren@gmail.com>
Avoid new windows being obscured by the focus window (and thus
possibly lost). Fixes#166524.
* src/place.c: new MetaWindowDirection enum,
(find_most_freespace): new function to find where there is the
most space available around the focused window,
(meta_window_place): if a window is denied focus and the window
overlaps the focused window, retry the first-fit algorithm only
paying attention to the focus window position and if that fails
just find the location on the screen with the most space
available.
* src/window.h: (struct MetaWindow): new
denied_focus_and_not_transient bitfield
* src/window.c: (meta_window_new_with_attrs): initialize
denied_focus_and_not_transient, (meta_window_show): set and unset
the denied_focus_and_not_transient field appropriately
2005-02-08 Elijah Newren <newren@gmail.com>
Avoid using CurrentTime when focusing, handle it better in case we
miss any cases. Fixes#166732.
* src/window.c: (meta_window_shade): use
meta_display_get_current_time_roundtrip() to ensure we have a
valid timestamp, (meta_window_unshade): same
* src/display.c: (meta_display_set_input_focus_window): If
CurrentTime was passed, get one from the XServer in addition to
throwing a warning, (meta_display_focus_the_no_focus_window): same
2005-02-08 Elijah Newren <newren@gmail.com>
* src/window.c: (meta_window_activate): If we're not passed a
timestamp, make sure to manually get one. Fixes#166728.
2005-02-06 Elijah Newren <newren@gmail.com>
Ignore xconfigurerequest events for stacking when it should be
safe to do so. Again, thanks to Crispin Flowerday for the test
case. Thanks to KWin for the inspiration (and to Google for
indexing their source code). Fixes the other half of #166395.
* src/window.c: (meta_window_configure_request): if the
active_window is from a separate application than the one getting
the configure request and the net_wm_user_time of the active
window is later than that of the window getting the configure
request, then ignore the request.
2005-02-06 Elijah Newren <newren@gmail.com>
If activation requests are too old, set the demands_attention hint
instead of actually activating. Thanks to Crispin Flowerday for
the test case and for testing the patch. Fixes half of #166395.
* src/window.c: (meta_window_activate): if the request came before
the last focus time, set the demands attention hint instead
2005-02-04 Elijah Newren <newren@gmail.com>
Make sure window->border_only is initialized so we don't get
random windows without decorations. Thanks to Sinisa Segvic and
Owen Taylor for providing test cases. Fixes#145131.
* src/window.c: (update_mwm_hints): Be sure to call
recalc_window_features even if no MWM hints are set
2005-01-31 Elijah Newren <newren@gmail.com>
Correct the stacking when return from fullscreen mode. Fixes
#165718.
* src/window.c: (meta_window_unmake_fullscreen): Update the layer
after resizing the window
2005-01-28 Elijah Newren <newren@gmail.com>
* src/menu.c: Change wording of menu to "Always on Current
Workspace" from "Put on All Workspaces", remove a quick-key
conflict between "On _Top" and "Only on _This Workspace" by
switching the latter to "_Only on This Workspace"
* src/window.c: Remove a comment that is no longer necessary
(since bug 87531 has been fixed)
2005-01-28 Elijah Newren <newren@gmail.com>
Take into account the appropriate list of windows when placing a
new one. Fixes#165381.
* src/place.c: (meta_window_place): use
meta_window_showing_on_its_workspace(w) instead of !w->minimzed,
also take into account sticky windows
* src/window.[ch]: rename window_showing_on_its_workspace to
meta_window_showing_on_its_workspace and export it
2005-01-26 Elijah Newren <newren@gmail.com>
Stick and unstick transients with their parent automatically.
Fixes#152283.
* src/window.c: (window_stick_impl, window_unstick_impl): rename
from meta_window_stick and meta_window_unstick respectively,
(stick_foreach_func): a function to assist calling
window_(un)stick_impl on each transient, (meta_window_stick,
meta_window_unstick): new functions that call window_stick_impl or
window_unstick_impl for the window and each of its transients.
2005-01-25 Elijah Newren <newren@gmail.com>
Refuse to focus a window with a modal transient, and focus the
transient instead. Fixes#164716.
* src/window.c: (get_modal_transient): new function,
(meta_window_focus): if the window has a modal transient, make
sure it is on the current workspace and then focus it instead.
2005-01-23 Elijah Newren <newren@gmail.com>
Patch from John Paul Wallington to fix#163420.
* src/window.c: (check_maximize_to_work_area): fix vertical
maximization for second screen
2004-12-27 Elijah Newren <newren@gmail.com>
Focus windows that manually position themselves too (fixes
#107347).
* src/window.h (struct _MetaWindow): add a new
showing_for_first_time flag
* src/window.c (meta_window_new_with_attrs): initialize
showing_for_first_time flag to !mapped, (meta_window_show):
replace did_placement with showing_for_first_time in the section
to decided whether to focus since did_placement isn't quite what
we want
2004-12-24 Elijah Newren <newren@gmail.com>
* src/window.c (window_takes_focus_on_map): Fix error in
distinguishing < vs. <= introduced by the patch in #154598,
restructure code so that verbose log matches code better in order
ensure such mistakes are harder to make in the future (fixes
#162172)
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>
When snap-moving, don't snap to transients of minimized windows
since they are hidden. Fixes#157180
* src/place.c (get_windows_on_same_workspace): make the logic to
determine hidden windows more thorough by calling
meta_window_should_be_showing()
* src/window.c (meta_window_should_be_showing): rename this
function from window_should_be_showing and also export it,
(implement_showing):
s/window_should_be_showing/meta_window_should_be_showing/,
(idle_calc_showing):
s/window_should_be_showing/meta_window_should_be_showing/
* src/window.h (meta_window_should_be_showing): Add this function
to the list so that it can be used in src/place.c
2004-10-25 Elijah Newren <newren@math.utah.edu>
Don't lower newly mapped windows when they're denied focus, if
they are transients of the focused window. Instead, defocus the
currently focused window. (fixes#151996).
(Also, reenable focus stealing prevention and do a small spacing
cleanup)
* src/window-props.c (init_net_startup_id): fix spacing
* src/window.c (window_takes_focus_on_map): re-enable focus
stealing prevention, (meta_window_show): if the new window is
denied focus and is a transient of the currently focused window,
defocus the currently focused window but keep the transient on
top; remove some old code about transients and focus; make sure
that EnterNotify events won't accidentally focus the new window.
2004-10-22 Elijah Newren <newren@math.utah.edu>
Update _NET_WM_STATE_HIDDEN so the pager on the panel will know
whether to display windows as visible or hidden (#105665)
* src/screen.c (queue_windows_showing): Revert the
queue_windows_showing portion of the patch committed on 2004-10-16
for #142198--it was an ill-advised optimization.
* src/window.c (window_showing_on_its_workspace,
window_should_be_showing): split the old window_should_be_showing
into these two functions, (set_net_wm_state): hidden state is more
complex; use window_showing_on_its_workspace to determine the
correct value
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 Elijah Newren <newren@math.utah.edu>
Code cleanup
* src/window.c (is_in_dock_group, docks_at_end_cmp,
shuffle_docks_to_end): removed functions,
(meta_window_notify_focus): no need to call is_in_dock_group or
shuffle_docks_to_end because of the patch from #120100 that was
committed.
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>
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>
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>
Remove race condition for focus window choice on window close
followed by rapid mouse movement in sloppy and mouse focus modes
(fixes#152000)
* src/window.c (meta_window_free): Don't increment the focus
sentinel for windows being freed, (idle_calc_showing): don't
increment the focus sentinel for windows being minimized
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-29 Elijah Newren <newren@math.utah.edu>
* src/window.c (window_takes_focus_on_map): Disable
focus-stealing-prevention for now; there are still some issues and
hard code freeze is tomorrow...so this will have to wait until
Gnome 2.10.
2004-08-27 Elijah Newren <newren@math.utah.edu>
Prevent an assertion failure that can occur after increasing the
number of workspaces; also fix a warning and stacking order when a
window is denied focus (fixes#150615)
* src/window.c (meta_window_stack_just_below): the position of the
window should be set equal to that of the one we want to be below,
not 1 lower than that number
* src/workspace.c (maybe_add_to_list): new function to add
on_all_workspace windows to an mru_list, (meta_workspace_new):
call maybe_add_to_list for all windows on the screen in order to
initialize the mru_list
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-15 Rob Adams <readams@readams.net>
* src/windows.c (meta_window_update_struts): use height and
top/bottom struts to compute gap (copy/paste bug).