1
0
Fork 0
Commit graph

418 commits

Author SHA1 Message Date
Søren Sandmann
ca539199b2 Add unused wobbly unminimize animation by Kristian
Wed Feb 15 14:47:50 2006  Søren Sandmann  <sandmann@redhat.com>

	* src/compositor.c (meta_compositor_unminimize): Add unused wobbly
	unminimize animation by Kristian

	* src/compositor.c (meta_compositor_minimize): Add wobbly minimize
	animation by Kristian.

	* src/compositor.c: Add support for turning updates on and off.

	* src/window.c (meta_window_move_resize_internal): Use
	sync counter to make composited resizing tear free
2006-02-15 19:50:12 +00:00
Elijah Newren
74510389bc remove this legacy cruft that we stopped using years ago
2006-02-11  Elijah Newren  <newren gmail com>

	* src/window.c (enum GnomeWinLayer): remove this legacy cruft that
	we stopped using years ago
2006-02-11 23:41:15 +00:00
Thomas Thurman
7aebefad3c Avoid a memory leak when checking which workspace(s) a window is on. Fixes
2006-02-10  Thomas Thurman <thomas thurman org uk>

	Avoid a memory leak when checking which workspace(s) a window is
	on.  Fixes #322059.

        * src/workspace.h (struct MetaWorkspace):
        * src/workspace.c (meta_workspace_new, meta_workspace_free):
	added list_containing_self member to MetaWorkspace

        * src/window.c (meta_window_get_workspaces): use
	window->workspace->list_containing_self instead of allocating (and
	leaking) such a list on the fly.
2006-02-11 05:06:08 +00:00
Elijah Newren
dcec11274a Avoid flashing when closing a maximized window. Fixes #317254.
2006-01-20  Elijah Newren  <newren gmail com>

	Avoid flashing when closing a maximized window.  Fixes #317254.

	* src/window.c (unmaximize_window_before_freeing): new function
	that just fixes the net_wm_state and sends a configure_notify,
	(meta_window_free): use unmaximize_window_before_freeing() instead
	of meta_window_unmaximize() to avoid flicker
