1
0
Fork 0
Commit graph

34 commits

Author SHA1 Message Date
Rob Adams
010e620a34 Revamp placement policy for windows that are maximized when they are
2003-06-09  Rob Adams  <robadams@ucla.edu>

	Revamp placement policy for windows that are maximized when they
	are mapped, including windows that set a hint to be maximized or
	windows that are auto-maximized using our heuristic.  See #111902.

	* src/window.h: add new flag maximize_after_placement and new
	function meta_window_maximize_internal.

	* src/window.c (meta_window_new): initialize
	maximize_after_placement to FALSE and remove the automaximize
	heuristic.
	(meta_window_maximize_internal): new function accepts a saved_rect
	argument to be used as the new saved_rect for the window, and does
	not queue a move_resize.
	(meta_window_maximize): re-implement using
	meta_window_maximize_internal.
	(update_net_wm_state): If a window has a maximize hint set on
	startup set maximize_after_placement to TRUE

	* src/constraints.c (meta_window_constrain): Update the xinerama
	information in the ConstraintInfo after placing the window, and
	maximize the window after placement if
	window->maximize_after_placement

	* src/place.c (find_first_fit): take a natural xinerama list as an
	argument instead of generating it here
	(constrain_placement): remove function, since it is no longer
	needed
	(meta_window_place): generate the natural xinerama list here and
	pass it into find_first_fit.  If find_first_fit fails, use the
	list to find empty xineramas where we can place windows that may
	be maximized later.  This makes maximized windows follow the
	correct placement policy.  Move the automaximize heuristic here.
2003-06-09 23:49:02 +00:00
Rob Adams
7c5e40e0ea cascade on xinerama with pointer instead of on first xinerama.
2003-04-06  Rob Adams  <robadams@ucla.edu>

	* src/place.c (find_next_cascade): cascade on xinerama with
	pointer instead of on first xinerama.
2003-04-07 03:33:45 +00:00
Rob Adams
9bd17f4fae Update placement policy for screen with multiple xineramas. Windows will
2003-04-05  Rob Adams  <robadams@ucla.edu>

	Update placement policy for screen with multiple xineramas.
	Windows will be placed preferentially on the xinerama with the
	pointer, and progressively further away as needed to find a place
	where the window does not overlap other windows.

	* src/place.c (rect_fits_in_work_area): function
	fit_rect_in_xinerama greatly simplified to work with new placement
	policy.
	(find_first_fit): implement new first first placement scheme

	* src/screen.c (meta_screen_get_xinerama_neighbor): look for an
	xinerama in the xinerama list that is adjacent to the specified
	xinerama.
	(meta_screen_get_natural_xinerama_list): return a list of
	xineramas in the order to be preferred by the placement algorithm
	as determined by the current location of the pointer.

	* src/screen.h: add function prototypes and an enum used by
	meta_screen_get_xinerama_neighbor.
2003-04-06 05:57:36 +00:00
Rob Adams
40ec58787f Fix a minor off-by-one error. See #110079.
2003-04-05  Rob Adams  <robadams@ucla.edu>

	* src/place.c (center_tile_rect_in_area):  Fix a minor off-by-one
	error.  See #110079.
2003-04-06 01:22:56 +00:00
Havoc Pennington
c27d89218c Patch from Rob Adams addresses #95014 (placement issues), makes first fit
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-02-23 17:09:46 +00:00
Havoc Pennington
ba9d2d1a71 try extra cascades alongside the first, if the first fails; patch from
2002-10-01  Havoc Pennington  <hp@pobox.com>

	* src/place.c (find_next_cascade): try extra cascades alongside
	the first, if the first fails; patch from readams@hmc.edu
2002-10-02 02:42:24 +00:00
Havoc Pennington
efc82ee1b9 constrain placement to try to keep windows from going offscreen to the
2002-09-27  Havoc Pennington  <hp@pobox.com>

	* src/place.c (constrain_placement): constrain placement to try to
	keep windows from going offscreen to the right/bottom

	* src/stack.c (compute_layer): rearrange the logic here to say
	that a window must always be in at least as high a layer as any of
	its transient parents or group members, rather than special-casing
	fullscreen. Also, group_member_is_fullscreen was leaking the list
	of group members every time, a fairly major memory leak.
2002-09-28 03:11:04 +00:00
Havoc Pennington
f5f20efe0d update best_overlap as we go through the loop - doh. Fix from
2002-09-24  Havoc Pennington  <hp@pobox.com>

	* src/place.c (fit_rect_in_xinerama): update best_overlap as we go
	through the loop - doh. Fix from readams@hmc.edu for #90799.
	(find_first_fit): try the origin of each xinerama screen
	after the first. Also from readams@hmc.edu
