2007-04-11 Elijah Newren <newren gmail com>
Make sure apps have correct info about their coordinates, even on
unmap. Fixes temporary hang with libXt (XtVaSetValues setting x &
y coordinates). #399552.
* src/frame.c (meta_window_destroy_frame): Add a comment noting
that the current choice causes the need for a ConfigureNotify
event
* src/window.c (meta_window_free): Send a configure notify event
due to our XReparentWindow coordinate choices on withdrawal,
(unmaximize_window_before_freeing): no need to send a configure
notify from here since it is always done in meta_window_free new,
(send_configure_notify): have to special case the coordinates used
when withdrawing the window
svn path=/trunk/; revision=3192
* common.h: Added "above" to the list of flags a frame can have, so
that we know when to mark it as always on top. Added six grab ops,
one to do and one to undo each of the three new titlebar buttons
(shade, above, stick). Added six new button functions, similarly.
(#96229)
* frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
attribute, set META_FRAME_ABOVE in its flags.
* frames.c (meta_frames_apply_shapes): Allow variable amounts of
rounding. (#113162)
* frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
get_control): extend handling of existing buttons to the
3*2 new kinds of button. (#96229)
* frames.c (meta_frames_button_press_event): translate clicks on the 3*2
new kinds of button to the new grab ops. (#96229)
* frames.c (meta_frames_button_release_event): implement the various
actions for the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_update_prelit_control,
meta_frames_motion_notify_event): extend existing motion
notifications for buttons to the 3*2 new kinds of button. (#96229)
* frames.c (meta_frames_set_window_background): handle specified
background colours and alpha transparency. (#151261)
* frames.h (MetaFrameControl): New control types for the 3*2 new kinds
of button. (#96229)
* iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
window has no icon; use metacity's fallback icons only if the theme
does not provide any. (#11363)
* iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
icon cache on windows using default icons, and update them. (#11363)
* main.c (main): added \n to error message.
* prefs.c (button_function_from_string): extend for 3 new button
types. (#96229)
* prefs.c (button_opposite_function (new function)): return a button
function's inverse (shade -> unshade, etc) (#96229)
* prefs.c (update_button_layout): allocate space for a button's
inverse, if it has one. (#96229)
* theme-parser.c (ParseState): add state for fallback icons (#11363)
* theme-parser.c (ParseInfo): add format_version; remove
menu_icon_* (#114305)
* theme-parser.c (parse_positive_integer): add lookup for integer
constants (#331356)
* theme-parser.c (parse_rounding (new function)): parse window
rounding amount (#113162)
* theme-parser.c (parse_alpha): don't set error if the number can't
be parsed since it'll already be set; change tolerance in comparison
from 1e6 to 1e-6
* theme-parser.c (parse_color (new function)): parse colour, including
possible constant lookup.
* theme-parser.c (parse_toplevel_element): allow defining of various
new kinds of constant; allow
hide_buttons (#121639) and more detailed rounding attributes on
<frame_geometry> (#113162); allow background and alpha attributes on
<frame_style>; (#151261) remove support for <menu_icon> except as
stub; (#114305) add support for loading stock images (#113465); add
support for <fallback>. (#11363))
* theme-parser.c (parse_draw_op_element): add from and to attribute
for arcs. (#121603)
* theme-parser.c (parse_style_element): add check for theme version
supporting a button function. (#96229)
* theme-parser.c (parse_style_set_element): add ability for shaded
windows to be resizable (#114304)
* theme-parser.c (meta_theme_load): add theme versioning routine.
* theme.c ( meta_frame_layout_get_borders): return rectangles for
the new 3*2 kinds of button, except where they're
inapplicable. (#96229)
* theme.c (meta_frame_layout_calc_geometry): don't format buttons on
windows with no buttons (#121639); strip the 3*2 new kinds of button
correctly (#96229); allow variable amounts of rounding (#113162).
* theme.c (meta_frame_style_new): set alpha to 255 by
default. (#151261)
* theme.c (meta_frame_style_unref): free colour spec if
allocated. (#151261)
* theme.c (meta_frame_style_validate): it's only an error not to
include a button if that button is valid in the current
theme. (#96229)
* theme.c (button_rect): return rectangles for the new 3*2 kinds
of button. (#96229)
* theme.c (meta_frame_style_set_unref): free differently resizable
shaded styles. (#114304)
* theme.c (get_style): look up differently resizable styles
for shaded windows. (#114304)
* theme.c (free_menu_ops (removed function), get_menu_icon
(removed function), meta_theme_draw_menu_icon (removed function),
meta_menu_icon_type_from_string (removed function),
meta_menu_icon_type_to_string (removed function),
meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)
* theme.c (meta_theme_load_image): add size_of_theme_icons
parameter. (#113465)
* theme.c (meta_theme_define_color_constant (new function),
meta_theme_lookup_color_constant (new function)): allow
definition of colour constants. (#129747)
* theme.c (meta_button_type_from_string, meta_button_type_to_string):
add the 3*2 new kinds of button. (#96229)
* theme.c (meta_theme_earliest_version_with_button (new function)):
return the theme version each button was introduced in. (#96229)
* theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
corner radiuses. (#113162)
* theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
buttons. (#96229)
* theme.h (MetaButtonType): the 3*2 new buttons. (#96229)
* theme.h (MetaFrameStyle): add window_background_color and
window_background_alpha so that we can specify background on a
<frame_style>. (#151261)
* theme.h (MetaFrameStyleSet): shaded_styles gets resize
dimension. (#114304)
* theme.h (MetaTheme): added format_version, color_constants
hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
and removed menu_icons. (#114305)
* theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
supports a given feature. Also, several macros representing
new features in v2.
* ui.c (meta_ui_set_current_theme)): also invalidate default
icons. (#11363)
* window.[ch] (meta_window_update_icon_now)): became
non-static. (#11363)
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
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()
2004-10-19 Anders Carlsson <andersca@gnome.org>
* src/frame.c: (meta_window_ensure_frame):
Don't try to use an ARGB visual at all if the depth isn't
32-bit. This caused major slowdowns with Composite enabled.
2004-08-26 Havoc Pennington <hp@redhat.com>
* src/frame.c: delete extra copy of find_argb_visual so things
compile
* src/compositor.c (HAS_NAME_WINDOW_PIXMAP): copy the
XCompositeNameWindowPixmap() stuff from xcompmgr, though I can't
say I really know what it's supposed to help with (painting the
window border?)
2004-08-26 Havoc Pennington <hp@redhat.com>
* src/frame.c, src/theme.c: couple of cosmetic tweaks from
resolving my local patch with the bugzilla patch from the 8-19
entry below
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
Sun Aug 8 14:20:00 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* src/frame.c (meta_frame_set_screen_cursor): Flush after setting
cursor. (Rest of #149413).
2003-11-15 Rob Adams <readams@readams.net>
Inherit visual from frame window so that metacity will work with
the new compositing manager extension work by Keith on
freedesktop.org, so that ARGB windows can be full
alpha-transparent without a metacity frame getting drawn in the
background. In the long term, we need to actually set alpha
values when drawing the frame so that it will really work; this is
a stopgap solution. Patch from Keith Packard; see Bug 126875.
* src/frame.c (meta_window_ensure_frame): pass client visual to
frame.
* src/ui.[ch] (meta_ui_create_frame_window): add new xvisual
parameter and use it to create new window.
2003-08-16 Havoc Pennington <hp@pobox.com>
Patch from Soeren Sandmann #108926 to improve opaque resize
* src/frame.c (meta_window_ensure_frame): new function
* src/ui.c (meta_ui_create_frame_window): new function to create
a frame with GDK, so that GDK's invalidation etc. work properly
2003-01-05 Havoc Pennington <hp@pobox.com>
* src/frames.c (meta_frames_apply_shapes): handle
the client having a shape mask, fixes#101806
* src/core.c (meta_core_get_client_xwindow): new function
* src/frame.c, src/frame.h: keep a flag for whether we need to
update the frame shape
* src/window.c (meta_window_new): select for ShapeNotify
* src/display.h, src/display.c: actually query the shape
extension, instead of just using it all over the place.
* src/prefs.c (update_application_based): don't let people turn on
application_based, as it just causes funky bugs. We can reenable
the pref when/if it ever does something useful.
2002-10-26 Havoc Pennington <hp@pobox.com>
* src/iconcache.c: include config.h
* src/group.c: include config.h
* src/frame.c: include config.h
* src/core.c: include config.h so it doesn't crash all over the
place due to #ifdef HAVE_STARTUP_NOTIFICATION
* src/util.c (meta_print_backtrace): export from this file
* src/main.c (log_handler): print backtrace here
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-07-02 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_show_menu): use new macros to get
whether we allow move/resize correct
* src/frame.c (meta_frame_get_flags): use new macros to get
whether we can move/resize correct, considering
maximized/fullscreen for the move case.
* src/window.h (META_WINDOW_ALLOWS_RESIZE,
META_WINDOW_ALLOWS_MOVE): new macros
* src/keybindings.c (process_keyboard_resize_grab): finish the
right/left resize, patch from Jayaraj #78179.
Has the same old move/resize bug, if it hits a constraint it
starts to break because we move without resizing.
2002-06-21 Havoc Pennington <hp@pobox.com>
Theme breakage! Themes have to implement "border" frames
now, see Atlanta for an example. Fixes#84285
* src/tools/metacity-window-demo.c (do_appwindow): add a
border-only window
* src/window.c (update_mwm_hints): read border only from the MWM
hints
* src/window.h (struct _MetaWindow): add border_only flag
* src/core.c (meta_core_get_frame_type): report border type if
required
* src/common.h (enum): add META_FRAME_TYPE_BORDER
2002-06-08 Havoc Pennington <hp@pobox.com>
* src/screen.c (meta_screen_get_xinerama_for_window):
short-circuit the "only one xinerama" case, and use outer rect of
window instead of window->rect, so we get root window coords.
* src/theme.c (meta_frame_layout_get_borders): if fullscreen all
frame edges are zero-width.
* src/frame.c (meta_frame_get_flags): init fullscreen flag.
* src/common.h (enum): add META_FRAME_FULLSCREEN frame flag
* src/place.c: fix up calls to meta_window_get_work_area
* src/window.c (meta_window_get_work_area): add an arg for whether
the work area is for the screen or the xinerama subscreen.
(constrain_position): fix up calls to meta_window_get_work_area
(constrain_size): ditto
* src/screen.c (meta_screen_new): add METACITY_DEBUG_XINERAMA
environment variable which simulates xinerama on a single head.
2002-05-30 Havoc Pennington <hp@redhat.com>
* src/main.c (main): verbose-log on startup whether we were
compiled with various extensions
* src/display.c (meta_display_queue_retheme_all_windows): reapply
shape mask when changing themes, sucks to do it here though, makes
theme changing slower. Needs fixing.
* src/theme-parser.c (parse_toplevel_element): parse rounded
corner options to frame_geometry
* src/frames.c (meta_frames_apply_shapes): apply rounded corners
if requested by the theme
* configure.in (HAVE_SHAPE): check for shape extension
2002-05-09 Havoc Pennington <hp@redhat.com>
* src/frames.c (show_tip_now): DefaultScreen() returns the screen
number not Screen*
* src/frame.c (meta_frame_sync_to_window): immediately repaint
frame whenever we resize it, if we're inside a grab operation.
* src/frames.c (meta_frames_repaint_frame): new function
* src/window.c (meta_window_new): initialize window's colormap
(meta_window_notify_focus): install the colormap for a window when
it gets focus, uninstall on unfocus.
* src/window.h (struct _MetaWindow): store window's colormap
* src/display.c (event_callback): note changes to window colormap
* src/frame.c (EVENT_MASK): add ColormapChangeMask
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-24 Havoc Pennington <hp@pobox.com>
* src/display.c (xcursor_for_op): switch on the op passed in, not
the active op. Gives us the right cursor during resizing, etc.
* src/errors.c: rearrange all the error stuff to adapt to the GDK
change a while back, so now we print our X errors again
* src/display.c (meta_display_begin_grab_op): remove KeyPressMask
and KeyReleaseMask from the XGrabPointer(), this caused BadValue
and kept the grab from ever succeeding. Fixes the problem with the
GTK resize grip - this is why you shouldn't break your X error
spew. ;-)
* src/display.c: debug spew tweaks
* src/window.c (meta_window_client_message): do some
s/verbose/topic/ stuff
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-27 Havoc Pennington <hp@pobox.com>
* src/frames.c: separate code to draw frame from the
expose_event handler, so in principle we can draw the
frame to a pixmap, but this isn't used yet.
2002-01-19 Havoc Pennington <hp@pobox.com>
* src/wm-tester/test-resizing.c: cheesy client with static
bit gravity, used to test the below change.
* src/window.c (meta_window_move_resize_internal): implement
Owen's proposal for window resizing.
http://mail.gnome.org/archives/wm-spec-list/1999-November/msg00088.html
Currently you have to do METACITY_USE_STATIC_GRAVITY=1 in order to
use it, because some GDK bug is screwing up exposes on my frames
when it's enabled.
* src/display.c (meta_display_create_x_cursor): fix glyph for
NE/NW cursors
* src/frames.c (get_control): add ability to resize from top
* src/frame.c (meta_frame_get_flags): can't resize shaded windows
(meta_frame_sync_to_window): add gravity arg
* src/common.h (MetaWindowType): move here from window.h so
it can be used in themes stuff.
(MetaFrameFlags): remove META_FRAME_TRANSIENT since it
overlaps with window type and was unused.
2002-01-10 Havoc Pennington <hp@pobox.com>
* src/frame.c (meta_window_destroy_frame): only bump
unmaps_pending if the window was mapped
(meta_window_ensure_frame): ditto
* src/keybindings.c: change arrow key bindings to use Ctrl+Alt not
just Alt, and add debug mode key bindings
* src/stack.c (meta_stack_get_default_focus_window): don't choose
a default focus window with unmaps pending, since we probably just
unmapped it.
* src/display.c (event_callback): move notify_focus on UnmapNotify
after the window_free check, so we can move focus to another
window when we unmanage
* src/window.c (meta_window_hide): invalidate work areas when
hiding a window with struts
(meta_window_free): invalidate work areas when unmanaging a window
with struts
2001-12-21 Havoc Pennington <hp@redhat.com>
* src/frame.c (meta_window_ensure_frame): add a server grab
here since we were failing to have one when calling the function
2001-09-10 Havoc Pennington <hp@pobox.com>
* src/window.c: Don't separate user_has_moved/user_has_resized,
fixes bug in east-resizing Emacs, among other things
* src/frame.c (meta_frame_sync_to_window): return immediately if
nothing to do
* src/util.c (ensure_logfile): replace rather than truncate old
logfiles
2001-09-08 Havoc Pennington <hp@pobox.com>
* src/ui.c (meta_ui_init): don't use gdk_display_name
* src/frame.c (meta_window_ensure_frame): create frame
with screen default visual, rather than client window visual;
for DRI games, the client window visual was not allowed to be
a child of another window with the same visual, apparently.
Anyhow now we copy twm, etc. so it must be correct.
* src/place.c (meta_window_place): if a transient is placed and
its parent has focus, focus the transient.