2006-01-20 23:36:23 +00:00
Elijah Newren
32d4bd6b63 Patch from Kjartan Maraas to fix a lot of tiny issues (unused variable
2006-01-20  Elijah Newren  <newren gmail com>

	* src/async-getprop.c:
	* src/common.h:
	* src/display.c:
	* src/eggaccelerators.c:
	* src/frames.c:
	* src/gradient.c:
	* src/iconcache.c:
	* src/keybindings.c:
	* src/metaaccellabel.c:
	* src/place.c:
	* src/prefs.c:
	* src/preview-widget.c:
	* src/screen.c:
	* src/session.c:
	* src/stack.c:
	* src/tabpopup.c:
	* src/theme-viewer.c:
	* src/theme.c:
	* src/window-props.c:
	* src/window.c:
	* src/workspace.c:
	* src/tools/metacity-window-demo.c:
	* src/wm-tester/test-gravity.c:
	* src/wm-tester/test-resizing.c:
	* src/wm-tester/test-size-hints.c:
	Patch from Kjartan Maraas to fix a lot of tiny issues (unused
	variable removal, making unused variables used again, correction
	of types passed/declared for printf arguments, removal of unneeded
	breaks and returns, dead code removal, dead code revival, renaming
	to prevent shadowed variables, declaring unexported functions as
	static) spotted by the intel compiler.  #321439
2006-01-20 22:03:56 +00:00
Elijah Newren
9fdd3d165d Fix accidental overzealous focus holding by the terminal introduced by the
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-15 17:03:57 +00:00
Elijah Newren
ef792fc1f7 Patch from Jens Granseuer to fix more build issues with gcc 2.95. #327050.
2006-01-15  Elijah Newren  <newren@gmail.com>

	Patch from Jens Granseuer to fix more build issues with gcc 2.95.
	#327050.

	* src/boxes.c (meta_rectangle_edge_cmp_ignore_type):
	* src/window.c (meta_window_show):
	Remove C99 style variable initiailization
2006-01-15 16:37:06 +00:00
Elijah Newren
50bcc976bc Don't dereference a NULL string. Fixes #327013.
2006-01-14  Elijah Newren  <newren gmail com>

	* src/window.c (__window_is_terminal): Don't dereference a NULL
	string.  Fixes #327013.
2006-01-15 04:45:34 +00:00
Søren Sandmann
fea6191473 Add a dependency on libcm when building with compositor.
Fri Jan 13 14:40:19 2006  Søren Sandmann  <sandmann@redhat.com>

	* configure.in: Add a dependency on libcm when building with
	compositor.

	* src/window.c (meta_window_hide): Make this function static.

	* src/window.c (implement_showing): Use meta_compositor_minimize()
	to do a weird minimize effect.

	* src/compositor.[ch]: Beginning of new GL based compositor.

	* src/screen.h (struct _MetaScreen): Add void pointer to
	compositor data.

	* src/screen.c (meta_screen_new): Remove obsolete compositor
	stuff; initialize compositor_data. Don't composite manage screen
	out of this function.

	* src/errors.c (x_error_handler): Check that display is non-NULL
	before using it. Add comment about how that can happen.

	* src/display.c (meta_display_{begin,end}_grab_op): Remove
	explicity damage of windows.

	* src/display.c (meta_display_open): Composite manage all the
	screens.
2006-01-13 19:41:01 +00:00
Elijah Newren
5913b8c5ab Whoops, I forgot to keep my copyright info updated with my previous
2006-01-10  Elijah Newren  <newren@gmail.com>

	* src/bell.c:
	* src/boxes.c:
	* src/boxes.h:
	* src/constraints.c:
	* src/core.c:
	* src/display.c:
	* src/display.h:
	* src/edge-resistance.c:
	* src/frames.c:
	* src/keybindings.c:
	* src/main.c:
	* src/prefs.c:
	* src/prefs.h:
	* src/screen.c:
	* src/screen.h:
	* src/window.c:
	* src/window.h:
	Whoops, I forgot to keep my copyright info updated with my previous
	commits as Havoc had asked me to do.  Doing that now...
2006-01-10 19:43:21 +00:00
Elijah Newren
52df880f32 Add a raise on click option, basically only because all the major distros
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-10 19:35:03 +00:00
Elijah Newren
f6270596de Don't "steal" focus from terminal windows for new window mappings as the
2006-01-10  Elijah Newren  <newren@gmail.com>

	Don't "steal" focus from terminal windows for new window mappings
	as the difference in usage between terminals and other apps seems
	to suggest this difference in treatment.  See #326159 for details,
	feedback welcome.

	* src/window.[ch] (__window_is_terminal): New function, currently
	an ugly hack and should be replaced by a new property set by
	applications if the behavior works to our liking,
	(window_state_on_map): don't transfer focus to new windows from
	terminals unless the new window is a transient of the focused
	terminal

	* src/keybindigns.c (handle_panel_keybinding): panel run dialog
	keybinding should be counted as an explicit transfer of focus to
	the new window, so override the
	don't-transfer-focus-from-terminals in this case
2006-01-10 18:33:53 +00:00
Elijah Newren
a4d1c6fd61 More thorough handling of source indication. Part of #326041.
2006-01-09  Elijah Newren  <newren@gmail.com>

	More thorough handling of source indication.  Part of #326041.

	* src/window.c (window_activate): new function based off the old
	meta_window_activate but which also takes source indication into
	account, (meta_window_active): just call window_activate() with
	the necessary source indication to get the behavior wanted,
	(meta_window_client_message): check source indication too for
	_net_active_window messages

	* src/window.h (enum MetaClientType): convenience enum for source
	indication handling
2006-01-10 05:44:40 +00:00
Elijah Newren
0f8add8b37 Make the taskbar less flash happy and fix up some related stacking issues.
2006-01-09  Elijah Newren  <newren@gmail.com>

	Make the taskbar less flash happy and fix up some related stacking
	issues.  #326035.

	* src/window.c (windows_overlap): new function,
	(meta_window_show): if a window is denied focus but doesn't
	overlap with the focus window there is no need to set the demands
	attention hint nor stack that window below the focus window,
	(meta_window_get_outer_rect): we're not modifying the window so
	declare it to be const
2006-01-10 05:14:48 +00:00
Elijah Newren
339948fcf2 Patch from Björn Lindqvist to fix a logic error. #322149.
2006-01-02  Elijah Newren  <newren@gmail.com>

	Patch from Björn Lindqvist to fix a logic error.  #322149.

	* src/window.c (update_resize): && should have been ||.
2006-01-02 18:48:30 +00:00
Elijah Newren
ebd0c7e9a6 Patch from Jens Granseuer to fix build with gcc 2.95. #322622.
2006-01-02  Elijah Newren  <newren@gmail.com>

	Patch from Jens Granseuer to fix build with gcc 2.95.  #322622.

	* src/boxes.c (meta_rectangle_region_to_string,
	  meta_rectangle_edge_list_to_string, fix_up_edges):
	* src/constraints.c (meta_window_constrain, setup_constraint_info,
	  place_window_if_needed, constrain_maximization,
	  constrain_fullscreen, constrain_size_increments,
	  constrain_size_limits, constrain_aspect_ratio,
	  do_screen_and_xinerama_relative_constrai,
	  constrain_to_single_xinerama, constrain_fully_onscreen,
	  constrain_partially_onscreen):
	* src/edge-resistance.c (find_nearest_position,
	  apply_edge_resistance, apply_edge_resistance_to_each_side):
	* src/testboxes.c (test_clamping_to_region,
	  test_clipping_to_region, test_shoving_into_region):
	* src/window.c (meta_window_new_with_attrs,
	  meta_window_apply_session_info, meta_window_resize,
	  meta_window_resize_with_gravity, meta_window_configure_request):
	Remove C99 style variable initiailization
2006-01-02 18:37:46 +00:00
Elijah Newren
703f58cdf7 Make the workspace switcher work with dual-head (non-xinerama) setups.
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-12-28 06:24:30 +00:00
Elijah Newren
53cba6ed37 Oops, I only meant to commit the changes to rationales.txt in the last commit 2005-12-22 07:08:38 +00:00
Elijah Newren
7e821f37fd Add xinerama and multi-head tracker bugs 2005-12-22 06:18:38 +00:00
Elijah Newren
12193322a8 make the debugging message actually correspond to the code. Patch from
2005-12-12  Elijah Newren  <newren@gmail.com>

	* src/window.c (update_net_frame_extents): make the debugging
	message actually correspond to the code.  Patch from Björn
	Lindqvist.  Fixes #322051.
2005-12-12 18:22:40 +00:00
Elijah Newren
ca2fe384bc Don't allow removing a window from maximized or fullscreened state to
2005-11-22  Elijah Newren  <newren@gmail.com>

	Don't allow removing a window from maximized or fullscreened state
	to place the titlebar under the top panel.  Fixes #322075.

	* src/display.c (handle_net_moveresize_window): fix up previous
	comments now that I know a little more, modify the code just
	slightly to clarify that this is NOT a manual user move/resize
	operation

	* src/window.c (meta_window_unmaximize,
	  meta_window_unmake_fullscreen,
	  meta_window_shove_titlebar_onscreen):
	don't claim that these are manual user move/resize operations
2005-11-22 15:48:30 +00:00
Elijah Newren
a7201d27d1 Merge of all the changes on the constraints_experiments branch. This is
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-11-19 14:58:50 +00:00
Elijah Newren
29e38a2f53 Add my copyright notice to a number of files on which it should already
2005-10-08  Elijah Newren  <newren@gmail.com>

	Add my copyright notice to a number of files on which it should
	already exist.
2005-10-08 19:38:54 +00:00
Elijah Newren
12daca5cb1 Patch from Ross Cohen to make alt-esc (show windows instantly) actually
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Ross Cohen to make alt-esc (show windows instantly)
	actually show minimized windows too.  Fixes #107072.

	* src/keybindings.c (process_tab_grab): initialize tab_unminimized
	to FALSE for the target window when starting the grab, when
	advancing through the list check to find the previous window and
	re-minimize it if it was tab-unminimized, unminimize the new
	window we're alt-esc'ing to if it's minimized, (do_choose_window):
	raise and unminimize the initial window as well in alt-esc'ing

	* src/window.h (struct _MetaWindow): add a tab_unminimized field

	* src/window.c (meta_window_new_with_attrs): initialize
	tab_unminimized to false
2005-10-03 20:02:31 +00:00
Elijah Newren
26dbf9856b A combination of a couple memory leaks fixes, from Kjartan, Soeren, and I.
2005-10-03  Elijah Newren  <newren@gmail.com>

	A combination of a couple memory leaks fixes, from Kjartan,
	Soeren, and I.  Fixes #313030.

	* src/bell.c (meta_bell_flash_screen): call XFreeGC()

	* src/frames.c (invalidate_cache): free pixels

	* src/window.c (meta_window_show_menu): call
	meta_screen_free_workspace_layout()
2005-10-03 19:22:40 +00:00
Elijah Newren
47f1a8634b Patch from Björn Lindqvist to have ancestors come along with the
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Björn Lindqvist to have ancestors come along with the
	transient when moving the window from one workspace to another.
	Fixes #314977.

	* src/window.c (meta_window_change_workspace): have all ancestors
	change workspaces too
2005-10-03 19:00:01 +00:00
Ray Strode
2972ab6df6 Improve the behavior of keyboard move/resize and edge snapping. Still not
2005-08-03  Ray Strode  <rstrode@redhat.com>

	Improve the behavior of keyboard move/resize and edge
	snapping.  Still not perfect, bug 310888.

	* src/effects.c (draw_xor_rect): Make the outside of a
	wireframe rectangle line up with the outside edge of its
	window, instead of centering the wireframe edges on the
	window edges.

	* src/keybindings.c (process_keyboard_move_grab): allow
	edge snapping in wireframe mode.  Adjust code to take
	into account changed semantics of find_next_*_edge
	functions.
	(process_keyboard_resize_grab_op_change): new function
	to take some orthogonal logic out of
	process_keyboard_resize_grab_op.  Only allow keyboard
	resize cursor to go to flat edges, not corners.
	(process_keyboard_resize_grab):  allow edge snapping in
	wireframe mode.  Fix up snapping logic.

	* src/place.c (get_{vertical,horizontal}_edges): use
	GArray instead of int *, since the number of output
	edges isn't known until the middle of the function now.
	Use xor rect extents instead of window extends if in
	wireframe mode.
	(meta_window_find_next_{vertical,horizontal}_edge: add
	new source_edge_position parameter to specify which edge
	on the active window to start from when looking for next
	edge on the screen. Return the coordinate of the edge
	found and not the coordinate of where the window should be
	moved to snap to where the edge was found.

	* src/window.c (update_move): all the user to specify
	an edge to resize with mouse in keyboard resize mode.
	window
2005-08-03 02:22:00 +00:00
Elijah Newren
c25b8ec616 raise the window as well as its ancestor; fixes a stacking bug with an
2005-07-24  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_raise): raise the window as well as
	its ancestor; fixes a stacking bug with an ancestor that has more
	than one child window.  Fixes one of the issues in #307875.
2005-07-25 01:52:50 +00:00
Elijah Newren
c64bda776b restore original window size if the window was maximized, as the FIXME
2005-07-24  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_free): restore original window size if
	the window was maximized, as the FIXME says.  ;-) Fixes #137185.