2002-09-25 01:20:44 +00:00
Havoc Pennington
cfa98e02fc fix compiler warnings
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-09-12 20:46:03 +00:00
Havoc Pennington
b908e45208 try to maximize windows that are too big for the work area
2002-07-12  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new): try to maximize windows that
	are too big for the work area

	* src/place.c (find_next_cascade): don't let the cascade algorithm
	place windows off the screen, and fix it to always exhaustively
	search the window list for cascade parents.
2002-07-12 23:03:40 +00:00
Havoc Pennington
e51e7ab77a increase the cascade threshold a bit. (find_first_fit): implement a
2002-06-17  Havoc Pennington  <hp@pobox.com>

	* src/place.c (find_next_cascade): increase the cascade threshold
	a bit.
	(find_first_fit): implement a somewhat lame first fit algorithm
2002-06-18 03:06:07 +00:00
Havoc Pennington
8057a2f68a don't run constrain_placement on windows we allow to go anywhere (docks,
2002-06-09  Havoc Pennington  <hp@pobox.com>

	* src/place.c (meta_window_place): don't run constrain_placement
	on windows we allow to go anywhere (docks, etc.). Fixes
	positioning of panel windows in certain cases.
2002-06-09 18:17:02 +00:00
Havoc Pennington
e694f07144 Yeah I know maximization is broken, I'm too tired to fix it. Probably
2002-06-08  Havoc Pennington  <hp@pobox.com>

        Yeah I know maximization is broken, I'm too tired to fix it.
	Probably because of the change to update_struts() that was
	supposed to fix the 100% CPU bug.

	* src/place.c (meta_window_place): don't run docks and things
	through the placement algorithm. Thought it might fix
	metacity-window-demo but it didn't.

	* src/window.c (constrain_size): only get work area when needed
	(meta_window_new): init the do_not_cover field
2002-06-08 06:29:19 +00:00
Havoc Pennington
2b780e5486 short-circuit the "only one xinerama" case, and use outer rect of window
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-06-08 06:07:21 +00:00
Havoc Pennington
a7c8cea1b5 implement
2002-06-06  Havoc Pennington  <hp@pobox.com>

	* src/screen.c (meta_screen_get_current_xinerama): implement

	* src/place.c (meta_window_place): cascade windows on the active
	Xinerama screen

	* src/window.c (meta_window_move_resize_internal): strip out the
	#if 0 cruft about guessing fullscreen mode
	(constrain_position, constrain_size): fullscreen/maximize to the
	Xinerama head, not the whole screen
	(meta_window_get_work_area): autocreate struts at the Xinerama
	physical screen edges for the screen the window is on.

	* src/screen.c (meta_screen_get_xinerama_for_window): someone
	snuck in a for loop, fix it. ;-)
2002-06-07 03:18:46 +00:00
Anders Carlsson
d466c615ed Take Xinerama screen edges into consideration.
2002-05-25  Anders Carlsson  <andersca@gnu.org>

	* src/place.c: (get_vertical_edges), (get_horizontal_edges):
	Take Xinerama screen edges into consideration.

	* src/screen.c: (meta_rectangle_intersect),
	(meta_screen_get_xinerama_for_window):
	* src/screen.h:
	Add a new function that returns the xinerama monitor that
	a window is on.
2002-05-25 16:30:14 +00:00
Havoc Pennington
5151c5102d move pposition/usposition honoring code into here, instead of putting it
2002-05-12  Havoc Pennington  <hp@pobox.com>

	* src/place.c (meta_window_place): move pposition/usposition
	honoring code into here, instead of putting it in window.c.
	Makes focusing new windows work, and cleans things up a bit.
	#81585
2002-05-13 00:03:17 +00:00
Havoc Pennington
41120f2a79 on unminimize, queue calc_showing on all transients
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-05-05 05:41:13 +00:00
Havoc Pennington
03481ae2d0 don't try to decorate toolbars.
2002-04-30  Havoc Pennington  <hp@pobox.com>

	* src/window.c (recalc_window_features): don't try to decorate
	toolbars.

	* src/tools/metacity-window-demo.c: add menu and toolbar tests

	* src/place.c (meta_window_place): only dialogs should be centered
	over parent, not anything with transient for set.

	* src/window.c (meta_window_configure_request): become more
	fascist about window positioning if workarounds are disabled, and
	less fascist if they are enabled.

	* src/metacity.schemas: add a "disable_workarounds" option.  Kind
	of crack-smoking. But we just can't get all applications
	fixed. And I need no-workarounds mode to monitor which apps are
	broken and what needs fixing in specs.

	* src/window.c (meta_window_configure_request): always allow
	windows to resize themselves

	* src/keybindings.c (reload_modmap): don't filter out Mode_switch,
	apparently some people bind window manager shortcuts to that.
