2004-08-15 Rob Adams <readams@readams.net>
* src/window.c (meta_window_update_struts): Allow struts larger
than 1/2 the screen width/height, as long as there's a minimum
sized gap between them. Patch from Bill Haneman <billh@gnome.org>
for bug #144126.
2004-08-08 Rob Adams <readams@readams.net>
* src/window.c (meta_window_move_resize_internal): Add #ifdef
around XSYNC code; fixes compile problem if XSYNC is disabled.
Path for #149314 from Peter O'Shea and independently Mike Castle.
2004-08-07 Elijah Newren <newren@math.utah.edu>
* window.c, window.h: Revert Rob's 2004-07-31 patch that ignored
net_wm_user_time when unminimizing a window
* window.c (meta_window_activate): If a nonzero timestamp is
passed, update the window's net_wm_user_time accordingly. (see
comments 102-108 of bug 118372)
2004-08-07 Rob Adams <readams@readams.net>
Remove some extraneous items that could sometimes appear in the
window menu. Fix for #144493.
* src/menu.c (menuitems): Change the second separator to key on
whether there are any workspaces.
(meta_window_menu_new): use NULL label instead of 0 op to identify
separator
* src/window.c (meta_window_show_menu): Change the conditions on
the directions to take into account "holes" in the workspace
layout and also only set META_MENU_OP_WORKSPACES when there's more
than one workspace.
2004-08-05 Elijah Newren <newren@math.utah.edu>
Have newly mapped windows that are denied focus appear after the
focused window in the alt-tab list. This allows one to switch to
such a window with a single alt-tab press.
* src/window.c (ensure_mru_position_after): new function,
(meta_window_show): If newly mapped window is denied focus, call
ensure_mru_position_after to make the window appear after the
focus window in the mru list.
2004-08-05 Elijah Newren <newren@math.utah.edu>
* src/window.c (meta_window_stick): prepend window to mru list
instead of appending, since making the window sticky should imply
that it is the most recently used, not the least recently. (fixes
#149369)
2004-07-31 Rob Adams <readams@readams.net>
Fix bug that caused windows to not be focused on unminimizing
because of user time support.
* src/window.c (meta_window_new_with_attrs): initialize
focus_despite_user_time bit
(window_takes_focus_on_map): focus if focus_despite_user_time
despite user time, interestingly enough
(meta_window_show): reset focus_despite_user_time after showing
* src/window.h (_MetaWindow): add focus_despite_user_time bit
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-24 Elijah Newren <newren@math.utah.edu>
Make choice of focus window be consistent for each focus mode.
Fixes#135810.
* src/delete.c: (meta_window_delete): In some #if 0'ed code,
replace meta_workspace_focus_mru_window with
meta_workspace_focus_default_window (just in case the code becomes
un-#if 0'ed out).
* src/screen.c, src/screen.h: Change
meta_screen_focus_mouse_window to meta_screen_get_mouse_window,
and don't focus the window when found but rather return it.
* src/window.c: (meta_window_free, meta_window_minimize): replace
meta_workspace_focus_mru_window with
meta_workspace_focus_default_window.
* src/workspace.c: (meta_workspace_focus_default_window): Focus
appropriately for the given focus method:
click-to-focus: focus MRU window (== toplevel window)
sloppy focus: focus the window under the pointer if there is
such a window, otherwise focus the mru window
mouse focus: focus the window under the pointer if there is
such a window, otherwise don't focus anything
2004-06-24 Elijah Newren <newren@math.utah.edu>
* src/window.c: Avoid a race condition on the choice of window to
focus after the previously focused window gets closed or
minimized. Fixes#131582.
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
2004-06-21 Anders Carlsson <andersca@gnome.org>
* src/common.h:
* src/menu.c: (menu_closed), (activate_cb):
* src/window.c: (menu_callback):
Add a timestamp argument to menu functions and
use it in meta_window_delete.
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-27 Rob Adams <readams@readams.net>
* src/window.c (meta_window_notify_focus): only move on MRU list
if the window belongs on the workspace, since the FocusIn event
could be for a window whose workspace we've since switched away
from. Possible fix for #122016.
* src/workspace.c (meta_workspace_contains_window): search for the
workspace in window->workspaces rather than the window in
workspace->windows. Since the number of workspaces is at most 36,
this is a O(1) lookup rather than a O(n) lookup. Sorry; couldn't
resist.
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-17 Rob Adams <readams@readams.net>
* src/window.c (meta_window_show_menu): Don't show
left/right/up/down if a window is sticky. Make "On Top"
insensitive for docks, splash screens, and desktops since it has
no effect anyway.
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-20 Rob Adams <readams@readams.net>
Reorganize the window menu according to discussion on #110904.
The workspace name mnemonic chunk of the patch is thanks to
Jonathan Blandford.
* src/common.h: add MENU_OP_ABOVE, MENU_OP_UNABOVE, MENU_UP_MOVE_TO_*
menu ops.
* src/core.c (meta_core_get_menu_accelerator): add accelerator for
the new menu ops.
* src/menu.c: add checked attribute in _MenuItem struct to display
a checkmark next to a menu item. Add the new menu items to
menuitems.
(get_workspace_name_with_accel): Add mnemonics even to renamed
workspaces.
(menu_item_new): provide support for the checked attribute
(meta_window_menu_new): construct new submenu for workspace
switching.
* src/window.c (menu_callback): implement support for the new menu
ops.
(meta_window_show_menu): don't use the OP_*SHAPE operations, and
compute which of the OP_MOVE_TO_* ops should be used for the
current workspace and workspace layout. Add the OP_*ABOVE
operations.
2003-12-13 Rob Adams <readams@readams.net>
* 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.
* 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.
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-12-12 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_free): unstick window to get it out of
mru_list it should not be in; assert that window has been removed
from all mru_list. Perhaps fixes#122016 crash.
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-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
2003-11-16 Rob Adams <readams@readams.net>
Create COMPLIANCE document describing metacity specification
compliance. Right now gives detailed EWMH compliance; still need
to add ICCCM compliance information. Also some minor fixes to
bring metacity into compliance on some points.
* COMPLIANCE: new file
* src/display.h, src/display.c (meta_display_open),
src/screen.c (set_supported_hint): add
atom_net_wm_action_fullscreen and atom_net_wm_action_minimize
* src/window.c (set_allowed_actions_hint): some fixes to which
hints to set and add fullscreen and minimize.
2003-11-16 Rob Adams <readams@readams.net>
* src/window.c (meta_window_notify_focus): add paranoia check to
make sure a window is really on a workspace before inserting it at
the beginning of the MRU list. Maybe there's a race condition
with focusing and workspace switching. Hopefully a fix for #122016.
2003-11-15 Rob Adams <readams@readams.net>
* src/window.c (update_net_wm_type): don't set window->type_atom
here so that the type-inference code will actually be called. Fix
for #126873 from Keith Packard.
2003-11-08 Rob Adams <readams@readams.net>
* src/window.c (meta_window_move_resize_internal): configure frame
first if we grow more than we shrink combined in both dimensions.
Patch from Soren Sandmann for #108925.
2003-11-07 Rob Adams <readams@readams.net>
* src/window.c (window_should_be_showing): show the window if it's
a transient of a dock or desktop, since otherwise such windows are
invisible in show desktop mode. Fix for #124648.
2003-10-25 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_notify_focus): if a window is focused
which is not either a dock or a transient in the same group as a
dock, shuffle all dock/desktop windows to the end of the MRU list
so they won't annoyingly get focus all the time. #123816
2003-10-13 Havoc Pennington <hp@redhat.com>
In the "prefs cause code complexity" department, here's a "sloppy
focus die die die" kind of moment.
* src/display.c (meta_display_grab_focus_window_button): don't
grab in sloppy focus mode, since we were dropping the grab on
window enter anyway this just removes races from the current
behavior.
* src/display.c (prefs_changed_callback): ungrab/grab on focus
mode changes, since we treat sloppy and click differently.
2003-10-12 Havoc Pennington <hp@redhat.com>
Merge reduced_resources mode patch from the branch. Offers
wireframe and no-animations.
* src/window.c (implement_showing): no animation if we are
in reduced resources mode
* src/prefs.c: add REDUCED_RESOURCES pref
* src/window.c (meta_window_update_keyboard_resize): fix to
modify grab_anchor_window_pos to grab_wireframe_rect if
appropriate instead of window->rect
* src/display.h (struct _MetaDisplay): add grab_start_serial used
to avoid responding to events that occurred prior to the grab
initialization.
Still broken in various ways, specifically EnterNotify that
occurred prior to XGrabPointer is processed as if it occurred
after.
* src/window.c (meta_window_update_keyboard_move): add this
instead of meta_window_warp_pointer() crack
* src/effects.c (meta_effects_update_wireframe): draw a kind of
grid for the wireframe, instead of just a rectangle, like twm
* src/screen.c (meta_screen_new): line width of 3 for the XOR gc
"Reduced resources" mode based on wireframe patch from
Erwann Chenede. Still pretty buggy.
* src/keybindings.c (process_keyboard_move_grab)
(process_keyboard_resize_grab): add gruesome wireframe hacks
* src/display.c (meta_display_end_grab_op): end wireframe
(meta_display_begin_grab_op): begin wireframe
* src/effects.c (meta_effects_end_wireframe)
(meta_effects_update_wireframe, meta_effects_begin_wireframe):
routines to draw the wireframe stuff
* src/window.c (window_should_be_showing): hide window when
doing wireframe, commented out as it breaks grab
* src/window.c (meta_window_refresh_resize_popup): handle wireframe
* src/screen.c (meta_screen_new): create a screen->root_xor_gc
for use in drawing wireframes
* src/frames.c (meta_frames_push_delay_exposes): repaint
everything before we delay
2003-09-30 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_queue_move_resize): add the moveresize
idle at META_PRIORITY_RESIZE so it runs before GTK does any
drawing, may fix bug #109211 (seem to for me)
* src/ui.h (META_PRIORITY_RESIZE): add this between GTK
resize/redraw priorities
* src/display.c (meta_display_queue_retheme_all_windows): remove
some debug spew from meta_warning
2003-07-28 Rached Ben Mustapha <rached@benmur.net>
Fix bug #118428
* src/window.c (redraw_icon): Also redraw window icon if the window
is not mapped but its frame is.
(idle_update_icon): Unset the window->update_icon_queued flag.
2003-09-20 Rob Adams <readams@readams.net>
Fix bug where multiple entries could appear in MRU lists, or no
entry when sticking/unsticking windows. Fix for #122016
* src/window.c (meta_window_stick): use window->screen->workspaces
instead of window->workspaces.
(meta_window_unstick): use window->screen->workspaces instead of
window->workspaces.
2003-09-19 Rob Adams <readams@readams.net>
Fix a bug with partial-width panel struts caused by incorrect
computation of rectangle widths, and another when using different
screen resolutions on xineramas. See #122404. Also fix a crash
bug with the MRU list when sticking and unsticking windows. See
#120809.
* src/constraints.c (get_outermost_onscreen_positions): Fix
off-by-one error with partial-width struts.
* src/window.c (meta_window_update_struts): Fix off-by-one error
with partial-width struts.
(meta_window_stick): assign back to GList after g_list_append
(meta_window_unstick): assign back to GList after g_list_append
* src/workspace.c (ensure_work_areas_validated): For right and
bottom struts, compute strut relative to root window and not to
xinerama edge in compliance with EWMH recommendations.
2003-08-20 Rob Adams <robadams@ucla.edu>
Complete the transition to using the MRU window as the default
focus window instead of the topmost window; fixes a number of
problems with sloppy focus and utility windows. See #112031.
* src/window.c (meta_window_free): call
meta_workspace_focus_mru_window
(meta_window_minimize): call meta_workspace_focus_mru_window
2003-08-15 Ray Strode <halfline@hawaii.rr.com>
Changed MRU list to be per workspace instead of per display, so
sticky windows don't hijack the window focus after workspace
switching (Bug #97635).
* src/delete.c (meta_window_delete): Use
meta_workspace_focus_top_window instead of
meta_screen_focus_top_window.
* src/display.c (meta_display_open): Stop using display->mru_list.
(find_tab_forward):
(find_tab_backward):
(meta_display_get_tab_list): Use workspace->mru_list instead of
display->mru_list and remove unneeded calls to
meta_window_visible_on_workspace
* src/display.h: Remove mru_list from MetaDisplay
* src/keybindings.c (handle_toggle_desktop): Use
meta_workspace_focus_top_window instead of
meta_screen_focus_top_window.
* src/screen.c (meta_screen_focus_top_window):
(meta_screen_focus_default_window): Remove functions.
(meta_screen_show_desktop): Use meta_workspace_focus_top_window
instead of meta_screen_focus_top_window.
* src/screen.h: Remove meta_screen_focus_top_window and
meta_screen_focus_default_window declarations.
* src/window.c (meta_window_new): Stop using display->mru_list.
(meta_window_free): Use meta_workspace_focus_top_window
instead of meta_screen_focus_top_window and stop using
display->mru_list.
(meta_window_stick): Add sticky window to all workspace MRU lists.
(meta_window_unstick): Remove non-sticky window from the workspace
MRU lists it doesn't belong in.
(meta_window_notify_focus): Move newly focused window to the front
of active workspace's MRU list.
* src/workspace.c (meta_workspace_new): Initialize
workspace->mru_list to NULL.
(meta_workspace_add_window): Add window to workspace's MRU list.
(meta_workspace_remove_window): Remove window from workspace's MRU
list.
(meta_workspace_activate_with_focus): Use
meta_workspace_focus_default_window instead of
meta_screen_focus_default_window.
(meta_workspace_focus_default_window):
(meta_workspace_focus_mru_window):
(meta_workspace_focus_top_window): Add functions.
* src/workspace.h: Add mru_list to MetaWorkspace and add function
declarations for meta_workspace_focus_default_window,
meta_workspace_focus_mru_window, meta_workspace_focus_top_window.
2003-07-27 Rob Adams <robadams@ucla.edu>
* src/window.c (update_move): Update window shaking loose so that
the window is moved to the pointer and certain drag state is
properly restored once windows "reattach". Fix for #115000 based
on the patch by Jurg Billeter.
* src/screen.c (meta_screen_resize): Invalidate work areas after
an xrandr screen size update. Fix for #117230.
* src/stack.c (window_is_fullscreen_size): Check the bottom corner
of the window in addition to the top corner. Fix for #118194.
* src/constraints.c (meta_window_constrain): Support aspect ratio
hints in the new constraints code. Fix for #113798.
* src/tools/metacity-window-demo.c (toggle_aspect_ratio): toggle
the aspect ratio hints to force a 16:9 aspect ratio.
(do_appwindow): add a button to toggle aspect ratio.
2003-06-20 Rob Adams <robadams@ucla.edu>
* src/window.c (meta_window_unmaximize): Update grab state when we
unmaximize so double-clicking doesn't cause weird window-jumping
problems. See #116292.
2003-06-26 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_invalidate_work_area): nuke the
lists of struts here, to improve confidence that we never try to
use them after a window with rects in the list gets freed.
(it wasn't broken before I don't think, just making the
code more robust against future mods)
* src/window.c (meta_window_update_struts): replace magic "75"
with a macro
* src/constraints.c (constraint_hints_applies_func): don't apply
hints to maximized or fullscreen, rather than only fullscreen
(constrain_move): add paranoia max number of iterations to the
heuristic loop