2005-07-25 01:39:24 +00:00
Elijah Newren
225407f3b3 revert the patch from #128380--change _NET_ACTIVE_WINDOW behavior to what
2005-07-23  Elijah Newren  <newren@gmail.com>

	* src/window.c: (meta_window_activate): revert the patch from
	#128380--change _NET_ACTIVE_WINDOW behavior to what it originally
	was.
2005-07-24 01:13:41 +00:00
Elijah Newren
3fdf721286 If a window requests to be raised and is denied, set the demands attention
2005-06-02  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_configure_request): If a window
	requests to be raised and is denied, set the demands attention
	hint.  Fixes #305882.
2005-06-02 15:47:37 +00:00
Elijah Newren
90dc2116ad if the window has a modal transient which is being unmanaged, don't focus
2005-06-02  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_focus): if the window has a modal
	transient which is being unmanaged, don't focus it.  Fixes the
	Metacity issue reported in #305362.
2005-06-02 15:24:40 +00:00
Elijah Newren
be49961944 Patch from Greg Hudson to make sure window position is calculated
2005-05-26  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_configure_request): Patch from Greg
	Hudson to make sure window position is calculated correctly for
	reconfigure requests when part of the XWindowChanges structure is
	uninitialized.  Fixes #305257.
2005-05-26 20:14:15 +00:00
Ray Strode
7b416a0a2d Actually commit the stuff mentioned in the last ChangeLog entry.
2005-05-26  Ray Strode  <rstrode@redhat.com>

	Actually commit the stuff mentioned in the last
	ChangeLog entry.
