2003-06-10 Rob Adams <robadams@ucla.edu>
Update constraints code to support the new _NET_WM_STRUT_PARTIAL
EWMH draft specification. See #86682. Also, fix a bug involving
work area invalidation on metacity startup. Fix for #108497.
Finally, some minor fixes for full screen windows.
* src/window.h: Add new MetaStruts structure to store strut rects
for a window. Remove has_struts and do_not_cover flag, and
support new MetaStruts instead of the four ints.
* src/window.c (meta_window_new): change initialization to work
with new struts. Also, move meta_window_update_struts call to
after the workspaces are initialized to fix#108497. Remove
do_not_cover and related code.
(process_property_notify): add strut_partial
(update_struts): change function name to meta_window_update_struts
and expose in external MetaWindow API. Support partial width
struts and the new strut rects.
* src/workspace.h: add new GSLists containing pointers to all
relevant struts for this workspace.
* src/workspace.c (meta_workspace_new): initialize the list of
strut rects for this workspace.
(meta_workspace_free): free the strut rect lists
(ensure_work_areas_validated): support new struts and new strut
rect lists. Unleash the per-xinerama work areas.
* src/constraints.c (get_outermost_onscreen_positions): Use the
current window position along with the new per-workspace strut
rects to compute the constraints that apply to a particular
window.
(constraint_hint_applies_func): don't do hints constraints on
fullscreen windows
(update_position_limits): for maximized windows use the work areas
to set the position limits; for other windows rely on the struts
constraints to be computed later in
get_outermost_onscreen_positions
(meta_window_constrain): don't apply aspect ratio hints to full
screen windows
* src/display.c (meta_display_open): add _NET_WM_STRUT_PARTIAL atom
(meta_rectangle_equal): new helper function for MetaRectangles
(event_queue_callback): #ifndef out if USE_GDK_DISPLAY not set to
avoid compiler warning
* src/display.h: add atom_net_wm_strut_partial, and add
meta_rectangle_equal.
* src/screen.c (meta_screen_rect_intersects_xinerama): change
_window_intersects_ to _rect_intersects_ which is more useful now.
(meta_screen_resize_func): update struts on windows with struts
since struts are relative to the screen size, and this function is
called when the screen size updates.
* src/screen.h (meta_screen_rect_intersects_xinerama): change
_window_intersects_ to _rect_intersects_ which is more useful now.
* src/window-props.c (meta_display_init_window_prop_hooks): add
hook for strut_partial
* src/tools/metacity-window-demo.c: Support partial-width struts
on the dock window tests for metacity testing purposes.
CVS2003-05-29 Rob Adams <robadams@ucla.edu>
Use a new property _METACITY_SENTINEL to eliminate a race
condition that causes focus to behave badly with sloppy/mouse
focus when lots of windows are mapped/unmapped, such as with a
workspace switch. The EnterNotify events on a display are ignored
until the PropertyNotify sent after all the window maps is
received. This is a fix for #110970.
* src/display.[ch]: New _METACITY_SENTINEL atom.
(event_callback): ignore EnterNotify if the sentinel isn't clear,
and decrement the sentinel counter when the PropertyNotify is
received.
(meta_display_increment_focus_sentinel): new function. Increments
the sentinel counter and updates the property on a root window on
this display.
(meta_display_decrement_focus_sentinel): Decrement the sentinel
counter.
(meta_display_focus_sentinel_clear): returns whether the sentinel
counter is zero.
* src/window.c (idle_calc_showing): after showing windows, call
meta_display_increment_focus_sentinel on each display for windows
to be shown.
* src/workspace.[ch] (meta_workspace_activate_with_focus): new
function activates a workspace and focuses a particular window
after the workspace is activated.
(meta_workspace_activate): now just a wrapper for
meta_workspace_activate_with_focus
* src/keybindings.c: use new meta_workspace_activate_with_focus
function to ensure that focus will follow the focused window
through the workspace switch.
: ----------------------------------------------------------------------
2003-02-23 Havoc Pennington <hp@pobox.com>
Patch from Rob Adams addresses #95014 (placement issues),
makes first fit algorithm "center tile", adds most code
for per-xinerama workspaces (#86682) but disables it for now.
* src/workspace.c (meta_workspace_get_work_area_for_xinerama)
(meta_workspace_get_work_area_all_xineramas): new xinerama
functions, maintain workspace->work_areas with a different
work area for each xinerama. However for now all the work
areas are the same, because haven't quite figured out how
_NET_WM_STRUT is supposed to work
* src/window.c: adapt to new meta_window_* xinerama APIs
(meta_window_get_work_area_current_xinerama): new xinerama
API
(meta_window_get_work_area_for_xinerama): new xinerama API
(constrain_position): be a bit more clever about which xinerama's
work area we choose to use.
* src/stack.c: adapt to new Xinerama API
* src/screen.c (reload_xinerama_infos): invalidate all work areas
(meta_screen_get_xinerama_for_rect): new function
(meta_screen_window_intersects_xinerama): new function
* src/place.c (find_first_fit): change to use
"center tiling" (center a screen full of tiled windows,
rather than aligning them top left). Adapt to new
xinerama functions.
2003-01-21 Havoc Pennington <hp@pobox.com>
Fix for the "mangles focus window when switching workspaces
and using mouse focus" bug
* src/stack.c (meta_stack_get_default_focus_window_at_point): new
function
* src/screen.c (meta_screen_focus_mouse_window): new function
(meta_screen_focus_default_window): new function
* src/workspace.c (meta_workspace_activate): use the
new meta_screen_focus_default_window()
2003-01-17 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_handle_mouse_grab_op_event): fix event
compression code to use GDK algorithm suggested by Owen, should be
more efficient.
2003-01-05 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_get_neighbor): redo using new
calc_workspace_layout to fix#98302
* src/util.c (topic_name): shorten default prefix
* src/screen.c (meta_screen_calc_workspace_layout): enhance this
to handle all the funky layouts and calculate more information
than before
2002-12-08 Havoc Pennington <hp@pobox.com>
* src/prefs.c (meta_prefs_get_application_based): make this always
return FALSE for now, to avoid bug reports.
* src/util.c (ensure_logfile): put "opened log file" message on
stderr so it will normally land in ~/.xsession-errors
* configure.in: remove extra AC_ARG_PROGRAM
* src/display.c (event_callback): handle the toggle-verbose message
* src/tools/metacity-message.c: add a toggle-verbose message, been
meaning to do this for a while.
* src/util.c (meta_set_verbose): if verbose mode is enabled and we
don't support it, then exit.
* src/prefs.c: allow building without gconf (currently means some
prefs are no-ops)
* src/util.c, src/util.h: support defining macros to
kill all verbose output entirely. (Removes the code and strings
associated with it)
* configure.in: don't get METACITY_PROPS_LIBS if not building the
config dialog.
(HAVE_GCONF): allow building sans gconf, if you are size-sensitive
and not using gnome.
(WITH_VERBOSE_MODE): add ability to disable all the verbose debug
spew strings, to shrink the binary.
(--disable-sm): allow SM support to be forced on or off
(--disable-startup-notification): allow forcing this on or off
2002-11-20 Havoc Pennington <hp@pobox.com>
* src/window-props.c (set_icon_title): remove unused variable
* src/screen.c (meta_screen_new): read an existing
_NET_CURRENT_DESKTOP and restore it if set. Makes a restart even
less visible.
* src/workspace.c (set_active_space_hint): don't set the hint
during the process of unmanaging a screen
2002-11-03 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_get_name): new function,
and remove workspace->name field, instead just get the
name from prefs each time
* src/screen.c (meta_screen_update_workspace_names): update the
gconf key to persist workspace names here, instead of changing
the names we use
* src/util.c (topic_name): add META_DEBUG_PREFS
* src/prefs.c: change NUM_COMMANDS to 32 to allow more custom
commands, implement workspace names
* src/metacity.schemas.in: add workspace_names/name_NN gconf keys.
2002-10-21 Havoc Pennington <hp@redhat.com>
Optimizations for managing new windows (do not all take effect if
METACITY_DEBUG=1). Bug #96404
* src/keybindings.c (meta_change_keygrab): use error trap nesting
and conditionalize on meta_is_verbose() to avoid a ton of XSync
* src/display.c (meta_change_button_grab): ditto
Throughout: move to new error trap setup to save on XSync calls,
new setup is:
* src/errors.c (meta_error_trap_push_with_return): new function,
an error trap that needs to care about return value and thus
sync even if an outer trap still exists
(meta_error_trap_pop_with_return): new function
(meta_error_trap_pop): add "last_request_was_roundtrip"
argument allowing us to avoid XSync() if we just did
a GetProperty or whatever.
* src/util.c (meta_warning): flush the warning file descriptor
* src/Makefile.am (INCLUDES): define G_LOG_DOMAIN
2002-10-16 Havoc Pennington <hp@redhat.com>
* src/workspace.c: workspaces are all per-screen now, fix
accordingly
* src/core.c: fix multihead workspace stuff
* src/keybindings.c: multihead-rama
* src/screen.c (meta_screen_show_desktop): new functions to
replace display equivalents
* src/display.c (meta_display_get_workspace_by_screen_index): get
rid of this
(meta_display_get_workspace_by_index): get rid of this
(event_callback): handle _NET_SHOWING_DESKTOP message per-screen
* src/screen.c (meta_screen_get_workspace_by_index): new function
* src/screen.h (struct _MetaScreen): move workspace list, and
showing_desktop flag, to be per-screen
* src/window.c (window_query_root_pointer): return whether pointer
is on window's screen
(meta_window_handle_mouse_grab_op_event): don't use coordinates
from other screens when updating a window operation on the current
screen. I can't believe no one has reported this...
2002-09-12 Havoc Pennington <hp@redhat.com>
* src/workspace.c (meta_workspace_screen_index)
(meta_workspace_index): fix compiler warnings
* src/tools/metacity-window-demo.c (menu_items): add a test for
dialogs with no transient parent
* src/place.c (find_first_fit): Try placing window at origin of
first Xinerama, even if there are no windows to place next to;
makes placement work when no other windows are open on the screen.
2002-08-14 Mark McLoughlin <mark@skynet.ie>
* src/screen.c: (set_number_of_spaces_hint), move from
workspace.c.
(update_num_workspaces): set the hint here. Fixes#90123.
* src/workspace.c:
(meta_workspace_new), (meta_workspace_free): don't set
the hint here.
(update_num_workspaces): move to screen.c
2002-08-02 Mark McLoughlin <mark@skynet.ie>
* src/screen.c: (meta_screen_new): set active_workspace
to NULL. Also actually activate the first workspace instead
of just setting active_workspace. Fixes#87367.
(meta_screen_ensure_workspace_popup): don't re-use our
iterator for setting the entries list, stop iterating
when we've gone beyond the last workspace (there may
be empty spaces in the last row).
* src/workspace.c: (meta_workspace_activate): if no workspace
was previously activated, return.
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* src/display.[ch]: (meta_display_open):
src/screen.c: (set_supported_hint), (set_work_area_hint):
Its _NET_WORKAREA, not _NET_WM_WORKAREA silly :-)
2002-06-25 Mark McLoughlin <mark@skynet.ie>
* src/screen.[ch]:
(update_num_workspaces), recalc workarea hint when
new workspaces created. Fixes bug that workarea
not calculated until first non-dock window is
mapped.
(set_work_area_hint), (set_work_area_idle_func),
(meta_screen_queue_workarea_recalc): move all this
stuff from workspace.c.
* src/workspace.c: (meta_workspace_invalidate_work_area):
use meta_screen_queue_workarea_recalc.
2002-06-22 Havoc Pennington <hp@pobox.com>
* src/workspace.c (set_number_of_spaces_hint): do nothing if
screen is being unmanaged, we don't want to blow away state,
we want to remember it for the next window manager.
2002-06-22 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_screen_ensure_workspace_popup): rename
from meta_workspace_ensure_tab_popup, and use workspace->name
instead of a hardcoded name
2002-06-22 Havoc Pennington <hp@pobox.com>
* src/xprops.c (meta_prop_get_utf8_list): new utility function
* src/display.c (meta_display_open): _NET_DESKTOP_NAMES atom
(event_callback): update workspace names when the property changes
* src/screen.c (set_supported_hint): "support" _NET_DESKTOP_NAMES
(nothing to do really)
2002-06-20 Mark McLoughlin <mark@skynet.ie>
* src/window.c: (meta_window_visible_on_workspace): sticky
windows aren't visibile on all screens. Check the workspace
is on the same screen as the window.
* src/workspace.c: (meta_workspace_list_windows): use
meta_window_visible_on_workspace here.
2002-06-12 Havoc Pennington <hp@redhat.com>
* src/theme.c (meta_frame_layout_calc_geometry): when a window is
shaded, don't include client height in the height calculation.
* src/workspace.c (meta_workspace_get_neighbor): apply fix from
Mads Villadsen for the Up arrow key, #84582
2002-06-08 Havoc Pennington <hp@pobox.com>
Apply big patch from blackc@speakeasy.net adding a popup window
to the Ctrl+Alt+arrows shortcuts. #83940
2002-06-08 Havoc Pennington <hp@pobox.com>
* src/screen.c (meta_screen_new): select key press/release on the
display->no_focus_window, another attempted fix for not getting
keybindings when no window is focused. Still doesn't seem to work
though. I don't get what's going wrong.
(meta_create_offscreen_window): new function, used instead of
XCreateSimpleWindow so we get override redirect offscreen windows.
2002-05-15 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_get_neighbor): use the layout
information to figure out up/down neighbors
* src/display.c (event_callback): catch propertynotify on
_NET_DESKTOP_LAYOUT
* src/screen.c (meta_screen_update_workspace_layout): keep track
of the layout of workspaces as set by the pager
2002-05-07 Anders Carlsson <andersca@gnu.org>
* src/workspace.c (set_work_area_hint): Doh, only update
the tmp pointer when the screen matches. Fixes a segfault
when running with multiple screens.
2002-05-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_unminimize): on unminimize, queue
calc_showing on all transients
(meta_window_activate): on activate, unminimize all a window's
ancestors, not just the window itself.
* src/workspace.c (set_work_area_hint): don't increment "tmp" by
16 unsigned long, increment by 4
* src/window.c (meta_window_free): if a window isn't minimized,
restore its WM_STATE to NormalState instead of IconicState,
since IconicState on initial window map means that the window
should be minimized.
* src/workspace.c (meta_workspace_invalidate_work_area): queue an
idle to recompute the work area hint.
(set_work_area_hint): we need 4*num_workspaces ints, not just
num_workspaces.
* src/screen.c (meta_screen_new): add work_area_idle field,
handle it on screen shutdown
* src/common.h (META_PRIORITY_PREFS_NOTIFY,
META_PRIORITY_WORK_AREA_HINT): define some idle priorities
* src/window.c (meta_window_calc_showing): hide windows if
their parent window is minimized
(meta_window_minimize): also queue_calc_showing on all
transients of the window being minimized
* src/place.c (constrain_placement): function to apply
placement-time-only constraints, such as "not off the left of the
screen"
(meta_window_place): put dialogs down a bit over their parent,
not right at the top.
(meta_window_place): when centering a dialog, center it
on the current xinerama screen, rather than the entire
screen.
* src/screen.c (meta_screen_get_current_xinerama): new function,
but not implemented
2002-04-28 Anders Carlsson <andersca@gnu.org>
* src/display.c: (meta_display_open):
* src/display.h:
* src/screen.c: (set_supported_hint):
* src/workspace.c: (set_number_of_spaces_hint),
(set_workarea_hint):
Add support for setting the _NET_WM_WORKAREA hint. No code
does it yet though.
2002-04-28 Havoc Pennington <hp@pobox.com>
* README: remove caveats about keybindings
* src/metacity.schemas: add schemas for all the keybindings.
* src/window.c (meta_window_activate): if in "show desktop" mode
when a window is activated, leave show desktop mode. So e.g.
when you click on a task in the task list, show desktop mode
will be turned off.
* src/workspace.c (meta_workspace_get_neighbor): new function
that doesn't quite work yet (needs support for getting
workspace layout from the pager)
* src/prefs.c: keybindings stuff
* src/keybindings.c: make keybindings configurable
* src/ui.c (meta_ui_parse_accelerator): new function
2002-04-22 Havoc Pennington <hp@redhat.com>
* src/main.c (main): call setlocale ourselves because due to a
GLib bug that sticks us in ASCII if you call g_print or anything
prior to setlocale, and print a warning if we don't set the locale
successfully. #79280
* src/workspace.c (meta_workspace_get_work_area): be more verbose
about how the work area was computed, to help find bugs here.
* src/main.c (main): put locale and codeset in the log file
2002-02-08 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_show): when mapping a window with
struts, invalidate the work areas it's on. Should fix at least
part of the problem with windows maximizing over panels.
* src/workspace.c (meta_workspace_invalidate_work_area): also
queue move/resize on sticky windows
* src/tools/Makefile.am: consolidate reload-theme, restart into a
"metacity-message" app and add enable/disable keybindings to the
messages it knows about.
* src/keybindings.c:
(meta_change_keygrab): grab keyboard synchronously
(meta_display_process_key_event): if all keybindings are toggled
off, ReplayKeyboard, else AsyncKeyboard, except that the debug
binding for toggling back on is always processed
(meta_set_keybindings_disabled): function to disable/enable
all keybindings
2002-02-07 Havoc Pennington <hp@pobox.com>
Throughout: move to meta_topic rather than meta_verbose so
metacity.log can start being more useful
* src/util.h (enum): add more debug topics
* src/frames.c: clean up some cruft that caused warnings
2002-01-18 Havoc Pennington <hp@pobox.com>
* src/window.c (constrain_position): give priority to keeping NW
corner onscreen rather than SE, if we need to shift the window
to fit inside constraints
* src/frames.c (meta_frames_get_geometry): don't depend on the
current window size
* src/theme.c: move geometry stuff in here, to be calculated as
part of the theme
* src/core.c (meta_core_get_client_size): new function to replace
meta_core_get_frame_size() so we don't have weird cycles
in the geometry calculation
2002-01-09 Havoc Pennington <hp@pobox.com>
* src/window.c, src/window.h: store strut information,
update it on property changes, etc. etc. so we avoid panel
on maximize.
* src/workspace.c (meta_workspace_get_work_area): add accessor for
work area so we can compute it lazily
* src/display.h, src/display.c: add _NET_WM_STRUT atom
and _WIN_HINTS atom
2002-01-03 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_activate): focus top window when
switching to a new workspace
* src/util.c (meta_topic): start putting verbose output in
categories
* src/window.c (meta_window_shade): focus frame after we queue
the calc_showing so the maps/unmaps have already happened.
* src/display.c (meta_display_get_current_time): add the "get time
of current event" function and call it occasionally.
* src/window.c (meta_window_free): if we have focus, call
meta_screen_focus_top_window().
(meta_window_minimize): ditto
(meta_window_delete): ditto
* src/screen.c (meta_screen_ensure_tab_popup): fix memory leak -
didn't free tab list
(meta_screen_focus_top_window): new function to use when we unmap
or unmanage a focused window
* src/stack.c (meta_stack_get_default_focus_window): function used
in meta_screen_focus_top_window
2001-12-09 Havoc Pennington <hp@pobox.com>
* src/workspace.c (meta_workspace_free): update number of
workspaces hint
* src/screen.c (update_num_workspaces): implement number of
workspaces setting
* src/window.c (meta_window_configure_request): honor configure
requests on windows of type NORMAL, but still be mean to those of
type DIALOG
* src/main.c (main): add more log domains to those we set a log
handler for, and only set warnings fatal in debug mode
* src/metacity.schemas: add number of workspaces setting