2002-05-01 03:23:46 +00:00
Havoc Pennington
116fc5546f put in some kind of distinctive frame for UTILITY, though it's ugly. Also
2002-02-09  Havoc Pennington  <hp@pobox.com>

	* src/themes/Atlanta/metacity-theme-1.xml: put in some kind of
	distinctive frame for UTILITY, though it's ugly. Also put in the
	borderless look for maximized windows.

	* src/stack.c (compute_layer): put splash screen in the splash
	layer

	* src/stack.h (enum): create a splash screen layer

	* src/place.c (meta_window_place): center splashscreen, and fix a
	typo in the centering code

	* src/window.c (recalc_window_features): disable most features on
	splash screens

	* src/screen.c (set_supported_hint): add UTILITY and SPLASHSCREEN
	hints

	* src/window.c: add UTILITY, SPLASHSCREEN implementation

	* src/window.h (enum): add UTILITY, SPLASHSCREEN types

	* src/theme-parser.c (parse_toplevel_element): parser support
	for has_title attribute

	* src/theme.c (meta_frame_layout_get_borders): handle a has_title
	field in the layout, for utility windows that don't display a
	title (would be better to be able to shrink the title text,
	but that's kind of tricky to implement :-/)
2002-02-09 06:54:44 +00:00
Havoc Pennington
d91715dc8f Throughout: move to meta_topic rather than meta_verbose so metacity.log
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-02-08 03:34:26 +00:00
Havoc Pennington
b2bbb306f4 store strut information, update it on property changes, etc. etc. so we
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-10 06:31:31 +00:00
Havoc Pennington
ff5315d551 handle queue/unqueue of calc showings as we are iterating over the pending
2001-10-29  Havoc Pennington  <hp@pobox.com>

	* src/window.c (idle_calc_showing): handle queue/unqueue of
	calc showings as we are iterating over the pending list
	(meta_window_show): focus placed transients in here instead
	of in meta_window_place - now it should actually work, yay

	* src/place.c (meta_window_place): remove focusing of transient
	child from here; this was really broken
2001-10-30 02:00:53 +00:00
Havoc Pennington
d080f816b6 I was using meta_workspace_contains_window() in a number of places where
2001-10-25  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_visible_on_workspace):
	I was using meta_workspace_contains_window() in a number of
	places where on_all_workspaces should also have been considered,
	thus this new function. Fixes bugs such as pinned windows
	not appearing in the tab order.
	(meta_window_client_message): use meta_window_visible_on_workspace

	* src/stack.c (find_tab_forward): ditto
	(find_tab_backward): ditto
	(meta_stack_get_tab_next): ditto
	(meta_stack_get_tab_list): ditto

	* src/place.c (get_windows_on_same_workspace): ditto

	* src/keybindings.c (handle_focus_previous): ditto
	(handle_focus_previous): ditto
2001-10-25 04:51:25 +00:00
Havoc Pennington
936adc6ea5 don't use gdk_display_name
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.
2001-09-09 03:44:42 +00:00
Havoc Pennington
3e1c68b88a avoid focusing a window on tab popup popdown
2001-08-29  Havoc Pennington  <hp@pobox.com>

	* src/display.c (event_callback): avoid focusing a window on tab
	popup popdown

	* src/screen.c (meta_screen_ensure_tab_popup): compute frame
	outline size here
2001-08-30 04:01:38 +00:00
rhp
b1d438922a ... 2001-07-28 06:35:19 +00:00
rhp
c18a8137ce ... 2001-07-26 03:58:24 +00:00
rhp
93b7bd2c81 ... 2001-07-12 05:53:56 +00:00
rhp
73b7323d84 ... 2001-07-04 04:33:31 +00:00
rhp
ec00c9852d ... 2001-07-04 02:10:54 +00:00
rhp
3650c23055 ... 2001-07-03 18:37:18 +00:00
rhp
bca589280c ... 2001-06-24 08:09:10 +00:00
rhp
8025ecea02 ... 2001-06-24 06:47:54 +00:00