2005-05-26 19:58:17 +00:00
Elijah Newren
e1891161d0 don't accidentally treat maximize vertically as maximize in both
2005-05-26  Elijah Newren  <newren@gmail.com>

	* src/window.c (check_maximize_to_work_area): don't accidentally
	treat maximize vertically as maximize in both directions.  Fixes
	#302204.
2005-05-26 18:42:55 +00:00
Elijah Newren
eb46b01e97 put all transients of the new window, if any exist, in the calc_showing
2005-05-26  Elijah Newren  <newren@gmail.com>

	* src/window.c: (meta_window_new_with_attrs): put all transients
	of the new window, if any exist, in the calc_showing queue.  Fixes
	#303284.
2005-05-26 17:15:56 +00:00
Elijah Newren
ebae340a1e Fix crash that occurs when stupid apps claim that a window is its own
2005-02-23  Elijah Newren  <newren@gmail.com>

	* src/window.c: (meta_window_new_with_attrs): Fix crash that
	occurs when stupid apps claim that a window is its own parent.
	#168207
2005-02-23 17:42:51 +00:00
Elijah Newren
612507260a Handle keynav vs. mousenav in mouse and sloppy focus modes. Fixes #167545.
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-22 02:11:25 +00:00
Elijah Newren
8de466b582 when receiving a _NET_ACTIVE_WINDOW message, switch to the desktop where
2005-02-20  Elijah Newren  <newren@gmail.com>

	* src/window.c: (meta_window_activate): when receiving a
	_NET_ACTIVE_WINDOW message, switch to the desktop where the window
	is located before activating instead of moving the window to the
	current desktop.  Thanks to Lubos Lunak for catching this issue.
	Fixes #128380.
