2007-04-15 Elijah Newren <newren gmail com>
Preserve stacking order across restarts.
* src/display.c (meta_display_unmanage_windows_for_screen):
unmap windows in stacking order so that stacking is preserved upon
shutdown
* src/display.[ch] (meta_display_stack_cmp):
* src/session.c (stack_cmp, save_state):
rename stack_cmp() -> meta_display_stack_cmp() and move it to a
different function so that it can be used in both
session.c:save_state() and
meta_display_unmanage_windows_for_screen()
svn path=/trunk/; revision=3197
2007-04-11 Elijah Newren <newren gmail com>
Advertise support of Above and Below operations (assuming the
proposed EWMH additions of _NET_WM_ACTION_(ABOVE|BELOW) will be
accepted, otherwise these changes will have to be modified). Part
of #115247.
* src/display.[ch] (meta_display_open, struct MetaDisplay):
* src/screen.c (set_wm_check_hint):
Add support for _NET_WM_ACTION_ABOVE and _NET_WM_ACTION_BELOW
* src/window.c (set_allowed_actions_hints):
add active_above and action_below
svn path=/trunk/; revision=3190
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-03-30 Elijah Newren <newren gmail com>
Add support for _NET_WM_USER_TIME_WINDOW in order to cut down on
context switches.
* src/display.c (meta_display_open):
* src/display.h (struct _MetaDisplay):
* src/screen.c (set_supported_hint):
new atom
* src/display.c (meta_display_open,
meta_display_get_current_time_roundtrip):
* src/display.h (struct _MetaDisplay):
create a dedicated timestamp pinging window instead of reusing
display->leader_window
* src/display.c (event_callback):
* src/window-props.c (reload_net_wm_user_time_window):
* src/window.c (meta_window_new_with_attrs, meta_window_free,
process_property_notify):
* src/window.h (struct _MetaWindow):
monitor property notify events on _NET_WM_USER_TIME_WINDOW windows too
* src/window-props.[ch]:
new meta_window_reload_propert(y|ies)_from_xwindow() functions
* src/window-props.[ch]
(init_net_wm_user_time_window, reload_net_wm_user_time_window,
meta_display_init_window_prop_hooks):
* src/window.c (meta_window_new_with_attrs):
new hooks to handle new atom
svn path=/trunk/; revision=3134
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-10-01 Elijah Newren <newren gmail com>
Patch from Carlo Wood to ensure that maximized and minimized
properties are maintained across restarts. #358042.
* src/constraints.c (place_window_if_needed): fix up partial
maximization handling and add minimize_after_placement handling.
* src/display.[ch] (struct MetaDisplay, meta_display_open): add a
new display->display_opening flag to allow handling startup
differently where needed.
* src/window-props.c (reload_net_wm_state): handle
_net_wm_state_hidden as well, setting
window->minimize_after_placement appropriately
* src/window.[ch] (struct MetaWindow, meta_window_new_with_attrs):
add a window->minimize_after_placement field
* src/window.c (meta_window_new_with_attrs): only unminimize the
window and its transients if the display isn't being opened,
(unmaximize_window_before_freeing): don't reset the state unless
the window is becoming withdrawn, if the screen is being closed be
sure to save the unmaximized state of the window so the next
window manager can restore it
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-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
Thu May 4 13:30:04 2006 Søren Sandmann <sandmann@redhat.com>
* src/ui.h: Delete unused META_PRIORITY_COMPOSITE
* src/ui.c: Delete argument from meta_ui_get_display().
* src/c-window.c: Remove the xid->window hashtable and associated
code.
* src/c-screen.[ch]: Rename MetaScreenInfo to MetaCompScreen. Put the
xid->windows table here instaed of as a static variable. Also make
sure that CompWindows are freed when the screen is unredirected.
* src/display.c: Delete non USE_GDK_DISPLAY case, as it didn't
work and hasn't been compiled for a long time.
* src/display.[ch] (meta_display_open): Remove argument as it was
always NULL (and couldn't possibly be anything else in the
USE_GDK_DISPLAY case).
2006-04-14 Thomas Thurman <thomas@thurman.org.uk>
Add a tabbing function, bound to alt-f6 by default, to cycle
through the windows of the current application. Fixes#164831.
* src/common.h: two new MetaGrabOpts values for group switching
* src/display.c (ping_data_free, meta_display_in_grab_op,
IN_TAB_CHAIN): adapt to new MetaGrabOpts
* src/display.h: new enum value for MetaTabList for group switching
* src/keybindings.c (meta_display_process_key_event):
adapt to new MetaGrabOpts
(process_tab_grab): adapt to new MetaGrabOpts, and use switch
statement for cancelling instead of if statement
* src/metacity.schemas.in: new keybindings
* src/prefs.c, src/prefs.h: handle new keybindings
* src/window.h: define META_WINDOW_IN_GROUP_TAB_CHAIN macro
2006-04-12 Elijah Newren <newren gmail com>
Patch from Ron Yorston to add a focus_new_windows option. Default
is 'smart' (focus by default but normal focus-stealing-prevention
can kick in); 'strict' is current other choice (like 'smart'
except that programs launched by the terminal will not be
focused). Fixes remainder of #326159. Should also close#152004
and a bunch of others.
* src/common.h:
Add a MetaFocusNewWindows enum giving the current types allowed
* src/display.h:
Update docs on allow_terminal_deactivation to note that it is only
relevant when focus_new_windows is 'strict'
* src/prefs.c:
* src/prefs.h:
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_FOCUS_NEW_WINDOWS, static gboolean
focus_new_windows, update_focus_new_windows, meta_prefs_init,
change_notify, meta_prefs_get_focus_new_windows,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
focus-new-windows option.
* src/window.c (window_state_on_map, meta_window_set_user_time):
Don't focus windows launched from a terminal
2006-01-30 Elijah Newren <newren gmail com>
* src/display.[ch] (struct MetaDisplay), meta_display_open,
meta_display_set_input_focus_window,
meta_display_focus_the_no_focus_window): Track the active_screen,
(event_callback): If the mouse enters a window on a different
screen, activate the default window on the new screen. May need
to be modified for click-to-focus; we'll wait for feedback. Fixes
#319348.
2006-01-20 Elijah Newren <newren gmail com>
Fix unitialized value problem when in raise-on-click mode. Søren,
#327572.
* src/display.c (meta_display_check_threshold_reached): make
function be a no op if raise_on_click!=FALSE
* src/display.h (struct MetaDisplay): point out that
grab_initial_[xy] and grab_threshold_movement_reached are only for
raise_on_click==FALSE mode.
2006-01-20 Elijah Newren <newren gmail com>
Prevent rapidly repeated visual bells from hanging metacity.
Fixes#322032.
* src/display.h (struct MetaDisplay): add a last_bell_time field,
(XSERVER_TIME_IS_BEFORE_ASSUMING_REAL_TIMESTAMPS macro,
XERVER_TIME_IS_BEFORE macro): add parentheses around usage of
macro parameter
* src/display.c (meta_display_open): initialize last_bell_time,
(event_callback): don't allow more than one bell per second
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>
Add a raise on click option, basically only because all the major
distros are patching it in anyway. See #326156.
* src/metacity.schemas.in: add the new gconf key and explanation
* src/prefs.[ch] (#define KEY_RAISE_ON_CLICK, static gboolean
raise_on_click, update_raise_on_click, meta_prefs_init,
change_notify, meta_prefs_get_raise_on_click,
meta_preference_to_string):
Add all the normal preference handling stuff for this new
raise-on-click option.
* src/core.c (meta_core_show_window_menu):
* src/display.c (event_callback, meta_display_begin_grab_op):
* src/window.c (window_activate, meta_window_configure_request, ):
Only raise the window if in raise_on_click mode.
* src/display.c (meta_display_begin_grab_op,
meta_display_end_grab_op, meta_display_check_threshold_reached):
* src/display.h (struct MetaDisplay):
* src/window.c (meta_window_handle_mouse_grab_op_event):
if not in raise-on-click mode only raise on button release if the
click didn't start a move or resize operation; needs a few extra
MetaDisplay fields to handle this
* src/core.c (meta_core_user_lower_and_unfocus):
no need to do the MRU shuffling if not maintaining the stacking
order == MRU order invariant
* src/frames.c (meta_frames_button_press_event):
* src/window.c (meta_window_begin_grab_op):
remove an unneeded window raising that is already handled elsewhere
2006-01-09 Elijah Newren <newren@gmail.com>
Fix window outline for minimized windows when using alt-esc.
#325092.
* src/display.c (meta_display_begin_grab_op): Specify the showing
type of tabbing operation (Alt tab vs. alt-esc) in addition to the
listing type of tabbing operation (docks vs normal windows) to
meta_screen_ensure_tab_popup().
* src/display.h (enum MetaTabShowType): new convenience enum
* src/screen.[ch] (meta_screen_ensure_tab_popup): require the
showing type be specified in addition to the tabbing type; put the
outline around the window instead of the icon when in alt-esc
mode.
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>
Truncate ridiculously long titles to avoid crashing or letting the
pager crash. Based on patch from Ray, incorporating suggestions
from Havoc and some extensions of my own. Fixes#315070.
* src/display.c (set_utf8_string_hint, meta_display_open):
* src/xprops.[ch] (meta_prop_set_utf8_string_hint):
Move set_utf8_string_hint() to props.[ch], namespace it
("meta_prop_"), and make it public
* src/tabpopup.c (utf8_strndup, meta_ui_tab_popup_new):
* src/util.[ch] (meta_g_utf8_strndup):
Move utf8_strndup() to util.[ch], namespace it ("meta_g_"), and
make it public
* src/display.c (meta_display_open):
* src/display.h (struct _MetaDisplay):
add net_wm_visible_name and net_wm_visible_icon_name atoms to the
list of atoms we work with
* src/window-props.c (set_window_title, set_icon_title): If title
length is greater than 512, truncate it and set
_NET_WM_VISIBLE_NAME or _NET_WM_VISIBLE_ICON_NAME accordingly
2005-07-11 Matthias Clasen <mclasen@redhat.com>
React to cursor theme changes: (#308106)
* src/prefs.h:
* src/prefs.c: Expose the GConf keys for cursor theme
and size as preferences META_PREF_CURSOR_THEME and
META_PREF_CURSOR_SIZE with getters meta_prefs_get_cursor_theme()
and meta_prefs_get_cursor_size().
* src/display.c (meta_display_open): Initialize the cursor
theme and size.
* src/display.h:
* src/display.c (meta_display_set_cursor_theme): New function
to change the cursor theme and update all cursors.
* src/screen.h
* src/screen.c (meta_screen_update_cursor): New function to
refesh the root cursor of a screen.
* src/main.c (prefs_changed_callback): Update the cursor
theme when the cursor preferences change.
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>
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-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-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-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-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>
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).
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-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-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