2005-02-20 22:44:15 +00:00
Elijah Newren
79f2b91679 Ignore all focus and focus-stealing-prevention code in meta_window_show
2005-02-20  Elijah Newren  <newren@gmail.com>

	* src/window.c (meta_window_show): Ignore all focus and
	focus-stealing-prevention code in meta_window_show when not
	showing the window for the first time.  Fixes #167199.
2005-02-20 22:40:08 +00:00
Elijah Newren
50312dd0e8 Big patch to cover about 6 different issues in order to correct rare
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-20 17:14:16 +00:00
Elijah Newren
0488efc8c1 Raise the ancestor of a window instead of the window itself. Fixes
2005-02-12  Elijah Newren  <newren@gmail.com>

	Raise the ancestor of a window instead of the window itself.
	Fixes #166894.

	* src/window.c: (find_root_ancestor): new function,
	(meta_window_raise): get the ancestor of the given window and
	raise it if possible instead of the window
2005-02-12 07:34:30 +00:00
Elijah Newren
9fa5c1d4b9 Don't unconditionally place splashscreens (and other not-to-befocused
2005-02-12  Elijah Newren  <newren@gmail.com>

	Don't unconditionally place splashscreens (and other
	not-to-befocused windows) below the focus window.  Fixes #167042.

	* src/window.c: (intervening_user_event_occurred): new function
	taken from the timestamp comparison portion of the old
	window_takes_focus_on_map function, (window_state_on_map): new
	function with remainder of old window_takes_focus_on_map function
	that determines both whether the window will take focus and
	whether it should be placed on top, (meta_window_show): use
	place_on_top_on_map to determine window stacking instead of trying
	to infer it from takes_focus_on_map
2005-02-12 07:19:41 +00:00
Elijah Newren
d31a0829be Avoid new windows being obscured by the focus window (and thus possibly
2005-02-11  Elijah Newren  <newren@gmail.com>

	Avoid new windows being obscured by the focus window (and thus
	possibly lost).  Fixes #166524.

	* src/place.c: new MetaWindowDirection enum,
	(find_most_freespace): new function to find where there is the
	most space available around the focused window,
	(meta_window_place): if a window is denied focus and the window
	overlaps the focused window, retry the first-fit algorithm only
	paying attention to the focus window position and if that fails
	just find the location on the screen with the most space
	available.

	* src/window.h: (struct MetaWindow): new
	denied_focus_and_not_transient bitfield

	* src/window.c: (meta_window_new_with_attrs): initialize
	denied_focus_and_not_transient, (meta_window_show): set and unset
	the denied_focus_and_not_transient field appropriately
2005-02-11 19:20:44 +00:00
Elijah Newren
fe1416c65f Avoid using CurrentTime when focusing, handle it better in case we miss
2005-02-08  Elijah Newren  <newren@gmail.com>

	Avoid using CurrentTime when focusing, handle it better in case we
	miss any cases.  Fixes #166732.

	* src/window.c: (meta_window_shade): use
	meta_display_get_current_time_roundtrip() to ensure we have a
	valid timestamp, (meta_window_unshade): same

	* src/display.c: (meta_display_set_input_focus_window): If
	CurrentTime was passed, get one from the XServer in addition to
	throwing a warning, (meta_display_focus_the_no_focus_window): same
2005-02-09 03:18:46 +00:00
Elijah Newren
454e595ef8 If we're not passed a timestamp, make sure to manually get one. Fixes
2005-02-08  Elijah Newren  <newren@gmail.com>

	* src/window.c: (meta_window_activate): If we're not passed a
	timestamp, make sure to manually get one.  Fixes #166728.
2005-02-09 03:15:11 +00:00
Elijah Newren
459c6668fb Ignore xconfigurerequest events for stacking when it should be safe to do
2005-02-06  Elijah Newren  <newren@gmail.com>

	Ignore xconfigurerequest events for stacking when it should be
	safe to do so.  Again, thanks to Crispin Flowerday for the test
	case.  Thanks to KWin for the inspiration (and to Google for
	indexing their source code).  Fixes the other half of #166395.

	* src/window.c: (meta_window_configure_request): if the
	active_window is from a separate application than the one getting
	the configure request and the net_wm_user_time of the active
	window is later than that of the window getting the configure
	request, then ignore the request.
2005-02-06 17:01:41 +00:00
Elijah Newren
d11681e505 If activation requests are too old, set the demands_attention hint instead
2005-02-06  Elijah Newren  <newren@gmail.com>

	If activation requests are too old, set the demands_attention hint
	instead of actually activating.  Thanks to Crispin Flowerday for
	the test case and for testing the patch.  Fixes half of #166395.

	* src/window.c: (meta_window_activate): if the request came before
	the last focus time, set the demands attention hint instead
2005-02-06 16:52:26 +00:00
Elijah Newren
84312194e8 Make sure window->border_only is initialized so we don't get random
2005-02-04  Elijah Newren  <newren@gmail.com>

	Make sure window->border_only is initialized so we don't get
	random windows without decorations.  Thanks to Sinisa Segvic and
	Owen Taylor for providing test cases.  Fixes #145131.

	* src/window.c: (update_mwm_hints): Be sure to call
	recalc_window_features even if no MWM hints are set
2005-02-05 03:02:42 +00:00
Elijah Newren
51bbd0e1a8 Correct the stacking when return from fullscreen mode. Fixes #165718.
2005-01-31  Elijah Newren  <newren@gmail.com>

	Correct the stacking when return from fullscreen mode.  Fixes
	#165718.

	* src/window.c: (meta_window_unmake_fullscreen): Update the layer
	after resizing the window
2005-01-31 16:49:23 +00:00