Compare commits

..

188 Commits

Author SHA1 Message Date
Havoc Pennington
f64a231620 2.5.1
2003-05-03  Havoc Pennington  <hp@pobox.com>

	* configure.in: 2.5.1

	* NEWS: update
2003-05-03 16:37:24 +00:00
Rob Adams
a8f9e2e919 Don't apply onscreen constraints to full screen windows. Fix for #110048
2003-05-01  Rob Adams  <robadams@ucla.edu>

	* src/constraints.c (constraint_onscreen_applies_func): Don't
	apply onscreen constraints to full screen windows.  Fix for
	#110048
2003-05-02 07:32:02 +00:00
Havoc Pennington
9569096991 include Xlib.h before XKBlib.h which is required on Solaris. #111877 from
2003-04-29  Havoc Pennington  <hp@redhat.com>

	* src/bell.h: include Xlib.h before XKBlib.h which is required on
	Solaris. #111877 from Peter O'Shea
2003-04-29 22:07:47 +00:00
Miloslav Trmac
2722c277ee Update Czech translation 2003-04-29 18:04:55 +00:00
Keith Packard
2eec8daff5 Initialize size_hints on window creation using code shared with size_hints property reload 2003-04-26 17:40:32 +00:00
Havoc Pennington
75fa56391d support diagonal keypad keybindings, from Dafydd Harries
2003-04-23  Havoc Pennington  <hp@pobox.com>

	* src/keybindings.c (process_keyboard_move_grab): support
	diagonal keypad keybindings, from Dafydd Harries
2003-04-25 03:32:41 +00:00
Havoc Pennington
ec9cf27a81 purge HAVE_GTK_MULTIHEAD from the source code, not just from configure.in.
2003-04-21  Havoc Pennington  <hp@redhat.com>

	* purge HAVE_GTK_MULTIHEAD from the source code, not just from
	configure.in. Yes I am a loser.
2003-04-21 23:37:42 +00:00
Masahiro Sakai
0996da5e8e call AC_LIBTOOL_WIN32_DLL.
* configure.in: call AC_LIBTOOL_WIN32_DLL.

* src/Makefile.am: add -no-undefined to libmetacity_private_la_LDFLAGS
and write dependency libraries in libmetacity_private_la_LIBADD.
2003-04-19 07:19:04 +00:00
Dmitry Mastrukov
a8708e1c55 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-04-15 04:16:46 +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
e1d2b95459 Fix typo in ChangeLog entry.
2003-04-05  Rob Adams <robadams@ucla.edu>

	Fix typo in ChangeLog entry.
2003-04-06 05:59:25 +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
Christophe Merlet
304fae9369 Updated French translation. 2003-04-03 21:15:09 +00:00
Rob Adams
72a7f57e5d When passing frame geometry to meta_window_constrain, send null if no
2003-03-30  Rob Adams  <robadams@ucla.edu>

	* src/window.c (meta_window_move_resize_internal): When passing
	frame geometry to meta_window_constrain, send null if no frame.
	Possible fix for #109039.
2003-03-30 10:52:07 +00:00
Havoc Pennington
0fee2ac499 add --noframes option for testing, showing how broken we currently are.
2003-03-29  Havoc Pennington  <hp@pobox.com>

	* src/wm-tester/test-gravity.c (main): add --noframes option for
	testing, showing how broken we currently are.
2003-03-29 20:04:19 +00:00
Soeren Sandmann
708a86cfee Only cap refresh rate when not using SYNC. Remove bogus
Fri Mar 28 14:13:37 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* src/window.c (update_resize): Only cap refresh rate when not
	using SYNC. Remove bogus update-if-we-moved-more-than-a-delta.

	* src/window.c (update_move): Don't cap refresh rate during
	moves. Remove bogus update-if-we-moved-more-than-a-delta.
2003-03-28 13:11:24 +00:00
Havoc Pennington
04fcad7c13 2.5.0 2003-03-27 02:27:40 +00:00
Christophe Merlet
ebbc4c499b Updated French translation. 2003-03-27 00:30:14 +00:00
Soeren Sandmann
3c8b051e31 just return if we are not verbose.
Sun Mar 23 23:04:06 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* src/display.c (meta_spew_event): just return if we are not
	verbose.
2003-03-23 21:54:48 +00:00
Havoc Pennington
d34e54785d Should fix #108108, #106217, tracked down by Owen Taylor and Frederic
2003-03-11  Havoc Pennington  <hp@pobox.com>

	Should fix #108108, #106217, tracked down by Owen Taylor and
	Frederic Crozat

	* src/window.c (meta_window_foreach_transient): change
	MetaWindowForeachFunc to return a boolean for whether to continue
	(meta_window_foreach_ancestor): new function
	(window_should_be_showing): use meta_window_foreach_ancestor
	(unminimize_window_and_all_transient_parents): ditto
	(update_sm_hints): ditto
	(meta_window_is_ancestor_of_transient): ditto

	* src/stack.c (get_maximum_layer_of_ancestor): use
	meta_window_foreach_ancestor
2003-03-17 06:36:39 +00:00
Rob Adams
51e74d4027 Free old window menu if it already exists so we don't end up with more
2003-03-16  Rob Adams <robadams@ucla.edu>

	* window.c (meta_window_show_menu): Free old window menu if it
	already exists so we don't end up with more than one.  Fix for
	#108392.
2003-03-17 01:19:07 +00:00
Rob Adams
2d662f67a5 Don't try to force a window onscreen by more than its width. Fix for
2003-03-14  Rob Adams <robadams@ucla.edu>

	* contraints.c (get_outermost_screen_positions): Don't try to
	force a window onscreen by more than its width.  Fix for #94815.
2003-03-16 00:13:58 +00:00
Rob Adams
67cbbeb6c1 Make it so that the alt-tabbing won't try to go to a minimized window by
2003-03-13  Rob Adams <robadams@ucla.edu>

        Make it so that the alt-tabbing won't try to go to a minimized
	window by default.  Fix for #107071.

	* display.c (meta_display_get_tab_list): use a GList instead of a
	GSList
	(meta_display_get_tab_next): use meta_display_get_tab_list to
	decide what the next/previous tab window should be.

	* display.h (meta_display_get_tab_list): update function prototype
	to return GList instead of GSList.

	* screen.c (meta_screen_ensure_tab_popup): update function to deal
	with GList returned by meta_display_get_tab_list instead of GSList.
2003-03-15 02:16:21 +00:00
Rob Adams
cc7493cac9 resolve a merge conflict 2003-03-15 02:12:02 +00:00
Christian Rose
be96be95f6 Added "ml" to ALL_LINGUAS. Added Malayalam translation by FSF-India
2003-03-13  Christian Rose  <menthos@menthos.com>

	* configure.in: Added "ml" to ALL_LINGUAS.
	* po/ml.po: Added Malayalam translation by
	FSF-India <locale@gnu.org.in>.
2003-03-13 13:44:09 +00:00
Paul Duffy
6b144cd2eb Added "ga" to ALL_LINGUAS line in configure.in 2003-03-12 14:28:44 +00:00
Paul Duffy
38412b4460 Added Irish Translation (ga.po) 2003-03-12 14:27:26 +00:00
Rob Adams
b8287d3aca include left frame geometry when maximizing or fullscreening windows. Fix
2003-03-11  Rob Adams <robadams@ucla.edu>

	* src/constraints.c (meta_window_constrain): include left frame
	geometry when maximizing or fullscreening windows.  Fix for
	#108127.
2003-03-12 05:08:29 +00:00
Rob Adams
5eb4eea57e include left frame geometry when maximizing or fullscreening windows. Fix
2003-03-11  Rob Adams <robadams@ucla.edu>

	* src/constraints.c (meta_window_constrain): include left frame
	geometry when maximizing or fullscreening windows.  Fix for
	#108127.
2003-03-12 03:56:01 +00:00
Roozbeh Pournader
af3b5b77b1 Added "fa" to ALL_LINGUAS. Added Persian translation.
2003-03-10  Roozbeh Pournader  <roozbeh@sharif.edu>

	* configure.in: Added "fa" to ALL_LINGUAS.
	* po/fa.po: Added Persian translation.
2003-03-10 08:32:03 +00:00
Havoc Pennington
5f75334d57 Switch over to new constraints code, unquestionably introduces some bugs,
2003-02-27  Havoc Pennington  <hp@redhat.com>

	Switch over to new constraints code, unquestionably introduces
	some bugs, but should get us on the right path.

	* src/window.c (meta_window_get_work_area_all_xineramas): create
	this function again as it turned out to be legitimate for window
	position constraint
	(adjust_for_gravity): use the width/height from the configure
	request to compute the requested move
	(meta_window_move_resize_internal): use meta_window_constrain
	(update_size_hints): clamp max size to MAXSHORT to avoid worrying
	about overflow stuff

	* src/constraints.c (meta_window_constrain): don't base placement
	on uninitialized variables, general hacking

	* src/Makefile.am (metacity_SOURCES): add constraints.c,
	constraints.h

	* src/constraints.c (meta_window_constrain): update the
	cut-and-paste aspect ratio code to have latest bugfixes
2003-03-08 23:43:17 +00:00
Rob Adams
4481be72d1 Check that window min and max size hints are at least 1. Fix for #107110.
2003-03-08  Rob Adams <robadams@ucla.edu>

	* src/window-props.c (reload_normal_hints):  Check that window min
	and max size hints are at least 1.  Fix for #107110.
2003-03-08 18:15:22 +00:00
Havoc Pennington
c595a7ac0f fix changelog 2003-02-28 01:26:37 +00:00
Havoc Pennington
fa3de81741 add more debug spew about conditional build stuff (main): panic to
2003-02-27  Havoc Pennington  <hp@pobox.com>

	* src/main.c (main): add more debug spew about conditional
	build stuff
	(main): panic to "Simple" theme

	* src/window.c, src/window-props.c: move WM_NORMAL_HINTS and
	WM_PROTOCOLS to new property system; don't queue move resize on
	updating WM_PROTOCOLS; move WM_HINTS to new property system;
	reload icon in an idle handler.

	Changes made on plane from FOSDEM, syncing from laptop.
2003-02-28 01:24:44 +00:00
Mark McLoughlin
6094763def Give me back my keys.
2003-02-28  Mark McLoughlin  <mark@skynet.ie>

        Give me back my keys.

        * src/keybindings.c: (meta_window_grab_keys): don't
        grab keys on DOCK windows.

        * src/window.c: (recalc_window_type): re-grab the
        keys.
2003-02-27 22:44:36 +00:00
Dmitry Mastrukov
4e96dd7ea6 configure.in: Added Belarusian to ALL_LINGUAS. 2003-02-26 05:14:43 +00:00
Dmitry Mastrukov
6e6e85632a be.po: Added Belarusian translation from Belarusian team <i18n@infonet.by> 2003-02-26 05:13:07 +00:00
Mark McLoughlin
6af9a11361 release the keyboard grab before sending the action message to the panel.
2003-02-26  Mark McLoughlin  <mark@skynet.ie>

        * src/keybindings.c: (handle_panel_keybinding): release
        the keyboard grab before sending the action message to
        the panel.
2003-02-26 01:55:25 +00:00
Pablo Gonzalo del Campo
8377c7776c Fixed a translation string to match with libwnck.
2003-02-25  Pablo Gonzalo del Campo <pablodc@bigfoot.com>

	* es.po: Fixed a translation string to match with libwnck.
2003-02-25 18:04:00 +00:00
Mark McLoughlin
73cce3b174 Take control of the panel's global keybindings. The screenshot utility is
2003-02-24  Mark McLoughlin  <mark@skynet.ie>

        Take control of the panel's global keybindings. The
        screenshot utility is hooked up using a special case
        run_command and the menu and run dialog bindings are
        done using the _GNOME_PANEL_ACTION ClientMessage
        protocol.

        * src/display.[ch]: (meta_display_open): add some atoms.

        * src/keybindings.c:
        (handle_panel_keybinding): impl to handle a keybinding
        by sending an action message to the panel.

        * src/metacity.schemas.in: add schemas for the panel and
        screenshot keybindings and the screenshot commands.

        * src/prefs.[ch]: (update_command),
        (meta_prefs_get_gconf_key_for_command): impl special case
        handling for the screenshot commands. They are stored at
        the the end of the commands array but have named keys.
2003-02-24 02:16:09 +00:00
Rob Adams
947adb6d07 change toggle_maximized to toggle_maximize and toggle_shaded to
2003-02-22  Rob Adams <robadams@ucla.edu>

	* *.po: change toggle_maximized to toggle_maximize and
	toggle_shaded to toggle_shade in action_double_click_titlebar long
	description to match the values used by metacity
2003-02-23 19:24:56 +00:00
Rob Adams
d0f1f084e8 change toggle_maximized to toggle_maximize and toggle_shaded to
2003-02-22  Rob Adams <robadams@ucla.edu>

	* src/metacity.schemas.in: change toggle_maximized to
	toggle_maximize and toggle_shaded to toggle_shade in
	action_double_click_titlebar long description to match the values
	used by metacity

	* po/*.po: change toggle_maximized to toggle_maximize and
	toggle_shaded to toggle_shade in action_double_click_titlebar long
	description to match the values used by metacity
2003-02-23 19:21:10 +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
Rob Adams
15c5ddbec4 change toggle_maximized to toggle_maximize and toggle_shaded to
2003-02-22  Rob Adams <robadams@ucla.edu>

	* src/metacity.schemas.in: change toggle_maximized to
	toggle_maximize and toggle_shaded to toggle_shade in
	action_double_click_titlebar long description to match the values
	used by metacity

	* po/*.po: change toggle_maximized to toggle_maximize and
	toggle_shaded to toggle_shade in action_double_click_titlebar long
	description to match the values used by metacity
2003-02-23 05:18:37 +00:00
Rob Adams
546679cbd1 modify comment to explain why the icon window element is set to None. Fix
2003-02-22  Rob Adams <robadams@ucla.edu>

	* window.c (set_wm_state): modify comment to explain why the icon
	window element is set to None.  Fix for #97357 thanks to Gregory
	Merchan.
2003-02-23 04:56:11 +00:00
Havoc Pennington
b54c422b93 fix a typo, pointed out by Steve Kemp
2003-02-22  Havoc Pennington  <hp@pobox.com>

        * README: fix a typo, pointed out by Steve Kemp
2003-02-23 03:30:48 +00:00
Havoc Pennington
5049fdc13a add system modal dialogs bug to rationales.txt 2003-02-22 22:51:30 +00:00
Havoc Pennington
d8bb7c8ae9 add "configure alt+click" etc. bug 2003-02-22 22:47:15 +00:00
Havoc Pennington
61d5423b5d change max workspaces to 36 #81855
2003-02-22  Havoc Pennington  <hp@pobox.com>

	* src/prefs.c (MAX_REASONABLE_WORKSPACES): change max workspaces
	to 36 #81855
2003-02-22 22:43:13 +00:00
Havoc Pennington
d85012ecfd fix to unfocus window only when you leave the window frame, not when you
2003-02-22  Havoc Pennington  <hp@pobox.com>

	* src/display.c (event_callback): fix to unfocus window only when
	you leave the window frame, not when you leave the window itself,
	unless window has no frame. #100248 fix from Orien Vandenbergh
2003-02-22 22:19:19 +00:00
Havoc Pennington
fb9ad1eb13 when tabbing backward, we are still tabbing *from* the most recently used
2003-02-22  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_get_tab_next): when tabbing
	backward, we are still tabbing *from* the most recently used
	window, not from the least recently used window.

	* src/keybindings.c (struct _MetaKeyBinding): make keycode
	unsigned to match XEvent

	Patch for #84999 based on patch from Mark McLoughlin

	* src/prefs.c: add an add_shift field to MetaKeyPref to
	add shift when grabbing the given keybinding.

	* src/keybindings.c (rebuild_screen_binding_table)
	(rebuild_window_binding_table): refactor to share code,
	and honor add_shift field in MetaKeyPref
2003-02-22 20:31:51 +00:00
Havoc Pennington
8764b89942 add window size/position popup 2003-02-21 20:21:38 +00:00
Havoc Pennington
48bc82e82f don't create constraints between windows on different screens, #106086
2003-02-20  Havoc Pennington  <hp@redhat.com>

	* src/stack.c (create_constraints): don't create constraints
	between windows on different screens, #106086 tracked down
	by Arvind
2003-02-21 17:51:48 +00:00
Arvind Samptur
e8d63890fc add bug to keep dialogs above entire app group. 2003-02-17 06:12:02 +00:00
Arvind Samptur
6ed08019c2 A small writeup on how to use dialogs in metacity. Approved by Havoc. 2003-02-17 05:00:40 +00:00
Arvind Samptur
00d6f549f9 : Update the workspace names from gconf and set the NET_DESKTOP_NAMES
2003-02-14  Arvind Samptur <arvind.samptur@wipro.com>
        * src/screen.c: (meta_screen_new) : Update the workspace
        names from gconf and set the NET_DESKTOP_NAMES atom.
        Renamed update_workspace_names() to set_workspace_names().
        Fixes #105498
2003-02-14 07:03:46 +00:00
Havoc Pennington
02a491c1bc require GTK+ 2.2.0
2003-02-13  Havoc Pennington  <hp@redhat.com>

	* configure.in: require GTK+ 2.2.0

	* src/ui.c (meta_ui_init): remove hackaround for Pango X core
	fonts backend
2003-02-13 23:16:49 +00:00
Christian Rose
ed25155fc1 Some fixes for problems catched in translation review.
2003-02-12  Christian Rose  <menthos@menthos.com>

	* sv.po: Some fixes for problems catched in translation review.
2003-02-11 23:24:07 +00:00
Fatih Demir
e65a70ded9 Heh 2003-02-10 23:36:34 +00:00
Fatih Demir
3b49b81ff5 Update. branch 2003-02-09 17:01:12 +00:00
Fatih Demir
bdcc6cb20d Updated 2003-02-08 21:37:11 +00:00
Kwok-Koon Cheung
e616f930d3 add missing ALL_LINGUAS 2003-02-05 15:11:46 +00:00
Abel Cheung
536d51183c Fix header. Fix positional parameters.
2003-02-05  Abel Cheung  <maddog@linux.org.hk>

	* en_GB.po: Fix header.
	* ko.po, pt_BR.po: Fix positional parameters.
2003-02-05 15:10:26 +00:00
Abel Cheung
6a3c1fbe57 Updated traditional Chinese translation.
2003-02-05  Abel Cheung  <maddog@linux.org.hk>

	* zh_TW.po: Updated traditional Chinese translation.
2003-02-05 15:06:40 +00:00
Yuri Syrota
2cca0f0eac Updated Ukrainian translation 2003-02-05 08:09:20 +00:00
Akira TAGOH
cdb4e2541c fix a typo and missing option. (#105186)
2003-02-05  Akira TAGOH  <tagoh@gnome.gr.jp>

	* src/main.c (usage): fix a typo and missing option. (#105186)
2003-02-05 04:56:19 +00:00
Havoc Pennington
9b03b75aaf nuke subdir ChangeLog, there can be only one true ChangeLog.
2003-02-04  Havoc Pennington  <hp@redhat.com>

	* src/themes/Simple/ChangeLog: nuke subdir ChangeLog,
	there can be only one true ChangeLog.

2003-01-30  Havoc Pennington  <hp@redhat.com>

	* src/keybindings.c (process_event): match handlers to key events
	using key codes, not key syms
2003-02-05 03:58:17 +00:00
Daniel Yacob
f5072b7f3a Updating Amharic translation. 2003-02-03 17:40:01 +00:00
Jonathan Blandford
b60bb724aa add Simple to the list of themes.
Thu Jan 30 22:55:16 2003  Jonathan Blandford  <jrb@redhat.com>

	* src/themes/Makefile.am (THEMES): add Simple to the list of
	themes.

	* src/metacity.schemas.in: change default theme to Simple.
2003-01-31 03:57:01 +00:00
Seth Nickell
7d7f8aab93 Change name in theme file to "Simple".
2003-01-30  Seth Nickell  <snickell@stanford.edu>

	* metacity-theme-1.xml:

	Change name in theme file to "Simple".
2003-01-31 03:44:05 +00:00
Marius Andreiana
3b133195fd updated ( thanks to Mugurel Tudor )
2003-01-30  Marius Andreiana <marius galuna.ro>

	* ro.po: updated ( thanks to Mugurel Tudor )
2003-01-30 12:38:14 +00:00
Havoc Pennington
18990530b0 don't create workspaces menu items if only 1 workspace. Fix for #101952
2003-01-29  Havoc Pennington  <hp@pobox.com>

	* src/menu.c (meta_window_menu_new): don't create workspaces
	menu items if only 1 workspace. Fix for #101952 from
	Orien Vandenbergh
2003-01-29 05:22:19 +00:00
Bill Haneman
b424364710 Reinstated visual-bell patch, fix for bug 99886. 2003-01-28 15:07:43 +00:00
Christophe Merlet
4fb05e54ab Updated French translation. 2003-01-25 22:04:53 +00:00
Christophe Merlet
3ee5ad8b12 Updated french translation. 2003-01-25 21:57:01 +00:00
Havoc Pennington
b73ea5eb0a When checking if a window is fullscreen size, only require it to be at the
2003-01-25  Havoc Pennington  <hp@pobox.com>

	* src/stack.c (window_is_fullscreen_size): When checking if a
	window is fullscreen size, only require it to be at the origin
	of the work area, not at the origin of the screen/xinerama.
	Still require it to be full screen in width x height.
	May fix xine in the case where the user has a top panel.

	* src/window.c (constrain_position): restore the ability for
	undecorated windows to position themselves overlapping the top
	panel, but don't let decorated windows do so. Oh the hacks...
2003-01-25 16:58:43 +00:00
Kjartan Maraas
e710d9f1b8 Updated Norwegian (bokmal) translation.
2003-01-25  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian (bokmal) translation.
2003-01-25 08:56:51 +00:00
He Qiangqiang
ae07c8677d Updated Simplified Chinese translation by Xiong Jiang
2003-01-23  He Qiangqiang  <carton@linux.net.cn>

        * zh_CN.po: Updated Simplified Chinese translation by
        Xiong Jiang <jxiong@offtopic.org>.
2003-01-23 15:05:31 +00:00
Dmitry Mastrukov
2a24562f45 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-01-23 09:32:32 +00:00
Abel Cheung
b7d27d9114 Updated traditional Chinese translation.
2003-01-23  Abel Cheung  <maddog@linux.org.hk>

	* zh_TW.po: Updated traditional Chinese translation.
2003-01-23 03:53:18 +00:00
Havoc Pennington
5169a06dd0 small code snippet to fix startup sequences that set legacy class/name
2003-01-08  Havoc Pennington  <hp@pobox.com>

	* src/screen.c (meta_screen_apply_startup_properties): small code
	snippet to fix startup sequences that set legacy class/name
2003-01-23 01:53:18 +00:00
Havoc Pennington
e868a001f9 do not read sizeof(long) off the X connection. The X protocol does not
2003-01-22  Havoc Pennington  <hp@redhat.com>

	* src/async-getprop.c (async_get_property_handler): do not read
	sizeof(long) off the X connection. The X protocol does not vary
	by architecture. Fixes longstanding hang on all 64-bit platforms.
2003-01-22 23:13:24 +00:00
Havoc Pennington
a8526454b0 fix conditional so we get metacity-properties.c in the distribution
2003-01-22  Havoc Pennington  <hp@redhat.com>

	* src/tools/Makefile.am: fix conditional so we get
	metacity-properties.c in the distribution #103071
2003-01-22 19:40:04 +00:00
Havoc Pennington
fabc5507f3 be robust against the panel's lame "set a negative number for struts"
2003-01-22  Havoc Pennington  <hp@pobox.com>

	* src/window.c (update_struts): be robust against the panel's
	lame "set a negative number for struts" thing, even though
	we'll also fix the panel.
2003-01-22 05:17:29 +00:00
Havoc Pennington
82bd20911c Fix for the "mangles focus window when switching workspaces and using
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-22 04:54:04 +00:00
Christian Rose
95d747269b Added "mn" to ALL_LINGUAS. Added Mongolian translation by Ochirbat Batzaya
2003-01-22  Christian Rose  <menthos@menthos.com>

	* configure.in: Added "mn" to ALL_LINGUAS.
	* po/mn.po: Added Mongolian translation by
	Ochirbat Batzaya <buuvei@yahoo.com>.
2003-01-22 02:36:57 +00:00
Havoc Pennington
d02dbd62e9 only hop window to the current workspace if the window was previously
2003-01-21  Havoc Pennington  <hp@redhat.com>

	* src/display.c (event_callback): only hop window to the current
	workspace if the window was previously minimized. Should keep
	mozilla from popping windows over to your current workspace.

2003-01-20  Havoc Pennington  <hp@redhat.com>

        Attempt to fix #85916

	* src/keybindings.c (primary_modifier_still_pressed): new function
	(handle_workspace_switch): handle modifier release prior to
	getting the grab
	(do_choose_window): handle modifier release prior to getting the
	grab

	* src/keybindings.c (grab_keyboard): properly return failure
	if the GrabKeyboard doesn't work
2003-01-21 22:40:25 +00:00
Dmitry Mastrukov
bcb9de9198 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-01-21 14:24:58 +00:00
Yuri Syrota
3558657e53 Updated Ukrainian translation 2003-01-21 12:03:35 +00:00
Kjartan Maraas
1187edeadb Updated Norwegian (bokmal) translation.
2003-01-21  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian (bokmal) translation.
2003-01-21 10:44:02 +00:00
Christian Neumair
0c684c6f35 Updated German translation. 2003-01-20 16:04:12 +00:00
Dmitry Mastrukov
c1b863ee75 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-01-20 11:32:45 +00:00
Dmitry Mastrukov
8922b0ecc6 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-01-20 10:05:14 +00:00
Dmitry Mastrukov
6cd916ea39 ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>. 2003-01-20 09:18:01 +00:00
Havoc Pennington
4b18f64914 add note about how this is the unstable branch, set version to 2.5.0
2003-01-19  Havoc Pennington  <hp@pobox.com>

	* configure.in: add note about how this is the unstable branch,
	set version to 2.5.0
2003-01-19 23:07:30 +00:00
Abel Cheung
1e6a8a31d1 Updated traditional Chinese translation, and replaced copyright symbol
2003-01-19  Abel Cheung  <maddog@linux.org.hk>

	* zh_TW.po: Updated traditional Chinese translation, and replaced
	  copyright symbol with correct one.
2003-01-19 21:21:34 +00:00
Andraz Tori
9e7a26500c Updated Slovenian translation 2003-01-19 13:43:05 +00:00
Andraz Tori
5d862ac29b Added sl to ALL_LINGUAS 2003-01-19 13:42:41 +00:00
Gustavo Noronha Silva
25b9a9e37d translation update 2003-01-17 04:00:55 +00:00
Seth Nickell
da7918554e First checkin. 2003-01-17 00:19:24 +00:00
Seth Nickell
e45eda148b Initial revision 2003-01-17 00:19:24 +00:00
Vincent van Adrighem
b24308eab1 Dutch translation updated by Tino Meinen.
2003-01-16  Vincent van Adrighem  <V.vanAdrighem@dirck.mine.nu>

	* nl.po: Dutch translation updated by Tino Meinen.
2003-01-16 22:52:21 +00:00
Vincent van Adrighem
366399eb0c Dutch translation updated by Tino Meinen.
2003-01-16  Vincent van Adrighem  <V.vanAdrighem@dirck.mine.nu>

	* nl.po: Dutch translation updated by Tino Meinen.
2003-01-16 17:16:44 +00:00
Havoc Pennington
25615f929e recalc_window_features() after making these changes, should fix #103317
2003-01-14  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_maximize, meta_window_unmaximize)
	(meta_window_make_fullscreen, meta_window_unmake_fullscreen):
	recalc_window_features() after making these changes, should fix
	#103317
2003-01-16 03:20:34 +00:00
Rob Adams
667a056066 Increase the number of run_command bindings in screen_bindings from 12 to
2003-01-14  Rob Adams <robadams@ucla.edu>

	* src/prefs.c: Increase the number of run_command bindings in
	screen_bindings from 12 to 32.

	* src/prefs.h: Increase the number of META_KEYBINDING_COMMAND_N
	macros from 12 to 32.

	* src/keybindings.c: Increase the number of run_command handlers
	from 12 to 32.
2003-01-15 02:39:07 +00:00
Yanko Kaneti
c2fbb37c8c Full Bulgarian translation by Alexander Shopov <al_shopov@yahoo.com>.
2003-01-14  Yanko Kaneti <yaneti@declera.com>

	* bg.po: Full Bulgarian translation by
	Alexander Shopov <al_shopov@yahoo.com>.
2003-01-15 00:18:41 +00:00
Daniel Yacob
45269e0e2d Updating Amharic translation. 2003-01-14 17:33:31 +00:00
Havoc Pennington
8f7eda43a8 implement compression of motion events (drop all but the most recently
2003-01-11  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_handle_mouse_grab_op_event): implement
	compression of motion events (drop all but the most recently
	received), guessing at fixes for #103009
2003-01-11 19:32:12 +00:00
Havoc Pennington
339a86150b add ability to --disable-shape
2003-01-11  Havoc Pennington  <hp@pobox.com>

	* configure.in: add ability to --disable-shape
2003-01-11 18:09:12 +00:00
Kjartan Maraas
374e5d400d Updated Norwegian (bokmal) translation.
2003-01-11  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian (bokmal) translation.
2003-01-11 15:51:52 +00:00
Akira TAGOH
0e5727eeb3 fix the behavior of --enable-*.
2003-01-11  Akira TAGOH  <tagoh@gnome.gr.jp>

	* configure.in: fix the behavior of --enable-*.
2003-01-11 09:32:31 +00:00
Havoc Pennington
9073724c2b revert that change, I got the wrong .desktop file. doh.
2003-01-10  Havoc Pennington  <hp@redhat.com>

	* src/Makefile.am (desktopfiles_in_files): revert that change, I
	got the wrong .desktop file. doh.
2003-01-10 20:45:34 +00:00
Havoc Pennington
92c8ba0497 don't install .desktop file for properties dialog if we aren't
2003-01-10  Havoc Pennington  <hp@redhat.com>

	* src/Makefile.am (desktopfiles_DATA): don't install .desktop file
	for properties dialog if we aren't building/installing the
	properties dialog.
2003-01-10 20:43:47 +00:00
Vincent van Adrighem
efb26cb769 Dutch translation updated by Tino Meinen.
2003-01-10  Vincent van Adrighem  <V.vanAdrighem@dirck.mine.nu>

	* nl.po: Dutch translation updated by Tino Meinen.
2003-01-10 16:18:19 +00:00
Andras Timar
050e55c9d7 Updated Hungarian translation.
2003-01-10  Andras Timar  <timar@gnome.hu>

	* hu.po: Updated Hungarian translation.
2003-01-10 13:59:37 +00:00
Yukihiro Nakai
e402f41b33 ja.po: Minor fix. 2003-01-10 05:19:49 +00:00
Havoc Pennington
859c1e752d 2.4.13 2003-01-10 05:02:20 +00:00
James M. Cape
198398ba88 Use a line for the titlebar text bg.
2003-01-09  James M. Cape  <jcape@ignore-your.tv>

	* src/themes/Esco/metacity-theme-1.xml: Use a line for the titlebar
	text bg.
2003-01-10 02:00:21 +00:00
Havoc Pennington
5d2f307735 argh, we were making all dialogs skip taskbar; when did that get added.
2003-01-09  Havoc Pennington  <hp@redhat.com>

	* src/window.c (recalc_window_features): argh, we were making all
	dialogs skip taskbar; when did that get added.  Fix to match
	libwnck, only skip taskbar when the dialog is transient for some
	other app window.
2003-01-09 23:28:01 +00:00
Havoc Pennington
70bd23278b change Windows+click back to Alt+click, Windows+click just surprised
2003-01-09  Havoc Pennington  <hp@redhat.com>

	* src/metacity.schemas.in: change Windows+click back to Alt+click,
	Windows+click just surprised everybody and didn't work half the
	time. Maya users can configure it, and GTK DND can change its
	default.
2003-01-09 22:48:07 +00:00
Vincent van Adrighem
76bfdcf038 Dutch translation updated by Tino Meinen.
2003-01-09  Vincent van Adrighem  <V.vanAdrighem@dirck.mine.nu>

	* nl.po: Dutch translation updated by Tino Meinen.
2003-01-09 12:44:17 +00:00
Havoc Pennington
8e14da1759 assign Alt+F12 to shade window, per #102658
2003-01-08  Havoc Pennington  <hp@pobox.com>

	* src/metacity.schemas.in: assign Alt+F12 to shade window,
	per #102658
2003-01-09 04:50:13 +00:00
Pauli Virtanen
24ecc29f49 Fixed a string that had an invalid printf format.
2003-01-08  Pauli Virtanen  <pauli.virtanen@hut.fi>

	* fi.po: Fixed a string that had an invalid printf format.
2003-01-08 20:55:26 +00:00
Abel Cheung
4a23782f51 Updated traditional Chinese translation.
2003-01-09  Abel Cheung  <maddog@linux.org.hk>

	* zh_TW.po: Updated traditional Chinese translation.
2003-01-08 20:47:44 +00:00
Havoc Pennington
b619f9baa8 fix off-by-one, patch from readams@hmc.edu, #102806
2003-01-07  Havoc Pennington  <hp@pobox.com>

	* src/screen.c (update_num_workspaces): fix off-by-one, patch from
	readams@hmc.edu, #102806
2003-01-08 04:23:18 +00:00
Daniel Yacob
878d6df404 Updated Amharic translation. 2003-01-07 16:09:06 +00:00
Vincent van Adrighem
5e5ebc7914 Dutch translation added by Tino Meinen.
2003-01-06  Vincent van Adrighem  <V.vanAdrighem@dirck.mine.nu>

	* nl.po: Dutch translation added by Tino Meinen.
2003-01-06 11:05:37 +00:00
Arvind Samptur
e2155c8fee don't apply offscreen height difference. This would get the window under
2003-01-06  Arvind Samptur <arvind.samptur@wipro.com>
        * src/window.c: (constrain_position) don't apply
        offscreen height difference. This would get the
        window under the panel on a resize or a move.
        Fixes #102418
2003-01-06 04:40:11 +00:00
Havoc Pennington
036747fba5 invert vertical_workspaces cases (we want to go down each column if it's
2003-01-05  Havoc Pennington  <hp@pobox.com>

	* src/screen.c (meta_screen_calc_workspace_layout): invert
	vertical_workspaces cases (we want to go down each column if
	it's vertical, and across each row if horizontal). Patch
	from readams@hmc.edu
2003-01-06 02:59:19 +00:00
Pablo Saratxaga
a8f93c454a updated Vietnamese file,
fixed various erros in Brazilian file,
added missing 'mk' to ALL_LINGUAS
2003-01-05 22:43:41 +00:00
Havoc Pennington
aad72e575d put in the HAVE_GTK_MULTIHEAD conditionals so we build with GTK 2.0
2003-01-05  Havoc Pennington  <hp@pobox.com>

	* src/frames.c (meta_frames_apply_shapes): put in the
	HAVE_GTK_MULTIHEAD conditionals so we build with GTK 2.0
2003-01-05 19:15:58 +00:00
Havoc Pennington
b799630ba5 focus new windows even in mouse focus mode, #89981, patch from
2003-01-05  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_show): focus new windows even in
	mouse focus mode, #89981, patch from readams@hmc.edu
2003-01-05 18:39:55 +00:00
Havoc Pennington
90748385c2 redo using new calc_workspace_layout to fix #98302
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
2003-01-05 18:36:01 +00:00
Pauli Virtanen
1d22cb8518 Added "fi" (Finnish).
2003-01-05  Pauli Virtanen <pauli.virtanen@hut.fi>

	* configure.in (ALL_LINGUAS): Added "fi" (Finnish).
2003-01-05 16:03:10 +00:00
Pauli Virtanen
4832cc6d63 Added Finnish translation.
2003-01-05  Pauli Virtanen <pauli.virtanen@hut.fi>

	* fi.po: Added Finnish translation.
2003-01-05 15:59:59 +00:00
Stanislav Visnovsky
f8226bf1bb Updated Slovak translation.
2003-01-05  Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>

	* sk.po: Updated Slovak translation.
2003-01-05 13:26:31 +00:00
Havoc Pennington
6cfcc01334 handle the client having a shape mask, fixes #101806
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.
2003-01-05 07:51:02 +00:00
Havoc Pennington
f8b2f6ca5c include the Xrandr header file
2003-01-03  Havoc Pennington  <hp@redhat.com>

	* src/display.c: include the Xrandr header file

	* src/window.c (meta_window_fill_horizontal)
	(meta_window_fill_vertical): maximize to work area, not entire
	screen. doh.
2003-01-03 19:06:53 +00:00
Kjartan Maraas
d9a2207ebe Updated Norwegian (bokmal) translation.
2003-01-03  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian (bokmal) translation.
2003-01-03 14:53:11 +00:00
Gil Osher
1be097628f *** empty log message *** 2003-01-03 13:59:04 +00:00
Chyla Zbigniew
c51a55b0e5 Updated Polish translation by GNOME PL Team <translators@gnome.pl> 2003-01-02 14:38:16 +00:00
Daniel Yacob
f88852cff6 Updating Amharic translation. 2002-12-30 13:56:14 +00:00
Kostas Papadimas
8d266f5550 Updated the Greek translation 2002-12-29 16:12:07 +00:00
Ole Laursen
b9e86197f2 Updated Danish translation.
2002-12-25  Ole Laursen  <olau@hardworking.dk>

	* da.po: Updated Danish translation.
2002-12-25 17:35:41 +00:00
Ivan Stojmirov
b9e4faa1aa Added Macedonian translation 2002-12-25 11:35:21 +00:00
Kostas Papadimas
625b7a25b0 Updated the Greek translation 2002-12-25 09:54:58 +00:00
Yuri Syrota
0e6b393896 Updated Ukrainian translation 2002-12-24 11:26:22 +00:00
Yuri Syrota
109761e973 Updated Ukrainian translation 2002-12-24 10:11:16 +00:00
Yuri Syrota
fd5557f44c Updated Ukrainian translation 2002-12-24 08:41:31 +00:00
Ross Burton
79d28b4709 DTD fixes 2002-12-23 11:31:24 +00:00
Daniel Yacob
5cf84e6702 Updated Amharic translation. 2002-12-23 03:40:00 +00:00
Peteris Krisjanis
f218216a2c 2002-12-22 Artis Trops <hornet@navigator.lv> * lv.po: Updated Latvian translation. 2002-12-22 18:20:25 +00:00
Daniel Yacob
5f99b61f07 Updated Amharic translation. 2002-12-22 04:42:16 +00:00
Christian Neumair
a5fa06ebb1 Updated German translation. 2002-12-20 20:49:51 +00:00
Miloslav Trmac
a0d3c8e20b Update Czech translation 2002-12-20 12:15:17 +00:00
Havoc Pennington
1ece207400 Reverted visual bell patch, #99886
2002-12-19  Havoc Pennington  <hp@pobox.com>

	* Reverted visual bell patch, #99886
2002-12-19 20:20:59 +00:00
Havoc Pennington
91641c2cf3 select ColormapChangeMask on toplevel windows, maybe a partial fix for
2002-12-18  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new): select ColormapChangeMask
	on toplevel windows, maybe a partial fix for #101478

2002-12-17  Havoc Pennington  <hp@pobox.com>

	* src/display.c (meta_display_begin_grab_op): don't use "(null)"
	for null pointers, use "none", so I can distinguish
	glibc-generated (null) which is a bug.
	(key_event_description): ditto
	(meta_display_begin_grab_op): ditto

	* src/window.c (update_sm_hints): ditto

	* src/keybindings.c (reload_modmap): ditto
	(meta_display_process_key_event): ditto
2002-12-19 20:18:54 +00:00
Hasbullah Bin Pit
4045ee474d Updated Malay Translation. pening kepala tengok metacity ni
002-12-19  Hasbullah Bin Pit <sebol@ikhlas.com>

        * ms.po: Updated Malay Translation.
pening kepala tengok metacity ni
2002-12-19 15:52:48 +00:00
Yanko Kaneti
e3b364c055 Added Bulgarian (bg).
2002-12-19  Yanko Kaneti <yaneti@declera.com>

	* configure.in: (ALL_LINGUAS) Added Bulgarian (bg).

po/

	* bg.po (added): Added start of Bulgarian translation by
	Alexander Shopov <al_shopov@yahoo.com>.
2002-12-19 12:50:54 +00:00
Havoc Pennington
89c31c43ca select ColormapChangeMask on toplevel windows, maybe a partial fix for
2002-12-18  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new): select ColormapChangeMask
	on toplevel windows, maybe a partial fix for #101478
2002-12-18 22:16:58 +00:00
Pablo Gonzalo del Campo
0d1e643e1c Updated Spanish translation.
2002-12-18  Pablo Gonzalo del Campo <pablodc@bigfoot.com>

	* es.po: Updated Spanish translation.
2002-12-18 16:28:41 +00:00
Hidetoshi Tajima
f6b4f11ebe added support for border only windows. #100984.
* src/themes/AgingGorilla/metacity-theme-1.xml: added support for
	border only windows. #100984.
2002-12-18 01:51:35 +00:00
Havoc Pennington
908198c25d s/focussed/focused/
2002-12-17  Havoc Pennington  <hp@pobox.com>

	* src/metacity.schemas.in: s/focussed/focused/
2002-12-17 18:36:24 +00:00
Havoc Pennington
f4cb740aac add a comma to message #101401
2002-12-17  Havoc Pennington  <hp@pobox.com>

	* src/xprops.c (validate_or_free_results): add a comma to message #101401
2002-12-17 18:26:08 +00:00
Miloslav Trmac
a2d0235d68 Update Czech translation 2002-12-17 13:36:19 +00:00
Christian Rose
bda692174a Updated Swedish translation.
2002-12-17  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2002-12-17 08:45:14 +00:00
Bill Haneman
e7e47a8b85 Added visual bell feature, fix for 99886. 2002-12-17 01:08:29 +00:00
Christian Rose
32a8bf50b7 Updated Swedish translation.
2002-12-17  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2002-12-17 01:04:18 +00:00
Christian Neumair
b0818f97f2 Updated German translation. 2002-12-16 23:07:10 +00:00
Havoc Pennington
ea45e43082 argh, screwed that up. get WM_NAME as VALUE_TEXT_PROPERTY #101383
2002-12-16  Havoc Pennington  <hp@pobox.com>

	* src/window-props.c (init_wm_name): argh, screwed that up. get
	WM_NAME as VALUE_TEXT_PROPERTY #101383
2002-12-16 22:09:05 +00:00
Havoc Pennington
1ad94dec1c use META_PROP_VALUE_STRING_AS_UTF8 so we convert old Latin-1 WM_NAME to
2002-12-16  Havoc Pennington  <hp@pobox.com>

	* src/window-props.c: use META_PROP_VALUE_STRING_AS_UTF8 so
	we convert old Latin-1 WM_NAME to UTF-8

	* src/xprops.h (enum): add META_PROP_VALUE_STRING_AS_UTF8 to get a
	latin1 string then convert.
2002-12-16 22:01:15 +00:00
Miloslav Trmac
995aef2577 Update Czech translation 2002-12-16 19:31:40 +00:00
Ole Laursen
5817e204b4 Updated Danish translation.
2002-12-16  Ole Laursen  <olau@hardworking.dk>

	* da.po: Updated Danish translation.
2002-12-16 16:30:52 +00:00
Daniel Yacob
50b5a2b8d8 Adding am to LINGUAS. 2002-12-16 14:33:27 +00:00
Havoc Pennington
8a9a4aba77 get window name before anything else.
2002-12-15  Havoc Pennington  <hp@pobox.com>

	* src/window.c (meta_window_new): get window name before anything
	else.

	* src/xprops.c (validate_or_free_results): instead of suggesting
	how to get window title etc. with xprop, just print out the
	window title. much better.
2002-12-15 21:59:38 +00:00
Havoc Pennington
4ad2d1a048 make the warning about strange property contents blame the application and
2002-12-15  Havoc Pennington  <hp@pobox.com>

	* src/xprops.c (validate_or_free_results): make the warning about
	strange property contents blame the application and explain how to
	use xprop to diagnose which app is causing the problem.
2002-12-15 18:55:08 +00:00
Havoc Pennington
07296490b4 don't pass NULL string to gconf_client_set_string #101237
2002-12-15  Havoc Pennington  <hp@pobox.com>

	* src/prefs.c (meta_prefs_change_workspace_name): don't pass NULL
	string to gconf_client_set_string #101237
2002-12-15 18:51:29 +00:00
Kjartan Maraas
d3b2764ff6 Updated Norwegian (bokmål) translation.
2002-12-14  Kjartan Maraas  <kmaraas@gnome.org>

	* no.po: Updated Norwegian (bokmål) translation.
2002-12-14 21:03:01 +00:00
Daniel Yacob
6c51b8ae6a For real this time. 2002-12-14 04:23:37 +00:00
Daniel Yacob
4fdc3667a3 Adding Amharic translation. 2002-12-14 04:23:16 +00:00
Havoc Pennington
fd8c3514d6 only install .desktop file for metacity-properties if we actually install
2002-12-13  Havoc Pennington  <hp@redhat.com>

	* src/tools/Makefile.am (Desktop_in_files): only install .desktop
	file for metacity-properties if we actually install
	metacity-properties

	* src/display.c (event_callback): not focusing on button 2 click
	was crack, revert that change.
2002-12-13 22:20:31 +00:00
Christian Rose
c2700863ca Updated Swedish translation.
2002-12-13  Christian Rose  <menthos@menthos.com>

	* sv.po: Updated Swedish translation.
2002-12-13 03:59:56 +00:00
Ole Laursen
18d32248ab Updated Danish translation.
2002-12-12  Ole Laursen  <olau@hardworking.dk>

	* da.po: Updated Danish translation.
2002-12-12 20:15:01 +00:00
Christian Neumair
d8a59d7cd1 Updated German translation, added src/tools/metacity-message.c to
POTFILES.in.
2002-12-11 17:07:08 +00:00
Evandro Fernandes Giovanini
4213beea4b Updated Brazilian Portuguese translation.
2002-12-11  Evandro Fernandes Giovanini <evandrofg@ig.com.br>

        * pt_BR.po: Updated Brazilian Portuguese translation.
2002-12-11 03:41:20 +00:00
Havoc Pennington
967777b965 add myself here, bug #100789
2002-12-09  Havoc Pennington  <hp@pobox.com>

	* AUTHORS: add myself here, bug #100789

	* src/display.c (meta_display_set_grab_op_cursor): drop
	PointerMotionHintMask

	* src/window.c (meta_window_handle_mouse_grab_op_event): don't use
	XQueryPointer, as we aren't using PointerMotionHint now

	* src/display.c (event_callback): rearrange a bit of code
	for slight speedup and clarity

	* src/window.c (update_resize)
	(meta_window_handle_mouse_grab_op_event): implement
	usage of the _METACITY_UPDATE_COUNTER
	(meta_window_handle_mouse_grab_op_event): fix code that
	used event->xbutton with a motion event

	* src/display.c (meta_display_open): add new atoms, and
	initialize Xsync if we have it
	(grab_op_is_resizing): new function
	(meta_display_begin_grab_op): create an alarm monitoring
	window's _METACITY_UPDATE_COUNTER
	(meta_spew_event): conditionalize this on WITH_VERBOSE_MODE
	and print alarm events.

	* src/window.c (meta_window_new): fetch _METACITY_UPDATE_COUNTER

	* configure.in (HAVE_XSYNC): check for Xsync extension
2002-12-10 03:23:04 +00:00
Soeren Sandmann
ba18c630b7 Handle crossing events during resizing. (#93384).
Mon Dec  9 22:09:56 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* src/display.c, src/window.c: Handle crossing events during
	resizing. (#93384).
2002-12-09 21:07:27 +00:00
104 changed files with 54314 additions and 12461 deletions

View File

@@ -0,0 +1 @@
Havoc Pennington <hp@redhat.com>

993
ChangeLog
View File

@@ -1,3 +1,996 @@
2003-05-03 Havoc Pennington <hp@pobox.com>
* configure.in: 2.5.1
* NEWS: update
2003-05-01 Rob Adams <robadams@ucla.edu>
* src/constraints.c (constraint_onscreen_applies_func): Don't
apply onscreen constraints to full screen windows. Fix for
#110048
2003-04-29 Havoc Pennington <hp@redhat.com>
* src/bell.h: include Xlib.h before XKBlib.h which is required on
Solaris. #111877 from Peter O'Shea
2003-04-23 Havoc Pennington <hp@pobox.com>
* src/keybindings.c (process_keyboard_move_grab): support
diagonal keypad keybindings, from Dafydd Harries
2003-04-21 Havoc Pennington <hp@redhat.com>
* purge HAVE_GTK_MULTIHEAD from the source code, not just from
configure.in. Yes I am a loser.
2003-04-19 Masahiro Sakai <sakai@tom.sfc.keio.ac.jp>
* configure.in: call AC_LIBTOOL_WIN32_DLL.
* src/Makefile.am: add -no-undefined to libmetacity_private_la_LDFLAGS
and write dependency libraries in libmetacity_private_la_LIBADD.
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-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 fit 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-05 Rob Adams <robadams@ucla.edu>
* src/place.c (center_tile_rect_in_area): Fix a minor off-by-one
error. See #110079.
2003-03-30 Rob Adams <robadams@ucla.edu>
* src/window.c (meta_window_move_resize_internal): When passing
frame geometry to meta_window_constrain, send null if no frame.
Possible fix for #109039.
2003-03-29 Havoc Pennington <hp@pobox.com>
* src/wm-tester/test-gravity.c (main): add --noframes option for
testing, showing how broken we currently are.
Fri Mar 28 14:13:37 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* src/window.c (update_resize): Only cap refresh rate when not
using SYNC. Remove bogus update-if-we-moved-more-than-a-delta.
* src/window.c (update_move): Don't cap refresh rate during
moves. Remove bogus update-if-we-moved-more-than-a-delta.
2003-03-26 Havoc Pennington <hp@pobox.com>
* NEWS: update
* configure.in: release 2.5.0
Sun Mar 23 23:04:06 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* src/display.c (meta_spew_event): just return if we are not
verbose.
2003-03-11 Havoc Pennington <hp@pobox.com>
Should fix #108108, #106217, tracked down by Owen Taylor and
Frederic Crozat
* src/window.c (meta_window_foreach_transient): change
MetaWindowForeachFunc to return a boolean for whether to continue
(meta_window_foreach_ancestor): new function
(window_should_be_showing): use meta_window_foreach_ancestor
(unminimize_window_and_all_transient_parents): ditto
(update_sm_hints): ditto
(meta_window_is_ancestor_of_transient): ditto
* src/stack.c (get_maximum_layer_of_ancestor): use
meta_window_foreach_ancestor
2003-03-16 Rob Adams <robadams@ucla.edu>
* window.c (meta_window_show_menu): Free old window menu if it
already exists so we don't end up with more than one. Fix for
#108392.
2003-03-14 Rob Adams <robadams@ucla.edu>
* contraints.c (get_outermost_screen_positions): Don't try to
force a window onscreen by more than its width. Fix for #94815.
2003-03-13 Rob Adams <robadams@ucla.edu>
Make it so that the alt-tabbing won't try to go to a minimized
window by default. Fix for #107071.
* display.c (meta_display_get_tab_list): use a GList instead of a
GSList
(meta_display_get_tab_next): use meta_display_get_tab_list to
decide what the next/previous tab window should be.
* display.h (meta_display_get_tab_list): update function prototype
to return GList instead of GSList.
* screen.c (meta_screen_ensure_tab_popup): update function to deal
with GList returned by meta_display_get_tab_list instead of GSList.
2003-03-13 Christian Rose <menthos@menthos.com>
* configure.in: Added "ml" to ALL_LINGUAS.
2003-03-11 Paul Duffy <dubhthach@zion.nuigalway.ie>
* configure.in: Added "ga" to ALL_LINGUAS
2003-03-11 Rob Adams <robadams@ucla.edu>
* src/constraints.c (meta_window_constrain): include left frame
geometry when maximizing or fullscreening windows. Fix for
#108127.
2003-03-10 Roozbeh Pournader <roozbeh@sharif.edu>
* configure.in: Added "fa" to ALL_LINGUAS.
2003-02-27 Havoc Pennington <hp@redhat.com>
Switch over to new constraints code, unquestionably introduces
some bugs, but should get us on the right path.
* src/window.c (meta_window_get_work_area_all_xineramas): create
this function again as it turned out to be legitimate for window
position constraint
(adjust_for_gravity): use the width/height from the configure
request to compute the requested move
(meta_window_move_resize_internal): use meta_window_constrain
(update_size_hints): clamp max size to MAXSHORT to avoid worrying
about overflow stuff
* src/constraints.c (meta_window_constrain): don't base placement
on uninitialized variables, general hacking
* src/Makefile.am (metacity_SOURCES): add constraints.c,
constraints.h
* src/constraints.c (meta_window_constrain): update the
cut-and-paste aspect ratio code to have latest bugfixes
2003-03-08 Rob Adams <robadams@ucla.edu>
* src/window-props.c (reload_normal_hints): Check that window min
and max size hints are at least 1. Fix for #107110.
2003-02-27 Havoc Pennington <hp@pobox.com>
Changes made on plane from FOSDEM, syncing from laptop.
* src/main.c (main): add more debug spew about conditional
build stuff
(main): panic to "Simple" theme
* src/window.c, src/window-props.c: move WM_NORMAL_HINTS and
WM_PROTOCOLS to new property system; don't queue move resize on
updating WM_PROTOCOLS; move WM_HINTS to new property system;
reload icon in an idle handler.
2003-02-28 Mark McLoughlin <mark@skynet.ie>
Give me back my keys.
* src/keybindings.c: (meta_window_grab_keys): don't
grab keys on DOCK windows.
* src/window.c: (recalc_window_type): re-grab the
keys.
2003-02-26 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* configure.in: Added Belarusian to ALL_LINGUAS.
2003-02-26 Mark McLoughlin <mark@skynet.ie>
* src/keybindings.c: (handle_panel_keybinding): release
the keyboard grab before sending the action message to
the panel.
2003-02-24 Mark McLoughlin <mark@skynet.ie>
Take control of the panel's global keybindings. The
screenshot utility is hooked up using a special case
run_command and the menu and run dialog bindings are
done using the _GNOME_PANEL_ACTION ClientMessage
protocol.
* src/display.[ch]: (meta_display_open): add some atoms.
* src/keybindings.c:
(handle_panel_keybinding): impl to handle a keybinding
by sending an action message to the panel.
* src/metacity.schemas.in: add schemas for the panel and
screenshot keybindings and the screenshot commands.
* src/prefs.[ch]: (update_command),
(meta_prefs_get_gconf_key_for_command): impl special case
handling for the screenshot commands. They are stored at
the the end of the commands array but have named keys.
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-22 Rob Adams <robadams@ucla.edu>
* src/metacity.schemas.in: change toggle_maximized to
toggle_maximize and toggle_shaded to toggle_shade in
action_double_click_titlebar long description to match the values
used by metacity
* po/*.po: change toggle_maximized to toggle_maximize and
toggle_shaded to toggle_shade in action_double_click_titlebar long
description to match the values used by metacity
2003-02-22 Rob Adams <robadams@ucla.edu>
* window.c (set_wm_state): modify comment to explain why the icon
window element is set to None. Fix for #97357 thanks to Gregory
Merchan.
2003-02-22 Havoc Pennington <hp@pobox.com>
* README: fix a typo, pointed out by Steve Kemp
2003-02-22 Havoc Pennington <hp@pobox.com>
* src/prefs.c (MAX_REASONABLE_WORKSPACES): change max workspaces
to 36 #81855
2003-02-22 Havoc Pennington <hp@pobox.com>
* src/display.c (event_callback): fix to unfocus window only when
you leave the window frame, not when you leave the window itself,
unless window has no frame. #100248 fix from Orien Vandenbergh
2003-02-22 Havoc Pennington <hp@pobox.com>
* src/display.c (meta_display_get_tab_next): when tabbing
backward, we are still tabbing *from* the most recently used
window, not from the least recently used window.
* src/keybindings.c (struct _MetaKeyBinding): make keycode
unsigned to match XEvent
Patch for #84999 based on patch from Mark McLoughlin
* src/prefs.c: add an add_shift field to MetaKeyPref to
add shift when grabbing the given keybinding.
* src/keybindings.c (rebuild_screen_binding_table)
(rebuild_window_binding_table): refactor to share code,
and honor add_shift field in MetaKeyPref
2003-02-20 Havoc Pennington <hp@redhat.com>
* src/stack.c (create_constraints): don't create constraints
between windows on different screens, #106086 tracked down
by Arvind
2003-02-14 Arvind Samptur <arvind.samptur@wipro.com>
* src/screen.c: (meta_screen_new) : Update the workspace
names from gconf and set the NET_DESKTOP_NAMES atom.
Renamed update_workspace_names() to set_workspace_names().
Fixes #105498
2003-02-13 Havoc Pennington <hp@redhat.com>
* configure.in: require GTK+ 2.2.0
* src/ui.c (meta_ui_init): remove hackaround for Pango X core
fonts backend
2003-02-05 Abel Cheung <maddog@linux.org.hk>
* configure.in: Added "en_GB" and "nl" to ALL_LINGUAS.
2003-02-05 Akira TAGOH <tagoh@gnome.gr.jp>
* src/main.c (usage): fix a typo and missing option. (#105186)
2003-02-04 Havoc Pennington <hp@redhat.com>
* src/themes/Simple/ChangeLog: nuke subdir ChangeLog,
there can be only one true ChangeLog.
2003-01-30 Havoc Pennington <hp@redhat.com>
* src/keybindings.c (process_event): match handlers to key events
using key codes, not key syms
Thu Jan 30 22:55:16 2003 Jonathan Blandford <jrb@redhat.com>
* src/themes/Makefile.am (THEMES): add Simple to the list of
themes.
* src/metacity.schemas.in: change default theme to Simple.
2003-01-29 Havoc Pennington <hp@pobox.com>
* src/menu.c (meta_window_menu_new): don't create workspaces
menu items if only 1 workspace. Fix for #101952 from
Orien Vandenbergh
2003-01-28 Bill Haneman <bill.haneman@sun.com>
* Re-instated visual-bell patch
(please see ChangeLog entry for 2002-12-16 for details).
* src/prefs.c:
(visual_bell_type_from_string):
Accept a NULL string for 'visual-bell-type'.
2003-01-25 Havoc Pennington <hp@pobox.com>
* src/stack.c (window_is_fullscreen_size): When checking if a
window is fullscreen size, only require it to be at the origin
of the work area, not at the origin of the screen/xinerama.
Still require it to be full screen in width x height.
May fix xine in the case where the user has a top panel.
* src/window.c (constrain_position): restore the ability for
undecorated windows to position themselves overlapping the top
panel, but don't let decorated windows do so. Oh the hacks...
2003-01-08 Havoc Pennington <hp@pobox.com>
* src/screen.c (meta_screen_apply_startup_properties): small code
snippet to fix startup sequences that set legacy class/name
2003-01-22 Havoc Pennington <hp@redhat.com>
* src/async-getprop.c (async_get_property_handler): do not read
sizeof(long) off the X connection. The X protocol does not vary
by architecture. Fixes longstanding hang on all 64-bit platforms.
2003-01-22 Havoc Pennington <hp@redhat.com>
* src/tools/Makefile.am: fix conditional so we get
metacity-properties.c in the distribution #103071
2003-01-22 Havoc Pennington <hp@pobox.com>
* src/window.c (update_struts): be robust against the panel's
lame "set a negative number for struts" thing, even though
we'll also fix the panel.
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-22 Christian Rose <menthos@menthos.com>
* configure.in: Added "mn" to ALL_LINGUAS.
2003-01-21 Havoc Pennington <hp@redhat.com>
* src/display.c (event_callback): only hop window to the current
workspace if the window was previously minimized. Should keep
mozilla from popping windows over to your current workspace.
2003-01-20 Havoc Pennington <hp@redhat.com>
Attempt to fix #85916
* src/keybindings.c (primary_modifier_still_pressed): new function
(handle_workspace_switch): handle modifier release prior to
getting the grab
(do_choose_window): handle modifier release prior to getting the
grab
* src/keybindings.c (grab_keyboard): properly return failure
if the GrabKeyboard doesn't work
2003-01-19 Havoc Pennington <hp@pobox.com>
* configure.in: add note about how this is the unstable branch,
set version to 2.5.0
2003-01-14 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_maximize, meta_window_unmaximize)
(meta_window_make_fullscreen, meta_window_unmake_fullscreen):
recalc_window_features() after making these changes, should fix
#103317
2003-01-14 Rob Adams <robadams@ucla.edu>
* src/prefs.c: Increase the number of run_command bindings in
screen_bindings from 12 to 32.
* src/prefs.h: Increase the number of META_KEYBINDING_COMMAND_N
macros from 12 to 32.
* src/keybindings.c: Increase the number of run_command handlers
from 12 to 32.
2003-01-11 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_handle_mouse_grab_op_event): implement
compression of motion events (drop all but the most recently
received), guessing at fixes for #103009
2003-01-11 Havoc Pennington <hp@pobox.com>
* configure.in: add ability to --disable-shape
2003-01-11 Akira TAGOH <tagoh@gnome.gr.jp>
* configure.in: fix the behavior of --enable-*.
2003-01-10 Havoc Pennington <hp@redhat.com>
* src/Makefile.am (desktopfiles_in_files): revert that change, I
got the wrong .desktop file. doh.
2003-01-10 Havoc Pennington <hp@redhat.com>
* src/Makefile.am (desktopfiles_DATA): don't install .desktop file
for properties dialog if we aren't building/installing the
properties dialog.
2003-01-10 Havoc Pennington <hp@pobox.com>
* NEWS: update
* configure.in: bump to 2.4.13, require 2.2.0 for multihead
2003-01-09 James M. Cape <jcape@ignore-your.tv>
* src/themes/Esco/metacity-theme-1.xml: Use a line for the titlebar
text bg.
2003-01-09 Havoc Pennington <hp@redhat.com>
* src/window.c (recalc_window_features): argh, we were making all
dialogs skip taskbar; when did that get added. Fix to match
libwnck, only skip taskbar when the dialog is transient for some
other app window.
2003-01-09 Havoc Pennington <hp@redhat.com>
* src/metacity.schemas.in: change Windows+click back to Alt+click,
Windows+click just surprised everybody and didn't work half the
time. Maya users can configure it, and GTK DND can change its
default.
2003-01-08 Havoc Pennington <hp@pobox.com>
* src/metacity.schemas.in: assign Alt+F12 to shade window,
per #102658
2003-01-07 Havoc Pennington <hp@pobox.com>
* src/screen.c (update_num_workspaces): fix off-by-one, patch from
readams@hmc.edu, #102806
2003-01-06 Arvind Samptur <arvind.samptur@wipro.com>
* src/window.c: (constrain_position) don't apply
offscreen height difference. This would get the
window under the panel on a resize or a move.
Fixes #102418
2003-01-05 Havoc Pennington <hp@pobox.com>
* src/screen.c (meta_screen_calc_workspace_layout): invert
vertical_workspaces cases (we want to go down each column if
it's vertical, and across each row if horizontal). Patch
from readams@hmc.edu
2003-01-05 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in: Added Macedonian (mk) to ALL_LINGUAS
2003-01-05 Havoc Pennington <hp@pobox.com>
* src/frames.c (meta_frames_apply_shapes): put in the
HAVE_GTK_MULTIHEAD conditionals so we build with GTK 2.0
2003-01-05 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_show): focus new windows even in
mouse focus mode, #89981, patch from readams@hmc.edu
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
2003-01-05 Pauli Virtanen <pauli.virtanen@hut.fi>
* configure.in (ALL_LINGUAS): Added "fi" (Finnish).
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.
2003-01-03 Havoc Pennington <hp@redhat.com>
* src/display.c: include the Xrandr header file
* src/window.c (meta_window_fill_horizontal)
(meta_window_fill_vertical): maximize to work area, not entire
screen. doh.
2002-12-19 Ross Burton <ross@burtonini.com>
* doc/metacity-theme.dtd: Fix a typo and loosen the requirements
for the resize element.
2002-12-19 Havoc Pennington <hp@pobox.com>
* Reverted visual bell patch, #99886
2002-12-19 Yanko Kaneti <yaneti@declera.com>
* configure.in: (ALL_LINGUAS) Added Bulgarian (bg).
2002-12-18 Havoc Pennington <hp@redhat.com>
* src/window.c (meta_window_new): select ColormapChangeMask
on toplevel windows, maybe a partial fix for #101478
Tue Dec 17 17:50:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* src/themes/AgingGorilla/metacity-theme-1.xml: added support for
border only windows. #100984.
2002-12-17 Havoc Pennington <hp@pobox.com>
* src/display.c (meta_display_begin_grab_op): don't use "(null)"
for null pointers, use "none", so I can distinguish
glibc-generated (null) which is a bug.
(key_event_description): ditto
(meta_display_begin_grab_op): ditto
* src/window.c (update_sm_hints): ditto
* src/keybindings.c (reload_modmap): ditto
(meta_display_process_key_event): ditto
2002-12-17 Havoc Pennington <hp@pobox.com>
* src/metacity.schemas.in: s/focussed/focused/
2002-12-17 Havoc Pennington <hp@pobox.com>
* src/xprops.c (validate_or_free_results): add a comma to message #101401
2002-12-16 Bill Haneman <bill.haneman@sun.com>
* configure.in:
Check for XKB extension.
* src/Makefile.am:
Added bell.c and bell.h to metacity sources.
* src/common.h:
(MetaFrameFlags):
Added META_FRAME_IS_FLASHING flag.
* src/frame.h:
(MetaFrame): Added is_flashing field.
* src/frame.c:
(meta_window_ensure_frame):
Initialize the is_flashing flag to FALSE.
(meta_frame_get_flags):
Handle the FRAME_IS_FLASHING flag.
(meta_window_destroy_frame):
Call meta_bell_notify_frame_destroy.
* src/prefs.h:
(MetaPreference):
Added META_PREF_VISUAL_BELL, META_PREF_AUDIBLE_BELL,
META_PREF_VISUAL_BELL_TYPE.
(MetaVisualBellType): New enum.
(meta_prefs_get_visual_bell, meta_prefs_bell_is_audible):
(meta_prefs_get_visual_bell_type):
New accessor declarations.
* src/prefs.c:
(#includes): Include "display.h", since we now call
meta_displays_list() in our update func.
(#defines):
Define KEY_VISUAL_BELL, KEY_AUDIBLE_BELL,
and KEY_VISUAL_BELL_TYPE.
(provide_visual_bell, bell_is_audible, visual_bell_type):
New static state variables.
(update_visual_bell): New method to update visual-bell
boolean settings from keys "visual_bell" and "audible_bell".
(update_visual_bell_type):
New method to update visual-bell type setting.
(visual_bell_type_from_string) :
New method to convert from gconf string to visual-bell
type enum. Only currently recognized values are "fullscreen"
and "frame_flash".
(change_notify):
Handle changes to visual and audible bell properties.
(meta_prefs_get_visual_bell, meta_prefs_bell_is_audible):
(meta_prefs_get_visual_bell_type):
New accessor definitions.
(meta_prefs_init): Added a second call to notify_add,
listens to "/desktop/gnome/interface" as well as "apps/metacity".
Also call the update funcs for the new visual-bell gconf keys.
(meta_preference_to_string):
Handle the visual/audible bell cases.
* src/bell.h:
(meta_bell_notify);
New method, calls a visual notifucation
method based on the visual-bell-type, or none if the type
is unrecognized or invalid.
(meta_bell_set_audible):
New public method for setting the audible bell setting,
used in updater for new gconf key "audible_bell".
(meta_bell_init):
Initialize the bell notification for a display.
(meta_bell_shutdown):
Shutdown the bell notification for a display.
(meta_bell_notify_frame_destroy):
Remove pending idle handlers on notification.
* src/bell.c:
Include "bell.h", and conditionally include <Xll/Xkblib.h>.
(meta_bell_set_audible):
If XKB is present, enable/disable the audible system
bell based on the gconf key /desktop/gnome/interface/audible_bell.
(meta_bell_init):
Query and initialize XKB if present, register for notification
on the bell, and set audible bell according to gconf settings.
(meta_bell_flash_screen):
Maps and unmaps a fullscreen X window (painted white, then
black), which causes a fullscreen 'flash' transient.
(meta_bell_flash_window_frame):
Flashes the titlebar of a specified window.
(meta_bell_flash_frame):
Calls meta_bell_flash_window_frame on the window which
was the source of the current bell event, or the currently
focussed window if the event source cannot be determined.
(meta_bell_unflash_frame):
Restore the frame's appearance to normal.
(meta_bell_flash_fullscreen):
Call meta_bell_flash_fullscreen for all screens.
(meta_bell_shutdown):
New method.
(meta_bell_notify_frame_destroy):
Remove pending idle handlers on notification,
testing for frame->is_flashing first.
* src/display.h:
(MetaDisplay): Added xkb_base_event_type field.
* src/display.c:
Check for XKB and include "X11/XKBlib.h" if present.
(meta_display_open): Call meta_bell_init.
(event_callback): Call meta_bell_notify
when event comes from XKB and is XkbBellNotify
(prefs_changed_callback):
Handle META_PREF_AUDIBLE_BELL notification.
* src/screen.h:
(MetaScreen): Add flash_window field.
* src/screen.c:
(meta_screen_new):
Initialize flash_window field.
* src/theme.c:
(theme_get_style):
New heuristic for focus-style, to invert sense of focus
flag when META_FRAME_IS_FLASHING flag is set.
* src/metacity.schemas.in:
Added scheme information for
/apps/metacity/general/visual_bell,
/apps/metacity/general/audible_bell, and
/apps/metacity/general/visual_bell_type.
2002-12-16 Havoc Pennington <hp@pobox.com>
* src/window-props.c (init_wm_name): argh, screwed that up. get
WM_NAME as VALUE_TEXT_PROPERTY #101383
2002-12-16 Bill Haneman <bill.haneman@sun.com>
* configure.in:
Check for XKB extension.
* src/Makefile.am:
Added bell.c and bell.h to metacity sources.
* src/common.h:
(MetaFrameFlags):
Added META_FRAME_IS_FLASHING flag.
* src/frame.h:
(MetaFrame): Added is_flashing field.
* src/frame.c:
(meta_window_ensure_frame):
Initialize the is_flashing flag to FALSE.
(meta_frame_get_flags):
Handle the FRAME_IS_FLASHING flag.
(meta_window_destroy_frame):
Call meta_bell_notify_frame_destroy.
* src/prefs.h:
(MetaPreference):
Added META_PREF_VISUAL_BELL, META_PREF_AUDIBLE_BELL,
META_PREF_VISUAL_BELL_TYPE.
(MetaVisualBellType): New enum.
(meta_prefs_get_visual_bell, meta_prefs_bell_is_audible):
(meta_prefs_get_visual_bell_type):
New accessor declarations.
* src/prefs.c:
(#includes): Include "display.h", since we now call
meta_displays_list() in our update func.
(#defines):
Define KEY_VISUAL_BELL, KEY_AUDIBLE_BELL,
and KEY_VISUAL_BELL_TYPE.
(provide_visual_bell, bell_is_audible, visual_bell_type):
New static state variables.
(update_visual_bell): New method to update visual-bell
boolean settings from keys "visual_bell" and "audible_bell".
(update_visual_bell_type):
New method to update visual-bell type setting.
(visual_bell_type_from_string) :
New method to convert from gconf string to visual-bell
type enum. Only currently recognized values are "fullscreen"
and "frame_flash".
(change_notify):
Handle changes to visual and audible bell properties.
(meta_prefs_get_visual_bell, meta_prefs_bell_is_audible):
(meta_prefs_get_visual_bell_type):
New accessor definitions.
(meta_prefs_init): Added a second call to notify_add,
listens to "/desktop/gnome/interface" as well as "apps/metacity".
Also call the update funcs for the new visual-bell gconf keys.
(meta_preference_to_string):
Handle the visual/audible bell cases.
* src/bell.h:
(meta_bell_notify);
New method, calls a visual notifucation
method based on the visual-bell-type, or none if the type
is unrecognized or invalid.
(meta_bell_set_audible):
New public method for setting the audible bell setting,
used in updater for new gconf key "audible_bell".
(meta_bell_init):
Initialize the bell notification for a display.
(meta_bell_shutdown):
Shutdown the bell notification for a display.
(meta_bell_notify_frame_destroy):
Remove pending idle handlers on notification.
* src/bell.c:
Include "bell.h", and conditionally include <Xll/Xkblib.h>.
(meta_bell_set_audible):
If XKB is present, enable/disable the audible system
bell based on the gconf key /desktop/gnome/interface/audible_bell.
(meta_bell_init):
Query and initialize XKB if present, register for notification
on the bell, and set audible bell according to gconf settings.
(meta_bell_flash_screen):
Maps and unmaps a fullscreen X window (painted white, then
black), which causes a fullscreen 'flash' transient.
(meta_bell_flash_window_frame):
Flashes the titlebar of a specified window.
(meta_bell_flash_frame):
Calls meta_bell_flash_window_frame on the window which
was the source of the current bell event, or the currently
focussed window if the event source cannot be determined.
(meta_bell_unflash_frame):
Restore the frame's appearance to normal.
(meta_bell_flash_fullscreen):
Call meta_bell_flash_fullscreen for all screens.
(meta_bell_shutdown):
New method.
(meta_bell_notify_frame_destroy):
Remove pending idle handlers on notification,
testing for frame->is_flashing first.
* src/display.h:
(MetaDisplay): Added xkb_base_event_type field.
* src/display.c:
Check for XKB and include "X11/XKBlib.h" if present.
(meta_display_open): Call meta_bell_init.
(event_callback): Call meta_bell_notify
when event comes from XKB and is XkbBellNotify
(prefs_changed_callback):
Handle META_PREF_AUDIBLE_BELL notification.
* src/screen.h:
(MetaScreen): Add flash_window field.
* src/screen.c:
(meta_screen_new):
Initialize flash_window field.
* src/theme.c:
(theme_get_style):
New heuristic for focus-style, to invert sense of focus
flag when META_FRAME_IS_FLASHING flag is set.
* src/metacity.schemas.in:
Added scheme information for
/apps/metacity/general/visual_bell,
/apps/metacity/general/audible_bell, and
/apps/metacity/general/visual_bell_type.
2002-12-16 Havoc Pennington <hp@pobox.com>
* src/window-props.c: use META_PROP_VALUE_STRING_AS_UTF8 so
we convert old Latin-1 WM_NAME to UTF-8
* src/xprops.h (enum): add META_PROP_VALUE_STRING_AS_UTF8 to get a
latin1 string then convert.
2002-12-15 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_new): get window name before anything
else.
* src/xprops.c (validate_or_free_results): instead of suggesting
how to get window title etc. with xprop, just print out the
window title. much better.
2002-12-15 Havoc Pennington <hp@pobox.com>
* src/xprops.c (validate_or_free_results): make the warning about
strange property contents blame the application and explain how to
use xprop to diagnose which app is causing the problem.
2002-12-15 Havoc Pennington <hp@pobox.com>
* src/prefs.c (meta_prefs_change_workspace_name): don't pass NULL
string to gconf_client_set_string #101237
2002-12-13 Havoc Pennington <hp@redhat.com>
* src/tools/Makefile.am (Desktop_in_files): only install .desktop
file for metacity-properties if we actually install
metacity-properties
* src/display.c (event_callback): not focusing on button 2 click
was crack, revert that change.
2002-12-09 Havoc Pennington <hp@pobox.com>
* AUTHORS: add myself here, bug #100789
* src/display.c (meta_display_set_grab_op_cursor): drop
PointerMotionHintMask
* src/window.c (meta_window_handle_mouse_grab_op_event): don't use
XQueryPointer, as we aren't using PointerMotionHint now
* src/display.c (event_callback): rearrange a bit of code
for slight speedup and clarity
* src/window.c (update_resize)
(meta_window_handle_mouse_grab_op_event): implement
usage of the _METACITY_UPDATE_COUNTER
(meta_window_handle_mouse_grab_op_event): fix code that
used event->xbutton with a motion event
* src/display.c (meta_display_open): add new atoms, and
initialize Xsync if we have it
(grab_op_is_resizing): new function
(meta_display_begin_grab_op): create an alarm monitoring
window's _METACITY_UPDATE_COUNTER
(meta_spew_event): conditionalize this on WITH_VERBOSE_MODE
and print alarm events.
* src/window.c (meta_window_new): fetch _METACITY_UPDATE_COUNTER
* configure.in (HAVE_XSYNC): check for Xsync extension
Mon Dec 9 22:09:56 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* src/display.c, src/window.c: Handle crossing events during
resizing. (#93384).
2002-12-09 Havoc Pennington <hp@redhat.com>
* configure.in: 2.4.8

79
NEWS
View File

@@ -1 +1,78 @@
See README.
2.5.1
===
Thanks to Rob Adams, Peter O'Shea, Dafydd Harries, Masahiro Sakai,
Soeren Sandmann for fixes in this release.
- fix bug where fullscreen windows were below top panels
- build fix for Solaris
- support diagonal window movement with numeric keypad
- multihead fix
- build fix for Cygwin
- place on xinerama containing the pointer
- fix totally hosed window placement/movement for frameless
windows
- improvement to smoothness of window move/resize
2.5.0
===
Thanks to Rob Adams, Owen Taylor, Frederic Crozat, Arvind Samptur,
Bill Haneman, Akira Tagoh for help with fixes in this release.
- many new translations
- fix an infinite loop while holding a server grab triggered by
some recent Qt versions doing weird stuff
- fix bug where Alt+rightclick repeatedly on titlebar resulted
in zillions of menus
- fix Alt+Tab to *actually* put minimized windows at the end,
though this was always intended
- rewrite size/positions constraint code (currently known
to be quite buggy, e.g. xmms is hosed)
- enforce size of at least 1x1 on windows
- reduce latency of managing new windows still further
by using async properties code in more places
- don't grab keybindings on docks, so gnome-panel
can handle them
- suck in the panel's screenshot and run dialog global
bindings
- lots of improvements to window placement
- sync max number of workspaces with pager applet
- fix to keep focus when inside window frame in
strict mouse focus mode
- make it possible to start a reverse tab with
shift+alt+tab (vs. alt+tab then shift)
- fix a multihead issue with constraints between two
windows on different heads
- require GTK+ 2.2.0 and fontconfig
- default theme is now Simple
- add visual bell feature
- incorporate many fixes from 2.4.34
- other stuff
2.4.13
===
- we were making all dialogs skip the taskbar, even non-transient
ones, though this was supposedly fixed a while ago. Now really
fixed.
- change back to Alt+click by default for the window drag feature.
- assign Alt+F12 to shade window
- fix not deleting enough workspaces when the number
was reduced via the pager config dialog (readams@hmc.edu)
- don't allow windows under the top panel ever, even if they
are tall windows (Arvind)
- fix up the window layout for directional workspace nav,
so you always stop at the edges and always end up
where you expect (hp, with tweaks from readams@hmc.edu)
- focus new windows in mouse focus mode (readams@hmc.edu)
- support xeyes, oclock, etc. by applying shape mask
to the window manager frame (yeah it resizes slow, deal)
- fix vertical/horizontal maximize
- handle crossing events resizing for more opaque resize goodness
(Soeren)
- add wacky _METACITY_UPDATE_COUNTER experimental extension
to do nice opaque resizing (does nothing without a GTK patch)
- fix a crash setting workspace names
- fix internationalized WM_NAME reading

29
README
View File

@@ -6,15 +6,18 @@ on UNIX keyboards.
The first release of Metacity was version 2.3. Metacity has no need for
your petty hangups about version numbers.
The stable releases so far are 2.4.x
Unstable branches are 2.3.x, 2.5.x
COMPILING METACITY
===
You need GTK+ 2.0, ideally the latest in the 2.0.x series. For
multihead/Xinerama support to work, you need GTK+ 2.1.x or 2.2. For
startup notification to work you need libstartup-notification at
You need GTK+ 2.2. For startup notification to work you need
libstartup-notification at
http://www.freedesktop.org/software/startup-notification/ or on the
GNOME ftp site. You also need GConf 1.2 (unless building a funky
extra-small embedded metacity with --disable-gconf).
GNOME ftp site. You also need GConf 1.2 (unless building a funky
extra-small embedded metacity with --disable-gconf, see below).
REPORTING BUGS AND SUBMITTING PATCHES
===
@@ -78,7 +81,7 @@ METACITY FEATURES
- Does not expose the concept of "window manager" to the user. Some
of the features in the GNOME control panel and other parts of the
desktop happen to be implemented in metacity, such as changing your
window border theme, or changing your window navigation shorcuts,
window border theme, or changing your window navigation shortcuts,
but the user doesn't need to know this.
- Includes only the window manager; does not try to be a desktop
@@ -213,6 +216,20 @@ METACITY FEATURES
- and much more! well, maybe not a lot more.
HOW TO ADD EXTERNAL FEATURES
===
You can write a metacity "plugin" such as a pager, window list, icon
box, task menu, or even things like "window matching" using the
Extended Window Manager Hints. See http://www.freedesktop.org for the
EWMH specification. An easy-to-use library called "libwnck" is
available that uses the EWMH and is specifically designed for writing
WM accessories.
You might be interested in existing accessories such as "Devil's Pie"
by Ross Burton, which add features to Metacity (or other
EWMH-compliant WMs).
METACITY BUGS, NON-FEATURES, AND CAVEATS
===

View File

@@ -4,7 +4,8 @@ AC_INIT(src/display.c)
AM_CONFIG_HEADER(config.h)
# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
AM_INIT_AUTOMAKE(metacity, 2.4.8)
# releases on a branch add a 4th version like 2.4.21.1
AM_INIT_AUTOMAKE(metacity, 2.5.1)
# Honor aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
@@ -19,6 +20,7 @@ AC_PROG_INTLTOOL([0.21])
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
changequote(,)dnl
@@ -82,44 +84,54 @@ if test "x$GCC" = "xyes"; then
fi
changequote([,])dnl
METACITY_PC_MODULES='gtk+-2.0 >= 2.0.0'
METACITY_PC_MODULES='gtk+-2.0 >= 2.2.0 pango >= 1.2.0'
AC_ARG_ENABLE(config-dialog, [ --enable-config-dialog enable the config dialog that you need with GNOME 2.0 (obsolete with GNOME 2.2)],enable_config_dialog=yes,enable_config_dialog=no)
AC_ARG_ENABLE(config-dialog, [ --enable-config-dialog enable the config dialog that you need with GNOME 2.0 (obsolete with GNOME 2.2)],,enable_config_dialog=no)
AM_CONDITIONAL(BUILD_CONFIG_DIALOG, test x$enable_config_dialog = xyes)
if test x$enable_config_dialog = xyes; then
AC_DEFINE(BUILD_CONFIG_DIALOG,1,[Build configuration dialog])
fi
AC_ARG_ENABLE(gconf, [ --disable-gconf disable gconf usage, for embedded/size-sensitive non-GNOME builds],enable_gconf=no,enable_gconf=yes)
AC_ARG_ENABLE(gconf, [ --disable-gconf disable gconf usage, for embedded/size-sensitive non-GNOME builds],,enable_gconf=yes)
if test x$enable_gconf = xyes; then
AC_DEFINE(HAVE_GCONF,1,[Build with gconf support])
METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
fi
AC_ARG_ENABLE(verbose-mode, [ --disable-verbose disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds],enable_verbose_mode=no,enable_verbose_mode=yes)
AC_ARG_ENABLE(verbose-mode, [ --disable-verbose disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds],,enable_verbose_mode=yes)
if test x$enable_verbose_mode = xyes; then
AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
fi
AC_ARG_ENABLE(sm, [ --disable-sm disable metacity's session management support, for embedded/size-sensitive custom non-GNOME builds],enable_sm=no,enable_sm=auto)
AC_ARG_ENABLE(sm, [ --disable-sm disable metacity's session management support, for embedded/size-sensitive custom non-GNOME builds],,enable_sm=auto)
AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable metacity's startup notification support, for embedded/size-sensitive custom non-GNOME builds],enable_startup_notification=no,enable_startup_notification=auto)
AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable metacity's startup notification support, for embedded/size-sensitive custom non-GNOME builds],,enable_startup_notification=auto)
AC_ARG_ENABLE(xsync, [ --disable-xsync disable metacity's use of the XSync extension],,enable_xsync=auto)
AC_ARG_ENABLE(shape, [ --disable-shape disable metacity's use of the shaped window extension],,enable_shape=auto)
## try definining HAVE_BACKTRACE
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
ALL_LINGUAS="az ca cs da de el es fr gl hu it ja ko lv ms no pl pt pt_BR ro ru sk sv tr uk vi zh_CN zh_TW"
ALL_LINGUAS="am az be bg ca cs da de el en_GB es fa fi fr ga gl he hu it ja ko lv mk ml mn ms nl no pl pt pt_BR ro ru sl sk sv tr uk vi zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
## here we get the flags we'll actually use
PKG_CHECK_MODULES(METACITY_MESSAGE, gtk+-2.0 >= 2.0.0)
PKG_CHECK_MODULES(METACITY_WINDOW_DEMO, gtk+-2.0 >= 2.0.0)
PKG_CHECK_MODULES(METACITY_MESSAGE, gtk+-2.0 >= 2.2.0)
PKG_CHECK_MODULES(METACITY_WINDOW_DEMO, gtk+-2.0 >= 2.2.0)
if test x$enable_config_dialog = xyes; then
PKG_CHECK_MODULES(METACITY_PROPS, gtk+-2.0 >= 2.0.0 gconf-2.0 >= 1.1.9 libglade-2.0)
PKG_CHECK_MODULES(METACITY_PROPS, gtk+-2.0 >= 2.2.0 gconf-2.0 >= 1.1.9 libglade-2.0)
fi
if $PKG_CONFIG --atleast-version 1.2.0 pangoxft; then
echo "pangoxft found"
else
AC_MSG_ERROR("Pango 1.2.0 or greater based on Xft2 is required")
fi
STARTUP_NOTIFICATION_VERSION=0.4
@@ -150,13 +162,6 @@ fi
PKG_CHECK_MODULES(METACITY, $METACITY_PC_MODULES)
if $PKG_CONFIG --atleast-version 2.1.0 gtk+-2.0; then
AC_DEFINE(HAVE_GTK_MULTIHEAD,,[gtk+ with multihead support found])
with_multihead=yes
else
with_multihead=no
fi
AC_PATH_XTRA
ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
@@ -215,10 +220,32 @@ AC_CHECK_LIB(Xext, XShapeQueryExtension,
SHAPE_LIBS=-lXext found_shape=yes)],
, $ALL_X_LIBS)
if test x$enable_shape = xno; then
found_shape=no
fi
if test x$enable_shape = xyes; then
if test "$found_shape" = "no"; then
AC_MSG_ERROR([--enable-shape forced and Shape not found])
exit 1
fi
fi
if test "x$found_shape" = "xyes"; then
AC_DEFINE(HAVE_SHAPE, , [Have the shape extension library])
fi
found_xkb=no
AC_CHECK_LIB(X11, XkbQueryExtension,
[AC_CHECK_HEADER(X11/XKBlib.h,
found_xkb=yes)],
, $ALL_X_LIBS)
if test "x$found_xkb" = "xyes"; then
AC_DEFINE(HAVE_XKB, , [Have keyboard extension library])
fi
RANDR_LIBS=
found_randr=no
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
@@ -231,7 +258,31 @@ if test "x$found_randr" = "xyes"; then
AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library])
fi
METACITY_LIBS="$RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_LIBS"
XSYNC_LIBS=
found_xsync=no
AC_CHECK_LIB(Xext, XSyncQueryExtension,
[AC_CHECK_HEADER(X11/extensions/sync.h,
found_xsync=yes,,
[#include <X11/Xlib.h>])],
, $ALL_X_LIBS)
if test x$enable_xsync = xno; then
found_xsync=no
fi
if test x$enable_xsync = xyes; then
if test "$found_xsync" = "no"; then
AC_MSG_ERROR([--enable-xsync forced and XSync not found])
exit 1
fi
fi
if test "x$found_xsync" = "xyes"; then
XSYNC_LIBS=-lXext
AC_DEFINE(HAVE_XSYNC, , [Have the Xsync extension library])
fi
METACITY_LIBS="$XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_LIBS"
METACITY_MESSAGE_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_MESSAGE_LIBS"
METACITY_WINDOW_DEMO_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_WINDOW_DEMO_LIBS"
METACITY_PROPS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_PROPS_LIBS"
@@ -333,10 +384,11 @@ metacity-$VERSION:
GConf: ${enable_gconf}
XFree86 Xinerama: ${use_xfree_xinerama}
Solaris Xinerama: ${use_solaris_xinerama}
Multihead: ${with_multihead}
Startup notification: ${have_startup_notification}
Session management: ${found_sm}
Shape extension: ${found_shape}
Resize-and-rotate: ${found_randr}
Xsync: ${found_xsync}
Deprecated config dialog: ${enable_config_dialog}
"
echo "This is the UNSTABLE branch of metacity, use 2.4.x for stable (gnome-2-2 branch in CVS)"

View File

@@ -1,2 +1,2 @@
EXTRA_DIST=theme-format.txt metacity-theme.dtd
EXTRA_DIST=theme-format.txt metacity-theme.dtd dialogs.txt

32
doc/dialogs.txt Normal file
View File

@@ -0,0 +1,32 @@
Dialogs which have no transient parent or root window being
their tranisent parent are the ones which will be visible in
the tasklist.
All such dialogs will be *always* on top of the window
group i.e they would transients for the whole group.
1) Modal dialogs
* If you wish to open another window from a modal dialog
open *only* a modal dialog and set it's transient parent.
2) Normal dialog
without transient parent
* If you wish to open another window from a normal dialog
open either a normal dialog or a modal dialog only.
Set the transient parent for the child dialog if you do not
want them to be transient for all the other windows in the group.
with transient parent
* If you wish to open another window from a normal dialog
you could open any type of window.

View File

@@ -70,7 +70,7 @@
<!ATTLIST frame
focus (yes|no) #REQUIRED
state (normal|maximized|shaded|maximized_and_shaded) #REQUIRED
resize (both|horizontal|vertical|none) #REQUIRED
resize (both|horizontal|vertical|none) #IMPLIED
style CDATA #REQUIRED
>
@@ -153,7 +153,7 @@
filled %boolean; 'false'
>
<!ELEMENT arc EMTPY>
<!ELEMENT arc EMPTY>
<!ATTLIST arc
color CDATA #REQUIRED
%xyrequired;

View File

@@ -1,3 +1,315 @@
2003-04-29 Miloslav Trmac <mitr@volny.cz>
* cs.po: Updated Czech translation.
2003-04-15 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-04-03 Christophe Merlet <redfox@redfoxcenter.org>
* fr.po: Updated French translation.
2003-03-27 Christophe Merlet <redfox@redfoxcenter.org>
* fr.po: Updated French translation.
2003-03-13 Christian Rose <menthos@menthos.com>
* ml.po: Added Malayalam translation by
FSF-India <locale@gnu.org.in>.
2003-03-11 Paul Duffy <dubhthach@zion.nuigalway.ie>
* ga.po: Added Irish translation
2003-03-10 Roozbeh Pournader <roozbeh@sharif.edu>
* fa.po: Added Persian translation.
2003-02-26 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* be.po: Added Belarusian translation
from Belarusian team <i18n@infonet.by>.
2003-02-25 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
* es.po: Fixed a translation string to match with libwnck.
2003-02-22 Rob Adams <robadams@ucla.edu>
* *.po: change toggle_maximized to toggle_maximize and
toggle_shaded to toggle_shade in action_double_click_titlebar long
description to match the values used by metacity
2003-02-12 Christian Rose <menthos@menthos.com>
* sv.po: Some fixes for problems catched in translation review.
2003-02-11 Fatih Demir <kabalak@gtranslator.org>
* tr.po: Branchy.
2003-02-09 Fatih Demir <kabalak@gtranslator.org>
* tr.po: Take over from branch...
2003-02-08 Fatih Demir <kabalak@gtranslator.org>
* tr.po: Committed updated Turkish translation by Sinan.
2003-02-05 Abel Cheung <maddog@linux.org.hk>
* en_GB.po: Fix header.
* ko.po, pt_BR.po: Fix positional parameters.
2003-02-05 Abel Cheung <maddog@linux.org.hk>
* zh_TW.po: Updated traditional Chinese translation.
2003-02-03 Daniel Yacob <locales@geez.org>
* am.po: Updated Amharic translation.
2003-01-30 Marius Andreiana <marius galuna.ro>
* ro.po: updated ( thanks to Mugurel Tudor )
2003-01-25 Christophe Merlet <redfox@redfoxcenter.org>
* fr.po: Updated French translation from
Guy Clotilde <guy.clotilde@wanadoo.fr>.
2003-01-25 Kjartan Maraas <kmaraas@gnome.org>
* no.po: Updated Norwegian (bokmal) translation.
2003-01-23 He Qiangqiang <carton@linux.net.cn>
* zh_CN.po: Updated Simplified Chinese translation by
Xiong Jiang <jxiong@offtopic.org>.
2003-01-23 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-01-23 Abel Cheung <maddog@linux.org.hk>
* zh_TW.po: Updated traditional Chinese translation.
2003-01-22 Christian Rose <menthos@menthos.com>
* mn.po: Added Mongolian translation by
Ochirbat Batzaya <buuvei@yahoo.com>.
2003-01-21 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-01-21 Kjartan Maraas <kmaraas@gnome.org>
* no.po: Updated Norwegian (bokmal) translation.
2003-01-20 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation.
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
* ru.po: updated Russian translation
from Russian team <gnome-cyr@gnome.org>.
2003-01-19 Abel Cheung <maddog@linux.org.hk>
* zh_TW.po: Updated traditional Chinese translation, and replaced
copyright symbol with correct one.
2003-01-17 Gustavo Noronha Silva <kov@debian.org>
* pt_BR.po: translation update
2003-01-16 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
* nl.po: Dutch translation updated by Tino Meinen.
2003-01-16 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
* nl.po: Dutch translation updated by Tino Meinen.
2003-01-14 Yanko Kaneti <yaneti@declera.com>
* bg.po: Full Bulgarian translation by
Alexander Shopov <al_shopov@yahoo.com>.
2003-01-11 Kjartan Maraas <kmaraas@gnome.org>
* no.po: Updated Norwegian (bokmal) translation.
2003-01-10 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
* nl.po: Dutch translation updated by Tino Meinen.
2003-01-10 Andras Timar <timar@gnome.hu>
* hu.po: Updated Hungarian translation.
2003-01-10 Yukihiro Nakai <nakai@gnome.gr.jp>
* ja.po: Minor fix.
2003-01-09 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
* nl.po: Dutch translation updated by Tino Meinen.
2003-01-08 Pauli Virtanen <pauli.virtanen@hut.fi>
* fi.po: Fixed a string that had an invalid printf format.
2003-01-09 Abel Cheung <maddog@linux.org.hk>
* zh_TW.po: Updated traditional Chinese translation.
2003-01-07 Daniel Yacob <locales@geez.org>
* am.po: Updated Amharic translation.
2003-01-06 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
* nl.po: Dutch translation added by Tino Meinen.
2003-01-05 Pablo Saratxaga <pablo@mandrakesoft.com>
* vi.po: Updated Vietnamese file
* pt_BR.po: fixed syntax errors
2003-01-05 Pauli Virtanen <pauli.virtanen@hut.fi>
* fi.po: Added Finnish translation.
2003-01-05 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
* sk.po: Updated Slovak translation.
2003-01-03 Kjartan Maraas <kmaraas@gnome.org>
* no.po: Updated Norwegian (bokmal) translation.
2003-01-02 Zbigniew Chyla <cyba@gnome.pl>
* pl.po: Updated Polish translation by
GNOME PL Team <translators@gnome.pl>.
2002-12-29 Daniel Yacob <locales@geez.org>
* am.po: Updated Amharic translation.
2002-12-29 Kostas Papadimas <pkst@gmx.net>
* el.po: Updated Greek translation.
2002-12-25 Ole Laursen <olau@hardworking.dk>
* da.po: Updated Danish translation.
2002-12-25 Kostas Papadimas <pkst@gmx.net>
* el.po: Updated Greek translation.
2002-12-22 Daniel Yacob <locales@geez.org>
* am.po: Updated Amharic translation.
2002-12-22 Artis Trops <hornet@navigator.lv>
* lv.po: Updated Latvian translation.
2002-12-21 Daniel Yacob <locales@geez.org>
* am.po: Updated Amharic translation.
2002-12-20 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation.
2002-12-20 Miloslav Trmac <mitr@volny.cz>
* cs.po: Updated Czech translation.
2002-12-19 Hasbullah Bin Pit <sebol@ikhlas.com>
* ms.po: Updated Malay Translation.
2002-12-19 Yanko Kaneti <yaneti@declera.com>
* bg.po (added): Added start of Bulgarian translation by
Alexander Shopov <al_shopov@yahoo.com>.
2002-12-18 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
* es.po: Updated Spanish translation.
2002-12-17 Miloslav Trmac <mitr@volny.cz>
* cs.po: Updated Czech translation.
2002-12-17 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
2002-12-17 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
2002-12-16 Christian Neumair <chris@gnome-de.org>
* de.po: Updated German translation.
2002-12-16 Miloslav Trmac <mitr@volny.cz>
* cs.po: Updated Czech translation.
2002-12-16 Ole Laursen <olau@hardworking.dk>
* da.po: Updated Danish translation.
2002-12-14 Kjartan Maraas <kmaraas@gnome.org>
* no.po: Updated Norwegian (bokmål) translation.
2002-12-13 Daniel Yacob <locales@geez.org>
* am.po: Added Amharic translation.
2002-12-13 Christian Rose <menthos@menthos.com>
* sv.po: Updated Swedish translation.
2002-12-12 Ole Laursen <olau@hardworking.dk>
* da.po: Updated Danish translation.
2002-12-11 Christian Neumair <chris@gnome-de.org>
* POTFILES.in: Added src/tools/metacity-message.c.
* de.po: Updated German translation.
2002-12-11 Evandro Fernandes Giovanini <evandrofg@ig.com.br>
* pt_BR.po: Updated Brazilian Portuguese translation.
2002-12-09 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
* es.po: Updated Spanish translation.

View File

@@ -1,5 +1,6 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
src/tools/metacity-message.c
src/delete.c
src/display.c
src/errors.c

2430
po/am.po Normal file

File diff suppressed because it is too large Load Diff

493
po/az.po

File diff suppressed because it is too large Load Diff

2999
po/be.po Normal file

File diff suppressed because it is too large Load Diff

2937
po/bg.po Normal file

File diff suppressed because it is too large Load Diff

495
po/ca.po

File diff suppressed because it is too large Load Diff

552
po/cs.po

File diff suppressed because it is too large Load Diff

619
po/da.po

File diff suppressed because it is too large Load Diff

1312
po/de.po

File diff suppressed because it is too large Load Diff

639
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1290
po/es.po

File diff suppressed because it is too large Load Diff

2421
po/fa.po Normal file

File diff suppressed because it is too large Load Diff

2921
po/fi.po Normal file

File diff suppressed because it is too large Load Diff

1583
po/fr.po

File diff suppressed because it is too large Load Diff

2419
po/ga.po Normal file

File diff suppressed because it is too large Load Diff

493
po/gl.po

File diff suppressed because it is too large Load Diff

2442
po/he.po Normal file

File diff suppressed because it is too large Load Diff

538
po/hu.po

File diff suppressed because it is too large Load Diff

495
po/it.po

File diff suppressed because it is too large Load Diff

529
po/ja.po

File diff suppressed because it is too large Load Diff

498
po/ko.po

File diff suppressed because it is too large Load Diff

620
po/lv.po

File diff suppressed because it is too large Load Diff

2418
po/mk.po Normal file

File diff suppressed because it is too large Load Diff

2424
po/ml.po Normal file

File diff suppressed because it is too large Load Diff

2951
po/mn.po Normal file

File diff suppressed because it is too large Load Diff

576
po/ms.po

File diff suppressed because it is too large Load Diff

2976
po/nl.po Normal file

File diff suppressed because it is too large Load Diff

1043
po/no.po

File diff suppressed because it is too large Load Diff

761
po/pl.po

File diff suppressed because it is too large Load Diff

495
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

835
po/ro.po

File diff suppressed because it is too large Load Diff

1374
po/ru.po

File diff suppressed because it is too large Load Diff

918
po/sk.po

File diff suppressed because it is too large Load Diff

2529
po/sl.po Normal file

File diff suppressed because it is too large Load Diff

697
po/sv.po

File diff suppressed because it is too large Load Diff

1581
po/tr.po

File diff suppressed because it is too large Load Diff

1587
po/uk.po

File diff suppressed because it is too large Load Diff

773
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6,3 +6,13 @@ Opaque resize: http://bugzilla.gnome.org/show_bug.cgi?id=92618
Super+click to resize: http://bugzilla.gnome.org/show_bug.cgi?id=79315
minimized windows in Alt+tab: http://bugzilla.gnome.org/show_bug.cgi?id=89416
raise windows on click: http://bugzilla.gnome.org/show_bug.cgi?id=86108
dialogs above entire app group: http://bugzilla.gnome.org/show_bug.cgi?id=88926
display window size/position: http://bugzilla.gnome.org/show_bug.cgi?id=85213,
http://bugzilla.gnome.org/show_bug.cgi?id=106645
configure click actions, alt+click:
http://bugzilla.gnome.org/show_bug.cgi?id=83210
system modal dialogs: http://bugzilla.gnome.org/show_bug.cgi?id=83357
workspace wrapping: http://bugzilla.gnome.org/show_bug.cgi?id=89315

View File

@@ -11,7 +11,11 @@ EGGFILES= \
metacity_SOURCES= \
async-getprop.c \
async-getprop.h \
bell.h \
bell.c \
common.h \
constraints.c \
constraints.h \
core.c \
core.h \
delete.c \
@@ -97,6 +101,9 @@ libmetacity_private_la_SOURCES= \
util.h \
common.h
libmetacity_private_la_LDFLAGS = -no-undefined
libmetacity_private_la_LIBADD = @METACITY_LIBS@
libmetacityincludedir = $(includedir)/metacity-1/metacity-private
libmetacityinclude_HEADERS = \
@@ -131,7 +138,8 @@ testasyncgetprop_LDADD= @METACITY_LIBS@
desktopfilesdir=$(datadir)/gnome/wm-properties
desktopfiles_in_files=metacity.desktop.in
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
desktopfiles_files=$(desktopfiles_in_files:.desktop.in=.desktop)
desktopfiles_DATA = $(desktopfiles_files)
@INTLTOOL_DESKTOP_RULE@
schemadir = @GCONF_SCHEMA_FILE_DIR@
@@ -159,7 +167,7 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libmetacity-private.pc
EXTRA_DIST=$(desktopfiles_DATA) \
EXTRA_DIST=$(desktopfiles_files) \
$(IMAGES) $(schema_DATA) \
update-from-egg.sh \
$(desktopfiles_in_files) \

View File

@@ -347,7 +347,7 @@ async_get_property_handler (Display *dpy,
break;
case 32:
nbytes = reply->nItems * sizeof (long);
nbytes = reply->nItems * sizeof (CARD32);
netbytes = reply->nItems << 2;
if (nbytes + 1 > 0 &&
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))

250
src/bell.c Normal file
View File

@@ -0,0 +1,250 @@
/* Metacity visual bell */
/*
* Copyright (C) 2002 Sun Microsystems Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <config.h>
#include "bell.h"
#include "screen.h"
#include "prefs.h"
static void
meta_bell_flash_screen (MetaDisplay *display,
MetaScreen *screen)
{
Window root = screen->xroot;
int width = screen->width;
int height = screen->height;
if (screen->flash_window == None)
{
Visual *visual = CopyFromParent;
XSetWindowAttributes xswa;
int depth = CopyFromParent;
xswa.save_under = True;
xswa.override_redirect = True;
/*
* TODO: use XGetVisualInfo and determine which is an
* overlay, if one is present, and use the Overlay visual
* for this window (for performance reasons).
* Not sure how to tell this yet...
*/
screen->flash_window = XCreateWindow (display->xdisplay, root,
0, 0, width, height,
0, depth,
InputOutput,
visual,
/* note: XSun doesn't like SaveUnder here */
CWSaveUnder | CWOverrideRedirect,
&xswa);
XSelectInput (display->xdisplay, screen->flash_window, ExposureMask);
XMapWindow (display->xdisplay, screen->flash_window);
XSync (display->xdisplay, False);
XFlush (display->xdisplay);
XUnmapWindow (display->xdisplay, screen->flash_window);
}
else
{
/* just draw something in the window */
GC gc = XCreateGC (display->xdisplay, screen->flash_window, 0, NULL);
XMapWindow (display->xdisplay, screen->flash_window);
XSetForeground (display->xdisplay, gc,
WhitePixel (display->xdisplay,
XScreenNumberOfScreen (screen->xscreen)));
XFillRectangle (display->xdisplay, screen->flash_window, gc,
0, 0, width, height);
XSetForeground (display->xdisplay, gc,
BlackPixel (display->xdisplay,
XScreenNumberOfScreen (screen->xscreen)));
XFillRectangle (display->xdisplay, screen->flash_window, gc,
0, 0, width, height);
XFlush (display->xdisplay);
XSync (display->xdisplay, False);
XUnmapWindow (display->xdisplay, screen->flash_window);
}
XFlush (display->xdisplay);
}
#ifdef HAVE_XKB
static void
meta_bell_flash_fullscreen (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
XkbBellNotifyEvent *xkb_bell_ev = (XkbBellNotifyEvent *) xkb_ev;
MetaScreen *screen;
g_assert (xkb_ev->xkb_type == XkbBellNotify);
if (xkb_bell_ev->window != None)
{
screen = meta_display_screen_for_xwindow (display, xkb_bell_ev->window);
if (screen)
meta_bell_flash_screen (display, screen);
}
else
{
GSList *screen_list = display->screens;
while (screen_list)
{
screen = (MetaScreen *) screen_list->data;
meta_bell_flash_screen (display, screen);
screen_list = screen_list->next;
}
}
}
static gboolean
meta_bell_unflash_frame (gpointer data)
{
MetaFrame *frame = (MetaFrame *) data;
frame->is_flashing = 0;
meta_frame_queue_draw (frame);
return FALSE;
}
static void
meta_bell_flash_window_frame (MetaWindow *window)
{
g_assert (window->frame != NULL);
window->frame->is_flashing = 1;
meta_frame_queue_draw (window->frame);
g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 100,
meta_bell_unflash_frame, window->frame, NULL);
}
static void
meta_bell_flash_frame (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev;
MetaWindow *window;
g_assert (xkb_ev->xkb_type == XkbBellNotify);
window = meta_display_lookup_x_window (display, xkb_bell_event->window);
if (!window && (display->focus_window->frame))
{
window = display->focus_window;
}
if (window)
{
meta_bell_flash_window_frame (window);
}
else /* revert to fullscreen flash if there's no focussed window */
{
meta_bell_flash_fullscreen (display, xkb_ev);
}
}
static void
meta_bell_visual_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
switch (meta_prefs_get_visual_bell_type ())
{
case META_VISUAL_BELL_FULLSCREEN_FLASH:
meta_bell_flash_fullscreen (display, xkb_ev);
break;
case META_VISUAL_BELL_FRAME_FLASH:
meta_bell_flash_frame (display, xkb_ev); /* does nothing yet */
break;
case META_VISUAL_BELL_INVALID:
/* do nothing */
break;
}
}
void
meta_bell_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev)
{
/* flash something */
if (meta_prefs_get_visual_bell ())
meta_bell_visual_notify (display, xkb_ev);
}
#endif
void
meta_bell_set_audible (MetaDisplay *display, gboolean audible)
{
#ifdef HAVE_XKB
XkbChangeEnabledControls (display->xdisplay,
XkbUseCoreKbd,
XkbAudibleBellMask,
audible ? XkbAudibleBellMask : 0);
#endif
}
gboolean
meta_bell_init (MetaDisplay *display)
{
#ifdef HAVE_XKB
int xkb_base_error_type, xkb_opcode;
if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
&display->xkb_base_event_type,
&xkb_base_error_type,
NULL, NULL))
{
display->xkb_base_event_type = -1;
g_message ("could not find XKB extension.");
return FALSE;
}
else
{
unsigned int mask = XkbBellNotifyMask;
gboolean visual_bell_auto_reset = FALSE;
/* TRUE if and when non-broken version is available */
XkbSelectEvents (display->xdisplay,
XkbUseCoreKbd,
XkbBellNotifyMask,
XkbBellNotifyMask);
XkbChangeEnabledControls (display->xdisplay,
XkbUseCoreKbd,
XkbAudibleBellMask,
meta_prefs_bell_is_audible ()
? XkbAudibleBellMask : 0);
if (visual_bell_auto_reset) {
XkbSetAutoResetControls (display->xdisplay,
XkbAudibleBellMask,
&mask,
&mask);
}
return TRUE;
}
#endif
return FALSE;
}
void
meta_bell_shutdown (MetaDisplay *display)
{
#ifdef HAVE_XKB
/* TODO: persist initial bell state in display, reset here */
XkbChangeEnabledControls (display->xdisplay,
XkbUseCoreKbd,
XkbAudibleBellMask,
XkbAudibleBellMask);
#endif
}
void
meta_bell_notify_frame_destroy (MetaFrame *frame)
{
if (frame->is_flashing)
g_idle_remove_by_data (frame);
}

35
src/bell.h Normal file
View File

@@ -0,0 +1,35 @@
/* Metacity visual bell */
/*
* Copyright (C) 2002 Sun Microsystems Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include <X11/Xlib.h>
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#include "display.h"
#include "frame.h"
#ifdef HAVE_XKB
void meta_bell_notify (MetaDisplay *display, XkbAnyEvent *xkb_ev);
#endif
void meta_bell_set_audible (MetaDisplay *display, gboolean audible);
gboolean meta_bell_init (MetaDisplay *display);
void meta_bell_shutdown (MetaDisplay *display);
void meta_bell_notify_frame_destroy (MetaFrame *frame);

View File

@@ -42,7 +42,8 @@ typedef enum
META_FRAME_MAXIMIZED = 1 << 9,
META_FRAME_ALLOWS_SHADE = 1 << 10,
META_FRAME_ALLOWS_MOVE = 1 << 11,
META_FRAME_FULLSCREEN = 1 << 12
META_FRAME_FULLSCREEN = 1 << 12,
META_FRAME_IS_FLASHING = 1 << 13
} MetaFrameFlags;
typedef enum

File diff suppressed because it is too large Load Diff

View File

@@ -46,6 +46,22 @@ meta_core_get_client_size (Display *xdisplay,
*height = window->rect.height;
}
Window
meta_core_get_client_xwindow (Display *xdisplay,
Window frame_xwindow)
{
MetaDisplay *display;
MetaWindow *window;
display = meta_display_for_x_display (xdisplay);
window = meta_display_lookup_x_window (display, frame_xwindow);
if (window == NULL || window->frame == NULL)
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
return window->xwindow;
}
MetaFrameFlags
meta_core_get_frame_flags (Display *xdisplay,
Window frame_xwindow)

View File

@@ -31,6 +31,9 @@ void meta_core_get_client_size (Display *xdisplay,
int *width,
int *height);
Window meta_core_get_client_xwindow (Display *xdisplay,
Window frame_xwindow);
MetaFrameFlags meta_core_get_frame_flags (Display *xdisplay,
Window frame_xwindow);
MetaFrameType meta_core_get_frame_type (Display *xdisplay,

View File

@@ -2,6 +2,7 @@
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -33,6 +34,7 @@
#include "prefs.h"
#include "resizepopup.h"
#include "workspace.h"
#include "bell.h"
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#ifdef HAVE_SOLARIS_XINERAMA
@@ -41,6 +43,15 @@
#ifdef HAVE_XFREE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#ifdef HAVE_RANDR
#include <X11/extensions/Xrandr.h>
#endif
#ifdef HAVE_SHAPE
#include <X11/extensions/shape.h>
#endif
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#include <string.h>
#define USE_GDK_DISPLAY
@@ -253,7 +264,12 @@ meta_display_open (const char *name)
"_NET_WM_STATE_ABOVE",
"_NET_WM_STATE_BELOW",
"_NET_STARTUP_ID",
"_METACITY_TOGGLE_VERBOSE"
"_METACITY_TOGGLE_VERBOSE",
"_METACITY_UPDATE_COUNTER",
"SYNC_COUNTER",
"_GNOME_PANEL_ACTION",
"_GNOME_PANEL_ACTION_MAIN_MENU",
"_GNOME_PANEL_ACTION_RUN_DIALOG"
};
Atom atoms[G_N_ELEMENTS(atom_names)];
@@ -302,6 +318,8 @@ meta_display_open (const char *name)
/* we have to go ahead and do this so error handlers work */
all_displays = g_slist_prepend (all_displays, display);
meta_bell_init (display);
meta_display_init_keys (display);
update_window_grab_modifiers (display);
@@ -389,6 +407,11 @@ meta_display_open (const char *name)
display->atom_net_wm_state_below = atoms[76];
display->atom_net_startup_id = atoms[77];
display->atom_metacity_toggle_verbose = atoms[78];
display->atom_metacity_update_counter = atoms[79];
display->atom_sync_counter = atoms[80];
display->atom_gnome_panel_action = atoms[81];
display->atom_gnome_panel_action_main_menu = atoms[82];
display->atom_gnome_panel_action_run_dialog = atoms[83];
display->prop_hooks = NULL;
meta_display_init_window_prop_hooks (display);
@@ -453,9 +476,58 @@ meta_display_open (const char *name)
display->grab_screen = NULL;
display->grab_resize_popup = NULL;
#ifdef HAVE_XSYNC
{
int major, minor;
display->xsync_error_base = 0;
display->xsync_event_base = 0;
/* I don't think we really have to fill these in */
major = SYNC_MAJOR_VERSION;
minor = SYNC_MINOR_VERSION;
if (!XSyncQueryExtension (display->xdisplay,
&display->xsync_event_base,
&display->xsync_error_base) ||
!XSyncInitialize (display->xdisplay,
&major, &minor))
{
display->xsync_error_base = 0;
display->xsync_event_base = 0;
}
meta_verbose ("Attempted to init Xsync, found version %d.%d error base %d event base %d\n",
major, minor,
display->xsync_error_base,
display->xsync_event_base);
}
#else /* HAVE_XSYNC */
meta_verbose ("Not compiled with Xsync support\n");
#endif /* !HAVE_XSYNC */
#ifdef HAVE_SHAPE
{
display->shape_error_base = 0;
display->shape_event_base = 0;
if (!XShapeQueryExtension (display->xdisplay,
&display->shape_event_base,
&display->shape_error_base))
{
display->shape_error_base = 0;
display->shape_event_base = 0;
}
meta_verbose ("Attempted to init Shape, found error base %d event base %d\n",
display->shape_error_base,
display->shape_event_base);
}
#else /* HAVE_SHAPE */
meta_verbose ("Not compiled with Shape support\n");
#endif /* !HAVE_SHAPE */
screens = NULL;
#ifdef HAVE_GTK_MULTIHEAD
i = 0;
while (i < ScreenCount (xdisplay))
{
@@ -467,14 +539,6 @@ meta_display_open (const char *name)
screens = g_slist_prepend (screens, screen);
++i;
}
#else
{
MetaScreen *screen;
screen = meta_screen_new (display, DefaultScreen (xdisplay));
if (screen)
screens = g_slist_prepend (screens, screen);
}
#endif
display->screens = screens;
@@ -896,6 +960,51 @@ grab_op_is_keyboard (MetaGrabOp op)
}
}
gboolean
meta_grab_op_is_resizing (MetaGrabOp op)
{
switch (op)
{
case META_GRAB_OP_RESIZING_SE:
case META_GRAB_OP_RESIZING_S:
case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW:
case META_GRAB_OP_RESIZING_W:
case META_GRAB_OP_RESIZING_E:
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
case META_GRAB_OP_KEYBOARD_RESIZING_S:
case META_GRAB_OP_KEYBOARD_RESIZING_N:
case META_GRAB_OP_KEYBOARD_RESIZING_W:
case META_GRAB_OP_KEYBOARD_RESIZING_E:
case META_GRAB_OP_KEYBOARD_RESIZING_SE:
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
return TRUE;
break;
default:
return FALSE;
}
}
gboolean
meta_grab_op_is_moving (MetaGrabOp op)
{
switch (op)
{
case META_GRAB_OP_MOVING:
case META_GRAB_OP_KEYBOARD_MOVING:
return TRUE;
break;
default:
return FALSE;
}
}
/* Get time of current event, or CurrentTime if none. */
guint32
meta_display_get_current_time (MetaDisplay *display)
@@ -1093,6 +1202,70 @@ event_callback (XEvent *event,
frame_was_receiver = TRUE;
meta_topic (META_DEBUG_EVENTS, "Frame was receiver of event\n");
}
#ifdef HAVE_XSYNC
if (META_DISPLAY_HAS_XSYNC (display) &&
event->type == (display->xsync_event_base + XSyncAlarmNotify) &&
((XSyncAlarmNotifyEvent*)event)->alarm == display->grab_update_alarm)
{
filter_out_event = TRUE; /* GTK doesn't want to see this really */
if (display->grab_op != META_GRAB_OP_NONE &&
display->grab_window != NULL &&
grab_op_is_mouse (display->grab_op))
meta_window_handle_mouse_grab_op_event (display->grab_window, event);
}
#endif /* HAVE_XSYNC */
#ifdef HAVE_SHAPE
if (META_DISPLAY_HAS_SHAPE (display) &&
event->type == (display->shape_event_base + ShapeNotify))
{
filter_out_event = TRUE; /* GTK doesn't want to see this really */
if (window && !frame_was_receiver)
{
XShapeEvent *sev = (XShapeEvent*) event;
if (sev->kind == ShapeBounding)
{
if (sev->shaped && !window->has_shape)
{
window->has_shape = TRUE;
meta_topic (META_DEBUG_SHAPES,
"Window %s now has a shape\n",
window->desc);
}
else if (!sev->shaped && window->has_shape)
{
window->has_shape = FALSE;
meta_topic (META_DEBUG_SHAPES,
"Window %s no longer has a shape\n",
window->desc);
}
else
{
meta_topic (META_DEBUG_SHAPES,
"Window %s shape changed\n",
window->desc);
}
if (window->frame)
{
window->frame->need_reapply_frame_shape = TRUE;
meta_window_queue_move_resize (window);
}
}
}
else
{
meta_topic (META_DEBUG_SHAPES,
"ShapeNotify not on a client window (window %s frame_was_receiver = %d)\n",
window ? window->desc : "(none)",
frame_was_receiver);
}
}
#endif /* HAVE_SHAPE */
switch (event->type)
{
@@ -1107,11 +1280,12 @@ event_callback (XEvent *event,
display->grab_window == window) ||
grab_op_is_keyboard (display->grab_op))
{
meta_verbose ("Ending grab op %d on window %s due to button press\n",
display->grab_op,
(display->grab_window ?
display->grab_window->desc :
"none"));
meta_topic (META_DEBUG_WINDOW_OPS,
"Ending grab op %d on window %s due to button press\n",
display->grab_op,
(display->grab_window ?
display->grab_window->desc :
"none"));
meta_display_end_grab_op (display,
event->xbutton.time);
}
@@ -1132,14 +1306,14 @@ event_callback (XEvent *event,
*/
unmodified = (event->xbutton.state & grab_mask) == 0;
if ((unmodified && event->xbutton.button != 2) ||
if (unmodified ||
event->xbutton.button == 1)
{
if (!frame_was_receiver)
{
/* don't focus if frame received, will be
* done in frames.c if the click wasn't on
* the minimize/close button.
/* don't focus if frame received, will be lowered in
* frames.c or special-cased if the click was on a
* minimize/close button.
*/
meta_window_raise (window);
@@ -1242,19 +1416,22 @@ event_callback (XEvent *event,
}
break;
case ButtonRelease:
if (grab_op_is_mouse (display->grab_op) &&
display->grab_window == window)
if (display->grab_window == window &&
grab_op_is_mouse (display->grab_op))
meta_window_handle_mouse_grab_op_event (window, event);
break;
case MotionNotify:
if (grab_op_is_mouse (display->grab_op) &&
display->grab_window == window)
if (display->grab_window == window &&
grab_op_is_mouse (display->grab_op))
meta_window_handle_mouse_grab_op_event (window, event);
break;
case EnterNotify:
if (display->grab_window == window &&
grab_op_is_mouse (display->grab_op))
meta_window_handle_mouse_grab_op_event (window, event);
/* do this even if window->has_focus to avoid races */
if (window && !serial_is_ignored (display, event->xany.serial) &&
event->xcrossing.detail != NotifyInferior)
else if (window && !serial_is_ignored (display, event->xany.serial) &&
event->xcrossing.detail != NotifyInferior)
{
switch (meta_prefs_get_focus_mode ())
{
@@ -1311,18 +1488,16 @@ event_callback (XEvent *event,
}
break;
case LeaveNotify:
if (window)
if (display->grab_window == window &&
grab_op_is_mouse (display->grab_op))
meta_window_handle_mouse_grab_op_event (window, event);
else if (window != NULL)
{
switch (meta_prefs_get_focus_mode ())
{
case META_FOCUS_MODE_MOUSE:
/* This is kind of questionable; but we normally
* set focus to RevertToPointerRoot, so I guess
* leaving it on PointerRoot when nothing is focused
* is probably right. Anyway, unfocus the
* focused window.
*/
if (window->has_focus &&
(window->frame == NULL || frame_was_receiver) &&
event->xcrossing.mode != NotifyGrab &&
event->xcrossing.mode != NotifyUngrab &&
event->xcrossing.detail != NotifyInferior)
@@ -1458,12 +1633,20 @@ event_callback (XEvent *event,
/* if frame was receiver it's some malicious send event or something */
else if (!frame_was_receiver && window)
{
meta_verbose ("MapRequest on %s mapped = %d minimized = %d\n",
window->desc, window->mapped, window->minimized);
if (window->minimized)
meta_window_unminimize (window);
if (!meta_workspace_contains_window (window->screen->active_workspace,
window))
meta_window_change_workspace (window,
window->screen->active_workspace);
{
meta_window_unminimize (window);
if (!meta_workspace_contains_window (window->screen->active_workspace,
window))
{
meta_verbose ("Changing workspace due to MapRequest mapped = %d minimized = %d\n",
window->mapped, window->minimized);
meta_window_change_workspace (window,
window->screen->active_workspace);
}
}
}
break;
case ReparentNotify:
@@ -1723,6 +1906,19 @@ event_callback (XEvent *event,
}
break;
default:
#ifdef HAVE_XKB
if (event->type == display->xkb_base_event_type)
{
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
switch (xkb_ev->xkb_type)
{
case XkbBellNotify:
meta_bell_notify (display, xkb_ev);
break;
}
}
#endif
break;
}
@@ -1800,6 +1996,15 @@ event_get_modified_window (MetaDisplay *display,
return None;
default:
#ifdef HAVE_SHAPE
if (META_DISPLAY_HAS_SHAPE (display) &&
event->type == (display->shape_event_base + ShapeNotify))
{
XShapeEvent *sev = (XShapeEvent*) event;
return sev->window;
}
#endif
return None;
}
}
@@ -1860,6 +2065,7 @@ event_get_time (MetaDisplay *display,
}
}
#ifdef WITH_VERBOSE_MODE
const char*
meta_event_detail_to_string (int d)
{
@@ -1896,7 +2102,9 @@ meta_event_detail_to_string (int d)
return detail;
}
#endif /* WITH_VERBOSE_MODE */
#ifdef WITH_VERBOSE_MODE
const char*
meta_event_mode_to_string (int m)
{
@@ -1924,7 +2132,9 @@ meta_event_mode_to_string (int m)
return mode;
}
#endif /* WITH_VERBOSE_MODE */
#ifdef WITH_VERBOSE_MODE
static const char*
stack_mode_to_string (int mode)
{
@@ -1944,7 +2154,9 @@ stack_mode_to_string (int mode)
return "Unknown";
}
#endif /* WITH_VERBOSE_MODE */
#ifdef WITH_VERBOSE_MODE
static char*
key_event_description (Display *xdisplay,
XEvent *event)
@@ -1957,9 +2169,45 @@ key_event_description (Display *xdisplay,
str = XKeysymToString (keysym);
return g_strdup_printf ("Key '%s' state 0x%x",
str ? str : "(null)", event->xkey.state);
str ? str : "none", event->xkey.state);
}
#endif /* WITH_VERBOSE_MODE */
#ifdef HAVE_XSYNC
#ifdef WITH_VERBOSE_MODE
static gint64
sync_value_to_64 (const XSyncValue *value)
{
gint64 v;
v = XSyncValueLow32 (*value);
v |= (((gint64)XSyncValueHigh32 (*value)) << 32);
return v;
}
#endif /* WITH_VERBOSE_MODE */
#ifdef WITH_VERBOSE_MODE
static const char*
alarm_state_to_string (XSyncAlarmState state)
{
switch (state)
{
case XSyncAlarmActive:
return "Active";
case XSyncAlarmInactive:
return "Inactive";
case XSyncAlarmDestroyed:
return "Destroyed";
default:
return "(unknown)";
}
}
#endif /* WITH_VERBOSE_MODE */
#endif /* HAVE_XSYNC */
#ifdef WITH_VERBOSE_MODE
static void
meta_spew_event (MetaDisplay *display,
XEvent *event)
@@ -1969,6 +2217,9 @@ meta_spew_event (MetaDisplay *display,
char *winname;
MetaScreen *screen;
if (!meta_is_verbose())
return;
/* filter overnumerous events */
if (event->type == Expose || event->type == MotionNotify ||
event->type == NoExpose)
@@ -2084,6 +2335,9 @@ meta_spew_event (MetaDisplay *display,
break;
case MapRequest:
name = "MapRequest";
extra = g_strdup_printf ("window: 0x%lx parent: 0x%lx\n",
event->xmaprequest.window,
event->xmaprequest.parent);
break;
case ReparentNotify:
name = "ReparentNotify";
@@ -2195,8 +2449,51 @@ meta_spew_event (MetaDisplay *display,
name = "MappingNotify";
break;
default:
name = "(Unknown event)";
extra = g_strdup_printf ("type: %d", event->xany.type);
#ifdef HAVE_XSYNC
if (META_DISPLAY_HAS_XSYNC (display) &&
event->type == (display->xsync_event_base + XSyncAlarmNotify))
{
XSyncAlarmNotifyEvent *aevent = (XSyncAlarmNotifyEvent*) event;
name = "XSyncAlarmNotify";
extra =
g_strdup_printf ("alarm: 0x%lx"
" counter_value: %" G_GINT64_FORMAT
" alarm_value: %" G_GINT64_FORMAT
" time: %u alarm state: %s",
aevent->alarm,
(gint64) sync_value_to_64 (&aevent->counter_value),
(gint64) sync_value_to_64 (&aevent->alarm_value),
(unsigned int) aevent->time,
alarm_state_to_string (aevent->state));
}
else
#endif /* HAVE_XSYNC */
#ifdef HAVE_SHAPE
if (META_DISPLAY_HAS_SHAPE (display) &&
event->type == (display->shape_event_base + ShapeNotify))
{
XShapeEvent *sev = (XShapeEvent*) event;
name = "ShapeNotify";
extra =
g_strdup_printf ("kind: %s "
"x: %d y: %d w: %d h: %d "
"shaped: %d",
sev->kind == ShapeBounding ?
"ShapeBounding" :
(sev->kind == ShapeClip ?
"ShapeClip" : "(unknown)"),
sev->x, sev->y, sev->width, sev->height,
sev->shaped);
}
else
#endif /* HAVE_SHAPE */
{
name = "(Unknown event)";
extra = g_strdup_printf ("type: %d", event->xany.type);
}
break;
}
@@ -2218,6 +2515,7 @@ meta_spew_event (MetaDisplay *display,
if (extra)
g_free (extra);
}
#endif /* WITH_VERBOSE_MODE */
MetaWindow*
meta_display_lookup_x_window (MetaDisplay *display,
@@ -2373,8 +2671,9 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
cursor = xcursor_for_op (display, op);
#define GRAB_MASK (PointerMotionMask | PointerMotionHintMask | \
ButtonPressMask | ButtonReleaseMask)
#define GRAB_MASK (PointerMotionMask | \
ButtonPressMask | ButtonReleaseMask | \
EnterWindowMask | LeaveWindowMask)
if (change_pointer)
{
@@ -2411,7 +2710,14 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
{
display->grab_have_pointer = TRUE;
meta_topic (META_DEBUG_WINDOW_OPS,
"XGrabPointer() returned GrabSuccess\n");
"XGrabPointer() returned GrabSuccess time 0x%lu\n",
timestamp);
}
else
{
meta_topic (META_DEBUG_WINDOW_OPS,
"XGrabPointer() failed time 0x%lu\n",
timestamp);
}
meta_error_trap_pop (display, TRUE);
}
@@ -2438,13 +2744,13 @@ meta_display_begin_grab_op (MetaDisplay *display,
meta_topic (META_DEBUG_WINDOW_OPS,
"Doing grab op %d on window %s button %d pointer already grabbed: %d\n",
op, window ? window->desc : "(null)", button, pointer_already_grabbed);
op, window ? window->desc : "none", button, pointer_already_grabbed);
if (display->grab_op != META_GRAB_OP_NONE)
{
meta_warning ("Attempt to perform window operation %d on window %s when operation %d on %s already in effect\n",
op, window ? window->desc : "(null)", display->grab_op,
display->grab_window ? display->grab_window->desc : "(null)");
op, window ? window->desc : "none", display->grab_op,
display->grab_window ? display->grab_window->desc : "none");
return FALSE;
}
@@ -2502,9 +2808,15 @@ meta_display_begin_grab_op (MetaDisplay *display,
display->grab_initial_root_y = root_y;
display->grab_current_root_x = root_x;
display->grab_current_root_y = root_y;
display->grab_latest_motion_x = root_x;
display->grab_latest_motion_y = root_y;
display->grab_last_moveresize_time.tv_sec = 0;
display->grab_last_moveresize_time.tv_usec = 0;
display->grab_motion_notify_time = 0;
#ifdef HAVE_XSYNC
display->grab_update_alarm = None;
#endif
if (display->grab_window)
{
display->grab_initial_window_pos = display->grab_window->rect;
@@ -2512,6 +2824,46 @@ meta_display_begin_grab_op (MetaDisplay *display,
&display->grab_initial_window_pos.x,
&display->grab_initial_window_pos.y);
display->grab_current_window_pos = display->grab_initial_window_pos;
#ifdef HAVE_XSYNC
if (meta_grab_op_is_resizing (display->grab_op) &&
display->grab_window->update_counter != None)
{
XSyncAlarmAttributes values;
/* trigger when we make a positive transition to a value
* one higher than the current value.
*/
values.trigger.counter = display->grab_window->update_counter;
values.trigger.value_type = XSyncRelative;
values.trigger.test_type = XSyncPositiveTransition;
XSyncIntToValue (&values.trigger.wait_value, 1);
/* After triggering, increment test_value by this.
* (NOT wait_value above)
*/
XSyncIntToValue (&values.delta, 1);
/* we want events (on by default anyway) */
values.events = True;
meta_error_trap_push_with_return (display);
display->grab_update_alarm = XSyncCreateAlarm (display->xdisplay,
XSyncCACounter |
XSyncCAValueType |
XSyncCAValue |
XSyncCATestType |
XSyncCADelta |
XSyncCAEvents,
&values);
if (meta_error_trap_pop_with_return (display, FALSE) != Success)
display->grab_update_alarm = None;
meta_topic (META_DEBUG_RESIZING,
"Created update alarm 0x%lx\n",
display->grab_update_alarm);
}
#endif
}
meta_topic (META_DEBUG_WINDOW_OPS,
@@ -2554,7 +2906,9 @@ void
meta_display_end_grab_op (MetaDisplay *display,
Time timestamp)
{
meta_verbose ("Ending grab op %d at time %ld\n", display->grab_op, timestamp);
meta_topic (META_DEBUG_WINDOW_OPS,
"Ending grab op %d at time %lu\n", display->grab_op,
(unsigned long) timestamp);
if (display->grab_op == META_GRAB_OP_NONE)
return;
@@ -2585,12 +2939,20 @@ meta_display_end_grab_op (MetaDisplay *display,
if (display->grab_have_keyboard)
{
meta_topic (META_DEBUG_WINDOW_OPS,
"Ungrabbing all keys\n");
"Ungrabbing all keys timestamp %lu\n", timestamp);
if (display->grab_window)
meta_window_ungrab_all_keys (display->grab_window);
else
meta_screen_ungrab_all_keys (display->grab_screen);
}
#ifdef HAVE_XSYNC
if (display->grab_update_alarm != None)
{
XSyncDestroyAlarm (display->xdisplay,
display->grab_update_alarm);
}
#endif /* HAVE_XSYNC */
display->grab_window = NULL;
display->grab_screen = NULL;
@@ -2824,20 +3186,10 @@ meta_display_queue_retheme_all_windows (MetaDisplay *display)
meta_window_queue_move_resize (window);
if (window->frame)
{
window->frame->need_reapply_frame_shape = TRUE;
meta_frame_queue_draw (window->frame);
/* FIXME this sucks and is slooooooooow. Do it in the idle with the
* redraw or the window resize.
*/
#if 0
/* in case the theme doesn't affect the frame size */
meta_ui_apply_frame_shape (window->screen->ui,
window->frame->xwindow,
window->frame->rect.width,
window->frame->rect.height);
#endif
}
}
tmp = tmp->next;
}
@@ -3023,7 +3375,7 @@ find_tab_forward (MetaDisplay *display,
MetaTabList type,
MetaScreen *screen,
MetaWorkspace *workspace,
GList *start)
GList *start)
{
GList *tmp;
@@ -3100,13 +3452,13 @@ find_tab_backward (MetaDisplay *display,
return NULL;
}
GSList*
GList*
meta_display_get_tab_list (MetaDisplay *display,
MetaTabList type,
MetaScreen *screen,
MetaWorkspace *workspace)
{
GSList *tab_list;
GList *tab_list;
/* workspace can be NULL for all workspaces */
@@ -3127,7 +3479,7 @@ meta_display_get_tab_list (MetaDisplay *display,
IN_TAB_CHAIN (window, type) &&
(workspace == NULL ||
meta_window_visible_on_workspace (window, workspace)))
tab_list = g_slist_prepend (tab_list, window);
tab_list = g_list_prepend (tab_list, window);
tmp = tmp->next;
}
@@ -3146,13 +3498,13 @@ meta_display_get_tab_list (MetaDisplay *display,
IN_TAB_CHAIN (window, type) &&
(workspace == NULL ||
meta_window_visible_on_workspace (window, workspace)))
tab_list = g_slist_prepend (tab_list, window);
tab_list = g_list_prepend (tab_list, window);
tmp = tmp->next;
}
}
tab_list = g_slist_reverse (tab_list);
tab_list = g_list_reverse (tab_list);
return tab_list;
}
@@ -3160,12 +3512,18 @@ meta_display_get_tab_list (MetaDisplay *display,
MetaWindow*
meta_display_get_tab_next (MetaDisplay *display,
MetaTabList type,
MetaScreen *screen,
MetaScreen *screen,
MetaWorkspace *workspace,
MetaWindow *window,
gboolean backward)
{
if (display->mru_list == NULL)
GList *tab_list;
tab_list = meta_display_get_tab_list(display,
type,
screen,
workspace);
if (tab_list == NULL)
return NULL;
if (window != NULL)
@@ -3174,20 +3532,22 @@ meta_display_get_tab_next (MetaDisplay *display,
if (backward)
return find_tab_backward (display, type, screen, workspace,
g_list_find (display->mru_list,
g_list_find (tab_list,
window));
else
return find_tab_forward (display, type, screen, workspace,
g_list_find (display->mru_list,
g_list_find (tab_list,
window));
}
if (backward)
return find_tab_backward (display, type, screen, workspace,
g_list_last (display->mru_list));
tab_list);
else
return find_tab_forward (display, type, screen, workspace,
display->mru_list);
tab_list);
g_list_free (tab_list);
}
MetaWindow*
@@ -3627,4 +3987,9 @@ prefs_changed_callback (MetaPreference pref,
g_slist_free (windows);
}
else if (pref == META_PREF_AUDIBLE_BELL)
{
MetaDisplay *display = data;
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
}
}

View File

@@ -2,6 +2,7 @@
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -35,6 +36,10 @@
#include <libsn/sn.h>
#endif
#ifdef HAVE_XSYNC
#include <X11/extensions/sync.h>
#endif
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
/* this doesn't really belong here, oh well. */
@@ -162,6 +167,11 @@ struct _MetaDisplay
Atom atom_net_wm_state_below;
Atom atom_net_startup_id;
Atom atom_metacity_toggle_verbose;
Atom atom_metacity_update_counter;
Atom atom_sync_counter;
Atom atom_gnome_panel_action;
Atom atom_gnome_panel_action_main_menu;
Atom atom_gnome_panel_action_run_dialog;
/* This is the actual window from focus events,
* not the one we last set
@@ -229,6 +239,8 @@ struct _MetaDisplay
int grab_initial_root_y;
int grab_current_root_x;
int grab_current_root_y;
int grab_latest_motion_x;
int grab_latest_motion_y;
gulong grab_mask;
guint grab_have_pointer : 1;
guint grab_have_keyboard : 1;
@@ -236,15 +248,22 @@ struct _MetaDisplay
MetaRectangle grab_current_window_pos;
MetaResizePopup *grab_resize_popup;
GTimeVal grab_last_moveresize_time;
Time grab_motion_notify_time;
#ifdef HAVE_XKB
int xkb_base_event_type;
#endif
#ifdef HAVE_XSYNC
/* alarm monitoring client's _METACITY_UPDATE_COUNTER */
XSyncAlarm grab_update_alarm;
#endif
/* Keybindings stuff */
MetaKeyBinding *screen_bindings;
int n_screen_bindings;
MetaKeyBinding *window_bindings;
int n_window_bindings;
int min_keycode;
int max_keycode;
unsigned int min_keycode;
unsigned int max_keycode;
KeySym *keymap;
int keysyms_per_keycode;
XModifierKeymap *modmap;
@@ -275,11 +294,22 @@ struct _MetaDisplay
MetaGroupPropHooks *group_prop_hooks;
#ifdef HAVE_STARTUP_NOTIFICATION
/* This is at the end in case someone doesn't include config.h before this file
* the results won't be catastrophic
*/
SnDisplay *sn_display;
#endif
#ifdef HAVE_XSYNC
int xsync_event_base;
int xsync_error_base;
#define META_DISPLAY_HAS_XSYNC(display) ((display)->xsync_event_base != 0)
#else
#define META_DISPLAY_HAS_XSYNC(display) FALSE
#endif
#ifdef HAVE_SHAPE
int shape_event_base;
int shape_error_base;
#define META_DISPLAY_HAS_SHAPE(display) ((display)->shape_event_base != 0)
#else
#define META_DISPLAY_HAS_SHAPE(display) FALSE
#endif
};
gboolean meta_display_open (const char *name);
@@ -380,10 +410,10 @@ typedef enum
} MetaTabList;
GSList* meta_display_get_tab_list (MetaDisplay *display,
MetaTabList type,
MetaScreen *screen,
MetaWorkspace *workspace);
GList* meta_display_get_tab_list (MetaDisplay *display,
MetaTabList type,
MetaScreen *screen,
MetaWorkspace *workspace);
MetaWindow* meta_display_get_tab_next (MetaDisplay *display,
MetaTabList type,
@@ -399,6 +429,9 @@ MetaWindow* meta_display_get_tab_current (MetaDisplay *display,
int meta_resize_gravity_from_grab_op (MetaGrabOp op);
gboolean meta_grab_op_is_moving (MetaGrabOp op);
gboolean meta_grab_op_is_resizing (MetaGrabOp op);
gboolean meta_rectangle_intersect (MetaRectangle *src1,
MetaRectangle *src2,
MetaRectangle *dest);

View File

@@ -48,7 +48,6 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
if (tip == NULL)
{
tip = gtk_window_new (GTK_WINDOW_POPUP);
#ifdef HAVE_GTK_MULTIHEAD
{
GdkScreen *gdk_screen;
@@ -59,10 +58,6 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number,
screen_width = gdk_screen_get_width (gdk_screen);
screen_height = gdk_screen_get_height (gdk_screen);
}
#else
screen_width = gdk_screen_width ();
screen_height = gdk_screen_height ();
#endif
gtk_widget_set_app_paintable (tip, TRUE);
gtk_window_set_policy (GTK_WINDOW (tip), FALSE, FALSE, TRUE);

View File

@@ -21,6 +21,7 @@
#include <config.h>
#include "frame.h"
#include "bell.h"
#include "errors.h"
#include "keybindings.h"
@@ -58,6 +59,8 @@ meta_window_ensure_frame (MetaWindow *window)
frame->current_cursor = 0;
frame->mapped = FALSE;
frame->need_reapply_frame_shape = TRUE;
frame->is_flashing = FALSE;
attrs.event_mask = EVENT_MASK;
@@ -144,7 +147,9 @@ meta_window_ensure_frame (MetaWindow *window)
meta_ui_apply_frame_shape (frame->window->screen->ui,
frame->xwindow,
frame->rect.width,
frame->rect.height);
frame->rect.height,
frame->window->has_shape);
frame->need_reapply_frame_shape = FALSE;
meta_display_ungrab (window->display);
}
@@ -159,6 +164,7 @@ meta_window_destroy_frame (MetaWindow *window)
frame = window->frame;
meta_bell_notify_frame_destroy (frame);
meta_ui_remove_frame (window->screen->ui, frame->xwindow);
/* Unparent the client window; it may be destroyed,
@@ -255,6 +261,9 @@ meta_frame_get_flags (MetaFrame *frame)
if (frame->window->fullscreen)
flags |= META_FRAME_FULLSCREEN;
if (frame->is_flashing)
flags |= META_FRAME_IS_FLASHING;
return flags;
}
@@ -277,6 +286,20 @@ meta_frame_calc_geometry (MetaFrame *frame,
*geomp = geom;
}
static void
update_shape (MetaFrame *frame)
{
if (frame->need_reapply_frame_shape)
{
meta_ui_apply_frame_shape (frame->window->screen->ui,
frame->xwindow,
frame->rect.width,
frame->rect.height,
frame->window->has_shape);
frame->need_reapply_frame_shape = FALSE;
}
}
void
meta_frame_sync_to_window (MetaFrame *frame,
int resize_gravity,
@@ -284,8 +307,11 @@ meta_frame_sync_to_window (MetaFrame *frame,
gboolean need_resize)
{
if (!(need_move || need_resize))
return;
{
update_shape (frame);
return;
}
meta_topic (META_DEBUG_GEOMETRY,
"Syncing frame geometry %d,%d %dx%d (SE: %d,%d)\n",
frame->rect.x, frame->rect.y,
@@ -301,18 +327,17 @@ meta_frame_sync_to_window (MetaFrame *frame,
frame->rect.width,
frame->rect.height);
/* Done before the window resize, because doing it before means
* part of the window being resized becomes unshaped, which may
* be sort of hard to see with bg = None. If we did it after
* window resize, part of the window being resized would become
* shaped, which might be more visible.
*/
meta_ui_apply_frame_shape (frame->window->screen->ui,
frame->xwindow,
frame->rect.width,
frame->rect.height);
/* we need new shape if we're resized */
frame->need_reapply_frame_shape = TRUE;
}
/* Done before the window resize, because doing it before means
* part of the window being resized becomes unshaped, which may
* be sort of hard to see with bg = None. If we did it after
* window resize, part of the window being resized would become
* shaped, which might be more visible.
*/
update_shape (frame);
if (need_move && need_resize)
XMoveResizeWindow (frame->window->display->xdisplay,

View File

@@ -57,6 +57,8 @@ struct _MetaFrame
int bottom_height;
guint mapped : 1;
guint need_reapply_frame_shape : 1;
guint is_flashing : 1; /* used by the visual bell flash */
};
void meta_window_ensure_frame (MetaWindow *window);

View File

@@ -452,7 +452,6 @@ meta_frames_calc_geometry (MetaFrames *frames,
MetaFrames*
meta_frames_new (int screen_number)
{
#ifdef HAVE_GTK_MULTIHEAD
GdkScreen *screen;
screen = gdk_display_get_screen (gdk_display_get_default (),
@@ -460,12 +459,7 @@ meta_frames_new (int screen_number)
return g_object_new (META_TYPE_FRAMES,
"screen", screen,
NULL);
#else
return g_object_new (META_TYPE_FRAMES,
NULL);
#endif
NULL);
}
void
@@ -495,6 +489,7 @@ meta_frames_manage_window (MetaFrames *frames,
frame->text_height = -1;
frame->title = NULL;
frame->expose_delayed = FALSE;
frame->shape_applied = FALSE;
frame->prelit_control = META_FRAME_CONTROL_NONE;
meta_core_grab_buttons (gdk_display, frame->xwindow);
@@ -664,7 +659,8 @@ void
meta_frames_apply_shapes (MetaFrames *frames,
Window xwindow,
int new_window_width,
int new_window_height)
int new_window_height,
gboolean window_has_shape)
{
#ifdef HAVE_SHAPE
/* Apply shapes as if window had new_window_width, new_window_height */
@@ -685,10 +681,25 @@ meta_frames_apply_shapes (MetaFrames *frames,
if (!(fgeom.top_left_corner_rounded ||
fgeom.top_right_corner_rounded ||
fgeom.bottom_left_corner_rounded ||
fgeom.bottom_right_corner_rounded))
fgeom.bottom_right_corner_rounded ||
window_has_shape))
{
XShapeCombineMask (gdk_display, frame->xwindow,
ShapeBounding, 0, 0, None, ShapeSet);
if (frame->shape_applied)
{
meta_topic (META_DEBUG_SHAPES,
"Unsetting shape mask on frame 0x%lx\n",
frame->xwindow);
XShapeCombineMask (gdk_display, frame->xwindow,
ShapeBounding, 0, 0, None, ShapeSet);
frame->shape_applied = FALSE;
}
else
{
meta_topic (META_DEBUG_SHAPES,
"Frame 0x%lx still doesn't need a shape mask\n",
frame->xwindow);
}
return; /* nothing to do */
}
@@ -804,12 +815,99 @@ meta_frames_apply_shapes (MetaFrames *frames,
XSubtractRegion (window_xregion, corners_xregion, window_xregion);
XShapeCombineRegion (gdk_display, frame->xwindow,
ShapeBounding, 0, 0, window_xregion, ShapeSet);
XDestroyRegion (corners_xregion);
if (window_has_shape)
{
/* The client window is oclock or something and has a shape
* mask. To avoid a round trip to get its shape region, we
* create a fake window that's never mapped, build up our shape
* on that, then combine. Wasting the window is assumed cheaper
* than a round trip, but who really knows for sure.
*/
XSetWindowAttributes attrs;
Window shape_window;
Window client_window;
Region client_xregion;
GdkScreen *screen;
int screen_number;
meta_topic (META_DEBUG_SHAPES,
"Frame 0x%lx needs to incorporate client shape\n",
frame->xwindow);
screen = gtk_widget_get_screen (GTK_WIDGET (frames));
screen_number = gdk_x11_screen_get_screen_number (screen);
attrs.override_redirect = True;
shape_window = XCreateWindow (gdk_display,
RootWindow (gdk_display, screen_number),
-5000, -5000,
new_window_width,
new_window_height,
0,
CopyFromParent,
CopyFromParent,
CopyFromParent,
CWOverrideRedirect,
&attrs);
/* Copy the client's shape to the temporary shape_window */
client_window = meta_core_get_client_xwindow (gdk_display,
frame->xwindow);
XShapeCombineShape (gdk_display, shape_window, ShapeBounding,
fgeom.left_width,
fgeom.top_height,
client_window,
ShapeBounding,
ShapeSet);
/* Punch the client area out of the normal frame shape,
* then union it with the shape_window's existing shape
*/
client_xregion = XCreateRegion ();
xrect.x = fgeom.left_width;
xrect.y = fgeom.top_height;
xrect.width = new_window_width - fgeom.right_width - xrect.x;
xrect.height = new_window_height - fgeom.bottom_height - xrect.y;
XUnionRectWithRegion (&xrect, client_xregion, client_xregion);
XSubtractRegion (window_xregion, client_xregion, window_xregion);
XDestroyRegion (client_xregion);
XShapeCombineRegion (gdk_display, shape_window,
ShapeBounding, 0, 0, window_xregion, ShapeUnion);
/* Now copy shape_window shape to the real frame */
XShapeCombineShape (gdk_display, frame->xwindow, ShapeBounding,
0, 0,
shape_window,
ShapeBounding,
ShapeSet);
XDestroyWindow (gdk_display, shape_window);
}
else
{
/* No shape on the client, so just do simple stuff */
meta_topic (META_DEBUG_SHAPES,
"Frame 0x%lx has shaped corners\n",
frame->xwindow);
XShapeCombineRegion (gdk_display, frame->xwindow,
ShapeBounding, 0, 0, window_xregion, ShapeSet);
}
frame->shape_applied = TRUE;
XDestroyRegion (window_xregion);
XDestroyRegion (corners_xregion);
#endif
#endif /* HAVE_SHAPE */
}
void
@@ -947,11 +1045,8 @@ show_tip_now (MetaFrames *frames)
/* get conversion delta for root-to-frame coords */
dx = root_x - x;
dy = root_y - y;
#ifdef HAVE_GTK_MULTIHEAD
screen_number = gdk_screen_get_number (gtk_widget_get_screen (GTK_WIDGET (frames)));
#else
screen_number = DefaultScreen (gdk_display);
#endif
meta_fixed_tip_show (gdk_display,
screen_number,
rect->x + dx,

View File

@@ -72,7 +72,8 @@ struct _MetaUIFrame
int text_height;
char *title; /* NULL once we have a layout */
guint expose_delayed : 1;
guint shape_applied : 1;
/* FIXME get rid of this, it can just be in the MetaFrames struct */
MetaFrameControl prelit_control;
};
@@ -127,7 +128,8 @@ void meta_frames_unflicker_bg (MetaFrames *frames,
void meta_frames_apply_shapes (MetaFrames *frames,
Window xwindow,
int new_window_width,
int new_window_height);
int new_window_height,
gboolean window_has_shape);
void meta_frames_queue_draw (MetaFrames *frames,
Window xwindow);

View File

@@ -79,6 +79,11 @@ static void handle_toggle_desktop (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding);
static void handle_panel_keybinding (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding);
static void handle_toggle_maximize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
@@ -209,7 +214,7 @@ struct _MetaKeyBinding
const char *name;
KeySym keysym;
unsigned int mask;
int keycode;
unsigned int keycode;
MetaVirtualModifier modifiers;
const MetaKeyHandler *handler;
};
@@ -265,6 +270,10 @@ static const MetaKeyHandler screen_handlers[] = {
GINT_TO_POINTER (META_TAB_LIST_DOCKS) },
{ META_KEYBINDING_SHOW_DESKTOP, handle_toggle_desktop,
NULL },
{ META_KEYBINDING_PANEL_MAIN_MENU, handle_panel_keybinding,
GINT_TO_POINTER (META_KEYBINDING_ACTION_PANEL_MAIN_MENU) },
{ META_KEYBINDING_PANEL_RUN_DIALOG, handle_panel_keybinding,
GINT_TO_POINTER (META_KEYBINDING_ACTION_PANEL_RUN_DIALOG) },
{ META_KEYBINDING_COMMAND_1, handle_run_command,
GINT_TO_POINTER (0) },
{ META_KEYBINDING_COMMAND_2, handle_run_command,
@@ -289,6 +298,50 @@ static const MetaKeyHandler screen_handlers[] = {
GINT_TO_POINTER (10) },
{ META_KEYBINDING_COMMAND_12, handle_run_command,
GINT_TO_POINTER (11) },
{ META_KEYBINDING_COMMAND_13, handle_run_command,
GINT_TO_POINTER (12) },
{ META_KEYBINDING_COMMAND_14, handle_run_command,
GINT_TO_POINTER (13) },
{ META_KEYBINDING_COMMAND_15, handle_run_command,
GINT_TO_POINTER (14) },
{ META_KEYBINDING_COMMAND_16, handle_run_command,
GINT_TO_POINTER (15) },
{ META_KEYBINDING_COMMAND_17, handle_run_command,
GINT_TO_POINTER (16) },
{ META_KEYBINDING_COMMAND_18, handle_run_command,
GINT_TO_POINTER (17) },
{ META_KEYBINDING_COMMAND_19, handle_run_command,
GINT_TO_POINTER (18) },
{ META_KEYBINDING_COMMAND_20, handle_run_command,
GINT_TO_POINTER (19) },
{ META_KEYBINDING_COMMAND_21, handle_run_command,
GINT_TO_POINTER (20) },
{ META_KEYBINDING_COMMAND_22, handle_run_command,
GINT_TO_POINTER (21) },
{ META_KEYBINDING_COMMAND_23, handle_run_command,
GINT_TO_POINTER (22) },
{ META_KEYBINDING_COMMAND_24, handle_run_command,
GINT_TO_POINTER (23) },
{ META_KEYBINDING_COMMAND_25, handle_run_command,
GINT_TO_POINTER (24) },
{ META_KEYBINDING_COMMAND_26, handle_run_command,
GINT_TO_POINTER (25) },
{ META_KEYBINDING_COMMAND_27, handle_run_command,
GINT_TO_POINTER (26) },
{ META_KEYBINDING_COMMAND_28, handle_run_command,
GINT_TO_POINTER (27) },
{ META_KEYBINDING_COMMAND_29, handle_run_command,
GINT_TO_POINTER (28) },
{ META_KEYBINDING_COMMAND_30, handle_run_command,
GINT_TO_POINTER (29) },
{ META_KEYBINDING_COMMAND_31, handle_run_command,
GINT_TO_POINTER (30) },
{ META_KEYBINDING_COMMAND_32, handle_run_command,
GINT_TO_POINTER (31) },
{ META_KEYBINDING_COMMAND_SCREENSHOT, handle_run_command,
GINT_TO_POINTER (32) },
{ META_KEYBINDING_COMMAND_WIN_SCREENSHOT, handle_run_command,
GINT_TO_POINTER (33) },
{ NULL, NULL, NULL }
};
@@ -389,7 +442,7 @@ reload_modmap (MetaDisplay *display)
/* get the key code at this point in the map,
* see if its keysym is one we're interested in
*/
int keycode = modmap->modifiermap[i];
unsigned int keycode = modmap->modifiermap[i];
if (keycode >= display->min_keycode &&
keycode <= display->max_keycode)
@@ -407,7 +460,7 @@ reload_modmap (MetaDisplay *display)
str = XKeysymToString (syms[j]);
meta_topic (META_DEBUG_KEYBINDINGS,
"Keysym %s bound to modifier 0x%x\n",
str ? str : "(null)",
str ? str : "none",
(1 << ( i / modmap->max_keypermod)));
}
@@ -472,7 +525,7 @@ reload_keycodes (MetaDisplay *display)
int i;
i = 0;
while (display->screen_bindings[i].keysym != None)
while (i < display->n_screen_bindings)
{
display->screen_bindings[i].keycode = XKeysymToKeycode (display->xdisplay,
display->screen_bindings[i].keysym);
@@ -486,7 +539,7 @@ reload_keycodes (MetaDisplay *display)
int i;
i = 0;
while (display->window_bindings[i].keysym != None)
while (i < display->n_window_bindings)
{
display->window_bindings[i].keycode = XKeysymToKeycode (display->xdisplay,
display->window_bindings[i].keysym);
@@ -507,11 +560,17 @@ reload_modifiers (MetaDisplay *display)
int i;
i = 0;
while (display->screen_bindings[i].keysym != None)
while (i < display->n_screen_bindings)
{
meta_display_devirtualize_modifiers (display,
display->screen_bindings[i].modifiers,
&display->screen_bindings[i].mask);
meta_topic (META_DEBUG_KEYBINDINGS,
" Devirtualized mods 0x%x -> 0x%x (%s)\n",
display->screen_bindings[i].modifiers,
display->screen_bindings[i].mask,
display->screen_bindings[i].name);
++i;
}
@@ -522,93 +581,137 @@ reload_modifiers (MetaDisplay *display)
int i;
i = 0;
while (display->window_bindings[i].keysym != None)
while (i < display->n_window_bindings)
{
meta_display_devirtualize_modifiers (display,
display->window_bindings[i].modifiers,
&display->window_bindings[i].mask);
meta_topic (META_DEBUG_KEYBINDINGS,
" Devirtualized mods 0x%x -> 0x%x (%s)\n",
display->window_bindings[i].modifiers,
display->window_bindings[i].mask,
display->window_bindings[i].name);
++i;
}
}
}
static void
rebuild_screen_binding_table (MetaDisplay *display)
static int
count_bindings (const MetaKeyPref *prefs,
int n_prefs)
{
int i;
int count;
count = 0;
i = 0;
while (i < n_prefs)
{
if (prefs[i].keysym != None)
{
count += 1;
if (prefs[i].add_shift &&
(prefs[i].modifiers & META_VIRTUAL_SHIFT_MASK) == 0)
count += 1;
}
++i;
}
return count;
}
static void
rebuild_binding_table (MetaDisplay *display,
MetaKeyBinding **bindings_p,
int *n_bindings_p,
const MetaKeyPref *prefs,
int n_prefs)
{
const MetaKeyPref *prefs;
int n_bindings;
int src, dest;
meta_topic (META_DEBUG_KEYBINDINGS,
"Rebuilding screen binding table from preferences\n");
meta_prefs_get_screen_bindings (&prefs, &n_bindings);
g_free (display->screen_bindings);
display->screen_bindings = g_new0 (MetaKeyBinding, n_bindings);
n_bindings = count_bindings (prefs, n_prefs);
g_free (*bindings_p);
*bindings_p = g_new0 (MetaKeyBinding, n_bindings);
src = 0;
dest = 0;
while (src < n_bindings)
while (src < n_prefs)
{
if (prefs[src].keysym != None)
{
display->screen_bindings[dest].name = prefs[src].name;
display->screen_bindings[dest].keysym = prefs[src].keysym;
display->screen_bindings[dest].modifiers = prefs[src].modifiers;
display->screen_bindings[dest].mask = 0;
display->screen_bindings[dest].keycode = 0;
(*bindings_p)[dest].name = prefs[src].name;
(*bindings_p)[dest].keysym = prefs[src].keysym;
(*bindings_p)[dest].modifiers = prefs[src].modifiers;
(*bindings_p)[dest].mask = 0;
(*bindings_p)[dest].keycode = 0;
++dest;
if (prefs[src].add_shift &&
(prefs[src].modifiers & META_VIRTUAL_SHIFT_MASK) == 0)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Binding %s also needs Shift grabbed\n",
prefs[src].name);
(*bindings_p)[dest].name = prefs[src].name;
(*bindings_p)[dest].keysym = prefs[src].keysym;
(*bindings_p)[dest].modifiers = prefs[src].modifiers |
META_VIRTUAL_SHIFT_MASK;
(*bindings_p)[dest].mask = 0;
(*bindings_p)[dest].keycode = 0;
++dest;
}
}
++src;
}
display->n_screen_bindings = dest;
g_assert (dest == n_bindings);
*n_bindings_p = dest;
meta_topic (META_DEBUG_KEYBINDINGS,
"%d screen bindings in table\n",
display->n_screen_bindings);
" %d bindings in table\n",
*n_bindings_p);
}
static void
rebuild_screen_binding_table (MetaDisplay *display)
{
const MetaKeyPref *prefs;
int n_prefs;
meta_topic (META_DEBUG_KEYBINDINGS,
"Rebuilding screen binding table from preferences\n");
meta_prefs_get_screen_bindings (&prefs, &n_prefs);
rebuild_binding_table (display,
&display->screen_bindings,
&display->n_screen_bindings,
prefs, n_prefs);
}
static void
rebuild_window_binding_table (MetaDisplay *display)
{
const MetaKeyPref *prefs;
int n_bindings;
int src, dest;
int n_prefs;
meta_topic (META_DEBUG_KEYBINDINGS,
"Rebuilding window binding table from preferences\n");
meta_prefs_get_window_bindings (&prefs, &n_bindings);
g_free (display->window_bindings);
display->window_bindings = g_new0 (MetaKeyBinding, n_bindings);
src = 0;
dest = 0;
while (src < n_bindings)
{
if (prefs[src].keysym != None)
{
display->window_bindings[dest].name = prefs[src].name;
display->window_bindings[dest].keysym = prefs[src].keysym;
display->window_bindings[dest].modifiers = prefs[src].modifiers;
display->window_bindings[dest].mask = 0;
display->window_bindings[dest].keycode = 0;
++dest;
}
++src;
}
display->n_window_bindings = dest;
meta_topic (META_DEBUG_KEYBINDINGS,
"%d window bindings in table\n",
display->n_window_bindings);
meta_prefs_get_window_bindings (&prefs, &n_prefs);
rebuild_binding_table (display,
&display->window_bindings,
&display->n_window_bindings,
prefs, n_prefs);
}
static void
@@ -814,7 +917,7 @@ meta_change_keygrab (MetaDisplay *display,
Window xwindow,
gboolean grab,
int keysym,
int keycode,
unsigned int keycode,
int modmask)
{
int ignored_mask;
@@ -885,7 +988,7 @@ static void
meta_grab_key (MetaDisplay *display,
Window xwindow,
int keysym,
int keycode,
unsigned int keycode,
int modmask)
{
meta_change_keygrab (display, xwindow, TRUE, keysym, keycode, modmask);
@@ -977,6 +1080,14 @@ meta_window_grab_keys (MetaWindow *window)
{
if (window->all_keys_grabbed)
return;
if (window->type == META_WINDOW_DOCK)
{
if (window->keys_grabbed)
ungrab_all_keys (window->display, window->xwindow);
window->keys_grabbed = FALSE;
return;
}
if (window->keys_grabbed)
{
@@ -1015,25 +1126,55 @@ meta_window_ungrab_keys (MetaWindow *window)
}
}
#ifdef WITH_VERBOSE_MODE
static const char*
grab_status_to_string (int status)
{
switch (status)
{
case AlreadyGrabbed:
return "AlreadyGrabbed";
case GrabSuccess:
return "GrabSuccess";
case GrabNotViewable:
return "GrabNotViewable";
case GrabFrozen:
return "GrabFrozen";
case GrabInvalidTime:
return "GrabInvalidTime";
default:
return "(unknown)";
}
}
#endif /* WITH_VERBOSE_MODE */
static gboolean
grab_keyboard (MetaDisplay *display,
Window xwindow)
{
int result;
int grab_status;
Time timestamp;
/* Grab the keyboard, so we get key releases and all key
* presses
*/
meta_error_trap_push_with_return (display);
if (XGrabKeyboard (display->xdisplay,
xwindow, True,
GrabModeAsync, GrabModeAsync,
meta_display_get_current_time (display)) != GrabSuccess)
timestamp = meta_display_get_current_time (display);
grab_status = XGrabKeyboard (display->xdisplay,
xwindow, True,
GrabModeAsync, GrabModeAsync,
timestamp);
if (grab_status != GrabSuccess)
{
meta_error_trap_pop_with_return (display, TRUE);
meta_topic (META_DEBUG_KEYBINDINGS,
"XGrabKeyboard() returned failure\n");
"XGrabKeyboard() returned failure status %s time %lu\n",
grab_status_to_string (grab_status),
(unsigned long) timestamp);
return FALSE;
}
else
{
@@ -1234,10 +1375,9 @@ is_specific_modifier (MetaDisplay *display,
return retval;
}
static gboolean
keycode_is_primary_modifier (MetaDisplay *display,
unsigned int keycode,
unsigned int entire_binding_mask)
static unsigned int
get_primary_modifier (MetaDisplay *display,
unsigned int entire_binding_mask)
{
/* The idea here is to see if the "main" modifier
* for Alt+Tab has been pressed/released. So if the binding
@@ -1250,20 +1390,62 @@ keycode_is_primary_modifier (MetaDisplay *display,
ShiftMask, LockMask };
int i;
meta_topic (META_DEBUG_KEYBINDINGS,
"Checking whether code 0x%x is the primary modifier of mask 0x%x\n",
keycode, entire_binding_mask);
i = 0;
while (i < (int) G_N_ELEMENTS (masks))
{
if (entire_binding_mask & masks[i])
return is_specific_modifier (display, keycode, masks[i]);
return masks[i];
++i;
}
return FALSE;
return 0;
}
static gboolean
keycode_is_primary_modifier (MetaDisplay *display,
unsigned int keycode,
unsigned int entire_binding_mask)
{
unsigned int primary_modifier;
meta_topic (META_DEBUG_KEYBINDINGS,
"Checking whether code 0x%x is the primary modifier of mask 0x%x\n",
keycode, entire_binding_mask);
primary_modifier = get_primary_modifier (display, entire_binding_mask);
if (primary_modifier != 0)
return is_specific_modifier (display, keycode, primary_modifier);
else
return FALSE;
}
static gboolean
primary_modifier_still_pressed (MetaDisplay *display,
unsigned int entire_binding_mask)
{
unsigned int primary_modifier;
int x, y, root_x, root_y;
Window root, child;
guint mask;
primary_modifier = get_primary_modifier (display, entire_binding_mask);
XQueryPointer (display->xdisplay,
display->no_focus_window, /* some random window */
&root, &child,
&root_x, &root_y,
&x, &y,
&mask);
meta_topic (META_DEBUG_KEYBINDINGS,
"Primary modifier 0x%x full grab mask 0x%x current state 0x%x\n",
primary_modifier, entire_binding_mask, mask);
if ((mask & primary_modifier) == 0)
return FALSE;
else
return TRUE;
}
static const MetaKeyHandler*
@@ -1304,13 +1486,18 @@ process_event (MetaKeyBinding *bindings,
i = 0;
while (i < n_bindings)
{
if (bindings[i].keysym == keysym &&
if (bindings[i].keycode == event->xkey.keycode &&
((event->xkey.state & ~(display->ignored_modifier_mask)) ==
bindings[i].mask) &&
event->type == KeyPress)
{
const MetaKeyHandler *handler;
meta_topic (META_DEBUG_KEYBINDINGS,
"Binding keycode 0x%x mask 0x%x matches event 0x%x state 0x%x\n",
bindings[i].keycode, bindings[i].mask,
event->xkey.keycode, event->xkey.state);
if (bindings[i].handler)
handler = bindings[i].handler;
else
@@ -1380,7 +1567,7 @@ meta_display_process_key_event (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing key %s event, keysym: %s state: 0x%x window: %s\n",
event->type == KeyPress ? "press" : "release",
str ? str : "(null)", event->xkey.state,
str ? str : "none", event->xkey.state,
window ? window->desc : "(no window)");
all_keys_grabbed = window ? window->all_keys_grabbed : screen->all_keys_grabbed;
@@ -1507,14 +1694,26 @@ process_keyboard_move_grab (MetaDisplay *display,
else
incr = NORMAL_INCREMENT;
if (keysym == XK_Escape)
{
/* End move and restore to original position */
meta_window_move_resize (display->grab_window,
TRUE,
display->grab_initial_window_pos.x,
display->grab_initial_window_pos.y,
display->grab_initial_window_pos.width,
display->grab_initial_window_pos.height);
}
/* When moving by increments, we still snap to edges if the move
* to the edge is smaller than the increment. This is because
* Shift + arrow to snap is sort of a hidden feature. This way
* people using just arrows shouldn't get too frustrated.
*/
switch (keysym)
{
case XK_KP_Home:
case XK_KP_Prior:
case XK_Up:
case XK_KP_Up:
edge = meta_window_find_next_horizontal_edge (window, FALSE);
@@ -1525,6 +1724,8 @@ process_keyboard_move_grab (MetaDisplay *display,
handled = TRUE;
break;
case XK_KP_End:
case XK_KP_Next:
case XK_Down:
case XK_KP_Down:
edge = meta_window_find_next_horizontal_edge (window, TRUE);
@@ -1535,6 +1736,12 @@ process_keyboard_move_grab (MetaDisplay *display,
handled = TRUE;
break;
}
switch (keysym)
{
case XK_KP_Home:
case XK_KP_End:
case XK_Left:
case XK_KP_Left:
edge = meta_window_find_next_vertical_edge (window, FALSE);
@@ -1545,6 +1752,8 @@ process_keyboard_move_grab (MetaDisplay *display,
handled = TRUE;
break;
case XK_KP_Prior:
case XK_KP_Next:
case XK_Right:
case XK_KP_Right:
edge = meta_window_find_next_vertical_edge (window, TRUE);
@@ -1553,19 +1762,6 @@ process_keyboard_move_grab (MetaDisplay *display,
x = edge;
handled = TRUE;
break;
case XK_Escape:
/* End move and restore to original position */
meta_window_move_resize (display->grab_window,
TRUE,
display->grab_initial_window_pos.x,
display->grab_initial_window_pos.y,
display->grab_initial_window_pos.width,
display->grab_initial_window_pos.height);
break;
default:
break;
}
if (handled)
@@ -2405,6 +2601,56 @@ handle_toggle_desktop (MetaDisplay *display,
meta_screen_show_desktop (screen);
}
static void
handle_panel_keybinding (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
XEvent *event,
MetaKeyBinding *binding)
{
MetaKeyBindingAction action;
Atom action_atom;
XClientMessageEvent ev;
action = GPOINTER_TO_INT (binding->handler->data);
action_atom = None;
switch (action)
{
case META_KEYBINDING_ACTION_PANEL_MAIN_MENU:
action_atom = display->atom_gnome_panel_action_main_menu;
break;
case META_KEYBINDING_ACTION_PANEL_RUN_DIALOG:
action_atom = display->atom_gnome_panel_action_run_dialog;
break;
default:
return;
}
ev.type = ClientMessage;
ev.window = screen->xroot;
ev.message_type = display->atom_gnome_panel_action;
ev.format = 32;
ev.data.l[0] = action_atom;
ev.data.l[1] = event->xkey.time;
meta_topic (META_DEBUG_KEYBINDINGS,
"Sending panel message with timestamp %lu\n", event->xkey.time);
meta_error_trap_push (display);
/* Release the grab for the panel before sending the event */
XUngrabKeyboard (display->xdisplay, event->xkey.time);
XSendEvent (display->xdisplay,
screen->xroot,
False,
StructureNotifyMask,
(XEvent*) &ev);
meta_error_trap_pop (display, FALSE);
}
static void
handle_activate_menu (MetaDisplay *display,
MetaScreen *screen,
@@ -2518,15 +2764,30 @@ do_choose_window (MetaDisplay *display,
binding->mask,
event->xkey.time,
0, 0))
{
meta_ui_tab_popup_select (screen->tab_popup,
(MetaTabEntryKey) initial_selection->xwindow);
if (show_popup)
meta_ui_tab_popup_set_showing (screen->tab_popup,
TRUE);
{
if (!primary_modifier_still_pressed (display,
binding->mask))
{
/* This handles a race where modifier might be released
* before we establish the grab. must end grab
* prior to trying to focus a window.
*/
meta_topic (META_DEBUG_FOCUS, "Ending grab and activating %s due to switch/cycle windows where modifier was released prior to grab\n",
initial_selection->desc);
meta_display_end_grab_op (display, event->xkey.time);
meta_window_activate (initial_selection, event->xkey.time);
}
else
meta_window_raise (initial_selection);
{
meta_ui_tab_popup_select (screen->tab_popup,
(MetaTabEntryKey) initial_selection->xwindow);
if (show_popup)
meta_ui_tab_popup_set_showing (screen->tab_popup,
TRUE);
else
meta_window_raise (initial_selection);
}
}
}
}
@@ -2842,6 +3103,7 @@ handle_workspace_switch (MetaDisplay *display,
MetaKeyBinding *binding)
{
int motion;
unsigned int grab_mask;
motion = GPOINTER_TO_INT (binding->handler->data);
@@ -2850,31 +3112,49 @@ handle_workspace_switch (MetaDisplay *display,
meta_topic (META_DEBUG_KEYBINDINGS,
"Starting tab between workspaces, showing popup\n");
/* FIXME should we use binding->mask ? */
grab_mask = event->xkey.state & ~(display->ignored_modifier_mask);
if (meta_display_begin_grab_op (display,
screen,
NULL,
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
FALSE,
0,
event->xkey.state & ~(display->ignored_modifier_mask),
grab_mask,
event->xkey.time,
0, 0))
{
MetaWorkspace *next;
gboolean grabbed_before_release;
next = meta_workspace_get_neighbor (screen->active_workspace, motion);
g_assert (next);
grabbed_before_release = primary_modifier_still_pressed (display, grab_mask);
meta_topic (META_DEBUG_KEYBINDINGS,
"Activating target workspace\n");
if (!grabbed_before_release)
{
/* end the grab right away, modifier possibly released
* before we could establish the grab and receive the
* release event. Must end grab before we can switch
* spaces.
*/
meta_display_end_grab_op (display, event->xkey.time);
}
switch_to_workspace (display, next);
meta_ui_tab_popup_select (screen->tab_popup, (MetaTabEntryKey) next);
/* only after selecting proper space */
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE);
if (grabbed_before_release)
{
meta_ui_tab_popup_select (screen->tab_popup, (MetaTabEntryKey) next);
/* only after selecting proper space */
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE);
}
}
}

View File

@@ -61,7 +61,7 @@ log_handler (const gchar *log_domain,
static void
usage (void)
{
g_print (_("metacity [--disable-sm] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace] [--version]\n"));
g_print (_("metacity [--sm-disable] [--sm-client-id=ID] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace] [--version]\n"));
exit (1);
}
@@ -271,6 +271,22 @@ main (int argc, char **argv)
#else
meta_topic (META_DEBUG_XINERAMA, " (not using Solaris Xinerama)\n");
#endif
#ifdef HAVE_XSYNC
meta_verbose ("Compiled with sync extension\n");
#else
meta_verbose ("Compiled without sync extension\n");
#endif
#ifdef HAVE_RANDR
meta_verbose ("Compiled with randr extension\n");
#else
meta_verbose ("Compiled without randr extension\n");
#endif
#ifdef HAVE_STARTUP_NOTIFICATION
meta_verbose ("Compiled with startup notification\n");
#else
meta_verbose ("Compiled without startup notification\n");
#endif
/* Load prefs */
meta_prefs_init ();
@@ -316,6 +332,9 @@ main (int argc, char **argv)
/* Try some panic stuff, this is lame but we really
* don't want users to lose their WM :-/
*/
if (!meta_ui_have_a_theme ())
meta_ui_set_current_theme ("Simple", FALSE);
if (!meta_ui_have_a_theme ())
meta_ui_set_current_theme ("Atlanta", FALSE);

View File

@@ -241,10 +241,10 @@ meta_window_menu_new (MetaFrames *frames,
menu->insensitive = insensitive;
menu->menu = gtk_menu_new ();
#ifdef HAVE_GTK_MULTIHEAD
gtk_menu_set_screen (GTK_MENU (menu->menu),
gtk_widget_get_screen (GTK_WIDGET (frames)));
#endif
i = 0;
while (i < (int) G_N_ELEMENTS (menuitems))
{
@@ -316,25 +316,17 @@ meta_window_menu_new (MetaFrames *frames,
meta_verbose ("Creating %d-workspace menu current space %d\n",
n_workspaces, active_workspace);
if (n_workspaces > 0)
if (n_workspaces > 1)
{
GtkWidget *mi;
Display *display;
Window xroot;
GdkScreen *screen;
display = gdk_x11_drawable_get_xdisplay (GTK_WIDGET (frames)->window);
#ifdef HAVE_GTK_MULTIHEAD
{
GdkScreen *screen;
screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window);
xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen));
}
#else
{
xroot = gdk_x11_get_default_root_xwindow ();
}
#endif
screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window);
xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen));
i = 0;
while (i < n_workspaces)

View File

@@ -8,7 +8,7 @@
<applyto>/apps/metacity/general/mouse_button_modifier</applyto>
<owner>metacity</owner>
<type>string</type>
<default>&lt;Super&gt;</default>
<default>&lt;Alt&gt;</default>
<locale name="C">
<short>Modifier to use for modified window click actions</short>
<long>
@@ -71,8 +71,8 @@
<short>Action on title bar double-click</short>
<long>
This option determines the effects of double-clicking on the
title bar. Current valid options are 'toggle_shaded', which will
shade/unshade the window, and 'toggle_maximized' which will
title bar. Current valid options are 'toggle_shade', which will
shade/unshade the window, and 'toggle_maximize' which will
maximize/unmaximize the window.
</long>
</locale>
@@ -114,7 +114,7 @@
<applyto>/apps/metacity/general/theme</applyto>
<owner>metacity</owner>
<type>string</type>
<default>Atlanta</default>
<default>Simple</default>
<locale name="C">
<short>Current theme</short>
<long>
@@ -177,6 +177,57 @@
</locale>
</schema>
<schema>
<key>/apps/metacity/visual_bell</key>
<applyto>/apps/metacity/general/visual_bell</applyto>
<owner>metacity</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Enable Visual Bell</short>
<long>Turns on a visual indication when an application or the system
issues a 'bell' or 'beep'; useful for the hard-of-hearing and for use
in noisy environments, or when 'audible bell' is off.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/general/audible_bell</key>
<applyto>/apps/metacity/general/audible_bell</applyto>
<owner>metacity</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>System Bell is Audible</short>
<long>Determines whether applications or the system can generate audible
'beeps'; may be used in conjunction with 'visual bell' to
allow silent 'beeps'.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/general/visual_bell_type</key>
<applyto>/apps/metacity/general/visual_bell_type</applyto>
<owner>metacity</owner>
<type>string</type>
<default>fullscreen</default>
<locale name="C">
<short>Visual Bell Type</short>
<long>
Tells Metacity how to implement the visual indication that
the system bell or another application 'bell' indicator has
been rung. Currently there are two valid values, "fullscreen",
which causes a fullscreen white-black flash, and "frame_flash" which
causes the titlebar of the application which sent the bell signal to
flash. If the application which sent the bell is unknown (as is
usually the case for the default "system beep"), the currently
focused window's titlebar is flashed.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/workspace_names/name</key>
<applyto>/apps/metacity/workspace_names/name_1</applyto>
@@ -317,7 +368,7 @@ you set
<applyto>/apps/metacity/window_keybindings/toggle_shaded</applyto>
<owner>metacity</owner>
<type>string</type>
<default>disabled</default>
<default>&lt;Alt&gt;F12</default>
<locale name="C">
<short>Toggle shaded state</short>
<long>
@@ -1548,6 +1599,100 @@ you set
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/global_keybindings/panel_main_menu</key>
<applyto>/apps/metacity/global_keybindings/panel_main_menu</applyto>
<owner>metacity</owner>
<type>string</type>
<default>&lt;Alt&gt;F1</default>
<locale name="C">
<short>Show the panel menu</short>
<long>
The keybinding which shows the panel's main menu.
The format looks like "&lt;Control&gt;a" or
"&lt;Shift&gt;&lt;Alt&gt;F1.
The parser is fairly liberal and allows lower or upper case,
and also abbreviations such as "&lt;Ctl&gt;" and
"&lt;Ctrl&gt;". If you set the option to the special string
"disabled", then there will be no keybinding for this
action.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/global_keybindings/panel_run_dialog</key>
<applyto>/apps/metacity/global_keybindings/panel_run_dialog</applyto>
<owner>metacity</owner>
<type>string</type>
<default>&lt;Alt&gt;F2</default>
<locale name="C">
<short>Show the panel run dialog</short>
<long>
The keybinding which display's the panel's "Run Program" dialog
box.
The format looks like "&lt;Control&gt;a" or
"&lt;Shift&gt;&lt;Alt&gt;F1.
The parser is fairly liberal and allows lower or upper case,
and also abbreviations such as "&lt;Ctl&gt;" and
"&lt;Ctrl&gt;". If you set the option to the special string
"disabled", then there will be no keybinding for this
action.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/global_keybindings/run_command_screenshot</key>
<applyto>/apps/metacity/global_keybindings/run_command_screenshot</applyto>
<owner>metacity</owner>
<type>string</type>
<default>Print</default>
<locale name="C">
<short>Take a screenshot</short>
<long>
The keybinding which invokes the panel's screenshot utility.
The format looks like "&lt;Control&gt;a" or
"&lt;Shift&gt;&lt;Alt&gt;F1.
The parser is fairly liberal and allows lower or upper case,
and also abbreviations such as "&lt;Ctl&gt;" and
"&lt;Ctrl&gt;". If you set the option to the special string
"disabled", then there will be no keybinding for this
action.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/global_keybindings/run_command_window_screenshot</key>
<applyto>/apps/metacity/global_keybindings/run_command_window_screenshot</applyto>
<owner>metacity</owner>
<type>string</type>
<default>&lt;Alt&gt;Print</default>
<locale name="C">
<short>Take a screenshot of a window</short>
<long>
The keybinding which invokes the panel's screenshot utility
to take a screenshot of a window.
The format looks like "&lt;Control&gt;a" or
"&lt;Shift&gt;&lt;Alt&gt;F1.
The parser is fairly liberal and allows lower or upper case,
and also abbreviations such as "&lt;Ctl&gt;" and
"&lt;Ctrl&gt;". If you set the option to the special string
"disabled", then there will be no keybinding for this
action.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/global_keybindings/run_command</key>
<applyto>/apps/metacity/global_keybindings/run_command_1</applyto>
@@ -1585,6 +1730,38 @@ you set
<!-- commands to run with the run_command keybindings -->
<schema>
<key>/schemas/apps/metacity/keybinding_commands/command_screenshot</key>
<applyto>/apps/metacity/keybinding_commands/command_screenshot</applyto>
<owner>metacity</owner>
<type>string</type>
<default>gnome-panel-screenshot</default>
<locale name="C">
<short>The screenshot command</short>
<long>
The /apps/metacity/global_keybindings/run_command_screenshot
key defines a keybinding which causes the command specified
by this setting to be invoked.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/keybinding_commands/command_window_screenshot</key>
<applyto>/apps/metacity/keybinding_commands/command_window_screenshot</applyto>
<owner>metacity</owner>
<type>string</type>
<default>gnome-panel-screenshot --window</default>
<locale name="C">
<short>The window screenshot command</short>
<long>
The /apps/metacity/global_keybindings/run_command_window_screenshot
key defines a keybinding which causes the command specified
by this setting to be invoked.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/metacity/keybinding_commands/command</key>
<applyto>/apps/metacity/keybinding_commands/command_1</applyto>

View File

@@ -2,6 +2,8 @@
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat, Inc.
* Copyright (C) 2003 Rob Adams
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -90,7 +92,8 @@ find_next_cascade (MetaWindow *window,
int x_threshold, y_threshold;
int window_width, window_height;
int cascade_stage;
MetaRectangle work_area;
MetaRectangle work_area;
const MetaXineramaScreenInfo* current;
sorted = g_list_copy (windows);
sorted = g_list_sort (sorted, northwestcmp);
@@ -120,13 +123,10 @@ find_next_cascade (MetaWindow *window,
* cascade_x, cascade_y are the target position
* of NW corner of window frame.
*/
/* FIXME this is bogus because we get the current xinerama
* for the window based on its position, but we haven't
* placed it yet.
*/
meta_window_get_work_area (window, TRUE, &work_area);
current = meta_screen_get_current_xinerama (window->screen);
meta_window_get_work_area_for_xinerama (window, current->number, &work_area);
cascade_x = MAX (0, work_area.x);
cascade_y = MAX (0, work_area.y);
@@ -363,63 +363,32 @@ topmost_cmp (gconstpointer a, gconstpointer b)
return 0;
}
static gboolean
fit_rect_in_xinerama (MetaScreen *screen,
MetaRectangle *rect)
static void
center_tile_rect_in_area (MetaRectangle *rect,
MetaRectangle *work_area)
{
int i;
int best_index;
int best_overlap;
const MetaXineramaScreenInfo *xsi;
/* Find xinerama with best fit, then
* shift rect to be entirely within it.
int fluff;
/* The point here is to tile a window such that "extra"
* space is equal on either side (i.e. so a full screen
* of windows tiled this way would center the windows
* as a group)
*/
best_overlap = -1;
best_index = -1;
i = 0;
while (i < screen->n_xinerama_infos)
{
MetaRectangle xinerama_rect;
MetaRectangle intersect;
int overlap;
xsi = &screen->xinerama_infos[i];
xinerama_rect.x = xsi->x_origin;
xinerama_rect.y = xsi->y_origin;
xinerama_rect.width = xsi->width;
xinerama_rect.height = xsi->height;
fluff = (work_area->width % (rect->width+1)) / 2;
rect->x = work_area->x + fluff;
fluff = (work_area->height % (rect->height+1)) / 3;
rect->y = work_area->y + fluff;
}
if (meta_rectangle_intersect (rect, &xinerama_rect, &intersect))
overlap = intersect.width * intersect.height;
else
overlap = 0;
if (overlap > best_overlap)
{
best_index = i;
best_overlap = overlap;
}
++i;
}
/* some overlap had to be better than -1 */
g_assert (best_index >= 0);
xsi = &screen->xinerama_infos[best_index];
if (rect->x < xsi->x_origin)
rect->x = xsi->x_origin;
if (rect->y < xsi->y_origin)
rect->y = xsi->y_origin;
/* Now return whether we are entirely within the xinerama screen */
return
((rect->x + rect->width) < (xsi->x_origin + xsi->width)) &&
((rect->y + rect->height) < (xsi->y_origin + xsi->height));
static gboolean
rect_fits_in_work_area (MetaRectangle *work_area,
MetaRectangle *rect)
{
return ((rect->x >= work_area->x) &&
(rect->y >= work_area->y) &&
(rect->x + rect->width <= work_area->x + work_area->width) &&
(rect->y + rect->height <= work_area->y + work_area->height));
}
/* Find the leftmost, then topmost, empty area on the workspace
@@ -446,16 +415,28 @@ find_first_fit (MetaWindow *window,
* the bottom of each existing window, and then to the right
* of each existing window, aligned with the left/top of the
* existing window in each of those cases.
*/
*/
int retval;
GList *sorted;
GList *below_sorted;
GList *right_sorted;
GList *tmp;
MetaRectangle rect;
MetaRectangle work_area;
int i;
int* xineramas_list;
int n_xineramas;
retval = FALSE;
sorted = NULL;
/* Below each window */
below_sorted = g_list_copy (windows);
below_sorted = g_list_sort (below_sorted, leftmost_cmp);
below_sorted = g_list_sort (below_sorted, topmost_cmp);
/* To the right of each window */
right_sorted = g_list_copy (windows);
right_sorted = g_list_sort (right_sorted, topmost_cmp);
right_sorted = g_list_sort (right_sorted, leftmost_cmp);
rect.width = window->rect.width;
rect.height = window->rect.height;
@@ -466,104 +447,29 @@ find_first_fit (MetaWindow *window,
rect.height += fgeom->top_height + fgeom->bottom_height;
}
/* Try origin of first Xinerama */
rect.x = window->screen->xinerama_infos[0].x_origin;
rect.y = window->screen->xinerama_infos[0].y_origin;
if (fit_rect_in_xinerama (window->screen, &rect) &&
!rectangle_overlaps_some_window (&rect, windows))
meta_screen_get_natural_xinerama_list (window->screen,
&xineramas_list,
&n_xineramas);
for (i = 0; i < n_xineramas; i++)
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
retval = TRUE;
goto out;
}
sorted = g_list_copy (windows);
/* Below each window */
sorted = g_list_sort (sorted, leftmost_cmp);
sorted = g_list_sort (sorted, topmost_cmp);
tmp = sorted;
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
MetaRectangle outer_rect;
meta_window_get_outer_rect (w, &outer_rect);
rect.x = outer_rect.x;
rect.y = outer_rect.y + outer_rect.height;
if (fit_rect_in_xinerama (window->screen, &rect) &&
!rectangle_overlaps_some_window (&rect, sorted))
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
retval = TRUE;
goto out;
}
tmp = tmp->next;
meta_topic (META_DEBUG_XINERAMA,
"Natural xinerama %d is %d,%d %dx%d\n",
i,
window->screen->xinerama_infos[xineramas_list[i]].x_origin,
window->screen->xinerama_infos[xineramas_list[i]].y_origin,
window->screen->xinerama_infos[xineramas_list[i]].width,
window->screen->xinerama_infos[xineramas_list[i]].height);
}
/* To the right of each window */
sorted = g_list_sort (sorted, topmost_cmp);
sorted = g_list_sort (sorted, leftmost_cmp);
tmp = sorted;
while (tmp != NULL)
/* try each xinerama in the natural ordering in turn */
i = 0;
while (i < n_xineramas)
{
MetaWindow *w = tmp->data;
MetaRectangle outer_rect;
meta_window_get_outer_rect (w, &outer_rect);
meta_window_get_work_area_for_xinerama (window, xineramas_list[i], &work_area);
rect.x = outer_rect.x + outer_rect.width;
rect.y = outer_rect.y;
if (fit_rect_in_xinerama (window->screen, &rect) &&
!rectangle_overlaps_some_window (&rect, sorted))
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
center_tile_rect_in_area (&rect, &work_area);
retval = TRUE;
goto out;
}
tmp = tmp->next;
}
/* Origin of each Xinerama screen which isn't the first */
i = 1;
while (i < window->screen->n_xinerama_infos)
{
rect.x = window->screen->xinerama_infos[i].x_origin;
rect.y = window->screen->xinerama_infos[i].y_origin;
if (fit_rect_in_xinerama (window->screen, &rect) &&
if (rect_fits_in_work_area (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, windows))
{
*new_x = rect.x;
@@ -578,11 +484,77 @@ find_first_fit (MetaWindow *window,
goto out;
}
/* try below each window */
tmp = below_sorted;
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
MetaRectangle outer_rect;
meta_window_get_outer_rect (w, &outer_rect);
rect.x = outer_rect.x;
rect.y = outer_rect.y + outer_rect.height;
if (rect_fits_in_work_area (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, below_sorted))
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
retval = TRUE;
goto out;
}
tmp = tmp->next;
}
/* try to the right of each window */
tmp = right_sorted;
while (tmp != NULL)
{
MetaWindow *w = tmp->data;
MetaRectangle outer_rect;
meta_window_get_outer_rect (w, &outer_rect);
rect.x = outer_rect.x + outer_rect.width;
rect.y = outer_rect.y;
if (rect_fits_in_work_area (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, right_sorted))
{
*new_x = rect.x;
*new_y = rect.y;
if (fgeom)
{
*new_x += fgeom->left_width;
*new_y += fgeom->top_height;
}
retval = TRUE;
goto out;
}
tmp = tmp->next;
}
++i;
}
out:
g_list_free (sorted);
g_free (xineramas_list);
g_list_free (below_sorted);
g_list_free (right_sorted);
return retval;
}
@@ -602,17 +574,18 @@ constrain_placement (MetaWindow *window,
int nw_x, nw_y;
int offscreen_w, offscreen_h;
MetaRectangle outer_rect;
meta_window_get_outer_rect (window, &outer_rect);
/* FIXME this is bogus because we get the current xinerama
* for the window based on its position, but we haven't
* placed it yet.
*/
meta_window_get_work_area (window, TRUE, &work_area);
meta_window_get_work_area_current_xinerama (window, &work_area);
nw_x = work_area.x;
nw_y = work_area.y;
if (window->frame)
{
nw_x += fgeom->left_width;
@@ -849,6 +822,7 @@ meta_window_place (MetaWindow *window,
constrain_placement (window, fgeom, x, y, &x, &y);
done_no_constraints:
*new_x = x;
*new_y = y;
}
@@ -942,17 +916,17 @@ get_vertical_edges (MetaWindow *window,
windows = get_windows_on_same_workspace (window, &n_windows);
i = 0;
n_edges = n_windows * 2 + 4 + window->screen->n_xinerama_infos - 1; /* 4 = workspace/screen edges */
/* 4 = workspace/screen edges */
n_edges = n_windows * 2 + 4 + window->screen->n_xinerama_infos - 1;
edges = g_new (int, n_edges);
/* workspace/screen edges */
meta_window_get_work_area (window, FALSE, &work_area);
meta_window_get_work_area_current_xinerama (window, &work_area);
edges[i] = work_area.x;
++i;
edges[i] =
work_area.x +
work_area.width;
edges[i] = work_area.x + work_area.width;
++i;
edges[i] = 0;
++i;
@@ -1019,13 +993,11 @@ get_horizontal_edges (MetaWindow *window,
edges = g_new (int, n_edges);
/* workspace/screen edges */
meta_window_get_work_area (window, FALSE, &work_area);
meta_window_get_work_area_current_xinerama (window, &work_area);
edges[i] = work_area.y;
++i;
edges[i] =
work_area.y +
work_area.height;
edges[i] = work_area.y + work_area.height;
++i;
edges[i] = 0;
++i;
@@ -1207,7 +1179,6 @@ meta_window_find_next_horizontal_edge (MetaWindow *window,
return retval;
}
int
meta_window_find_nearest_vertical_edge (MetaWindow *window,
int x_pos)

View File

@@ -29,8 +29,12 @@
#include <string.h>
#include <stdlib.h>
#define MAX_REASONABLE_WORKSPACES 32
#define MAX_COMMANDS 32
#define MAX_REASONABLE_WORKSPACES 36
#define MAX_COMMANDS (32 + NUM_EXTRA_COMMANDS)
#define NUM_EXTRA_COMMANDS 2
#define SCREENSHOT_COMMAND_IDX (MAX_COMMANDS - 2)
#define WIN_SCREENSHOT_COMMAND_IDX (MAX_COMMANDS - 1)
/* If you add a key, it needs updating in init() and in the gconf
* notify listener and of course in the .schemas file
@@ -54,6 +58,10 @@
#define KEY_WORKSPACE_NAME_PREFIX "/apps/metacity/workspace_names/name_"
#define KEY_VISUAL_BELL "/apps/metacity/general/visual_bell"
#define KEY_AUDIBLE_BELL "/apps/metacity/general/audible_bell"
#define KEY_VISUAL_BELL_TYPE "/apps/metacity/general/visual_bell_type"
#ifdef HAVE_GCONF
static GConfClient *default_client = NULL;
static GList *changes = NULL;
@@ -73,6 +81,9 @@ static gboolean application_based = FALSE;
static gboolean disable_workarounds = FALSE;
static gboolean auto_raise = FALSE;
static gboolean auto_raise_delay = 500;
static gboolean provide_visual_bell = TRUE;
static gboolean bell_is_audible = TRUE;
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_INVALID;
static MetaButtonLayout button_layout = {
{
META_BUTTON_FUNCTION_MENU,
@@ -88,6 +99,7 @@ static MetaButtonLayout button_layout = {
}
};
/* The screenshot commands are at the end */
static char *commands[MAX_COMMANDS] = { NULL, };
static char *workspace_names[MAX_REASONABLE_WORKSPACES] = { NULL, };
@@ -98,6 +110,8 @@ static gboolean update_titlebar_font (const char *value);
static gboolean update_mouse_button_mods (const char *value);
static gboolean update_focus_mode (const char *value);
static gboolean update_theme (const char *value);
static gboolean update_visual_bell (gboolean v1, gboolean v2);
static gboolean update_visual_bell_type (const char *value);
static gboolean update_num_workspaces (int value);
static gboolean update_application_based (gboolean value);
static gboolean update_disable_workarounds (gboolean value);
@@ -273,7 +287,7 @@ meta_prefs_init (void)
GError *err = NULL;
char *str_val;
int int_val;
gboolean bool_val;
gboolean bool_val, bool_val_2;
if (default_client != NULL)
return;
@@ -360,6 +374,20 @@ meta_prefs_init (void)
g_free (str_val);
#endif /* HAVE_GCONF */
bool_val = gconf_client_get_bool (default_client, KEY_VISUAL_BELL,
&err);
cleanup_error (&err);
bool_val_2 = gconf_client_get_bool (default_client, KEY_AUDIBLE_BELL,
&err);
cleanup_error (&err);
update_visual_bell (bool_val, bool_val_2);
str_val = gconf_client_get_string (default_client, KEY_VISUAL_BELL_TYPE,
&err);
cleanup_error (&err);
update_visual_bell_type (str_val);
g_free (str_val);
/* Load keybindings prefs */
init_bindings ();
@@ -375,7 +403,7 @@ meta_prefs_init (void)
NULL,
NULL,
&err);
cleanup_error (&err);
cleanup_error (&err);
#endif /* HAVE_GCONF */
}
@@ -674,6 +702,37 @@ change_notify (GConfClient *client,
if (update_button_layout (str))
queue_changed (META_PREF_BUTTON_LAYOUT);
}
else if (strcmp (key, KEY_VISUAL_BELL) == 0)
{
gboolean b;
b = value ? gconf_value_get_bool (value) : provide_visual_bell;
if (update_visual_bell (b, bell_is_audible))
queue_changed (META_PREF_VISUAL_BELL);
}
else if (strcmp (key, KEY_AUDIBLE_BELL) == 0)
{
gboolean b;
b = value ? gconf_value_get_bool (value) : bell_is_audible;
if (update_visual_bell (provide_visual_bell, b))
queue_changed (META_PREF_AUDIBLE_BELL);
}
else if (strcmp (key, KEY_VISUAL_BELL_TYPE) == 0)
{
const char * str;
if (value && value->type != GCONF_VALUE_STRING)
{
meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
KEY_VISUAL_BELL_TYPE);
goto out;
}
str = value ? gconf_value_get_string (value) : NULL;
if (update_visual_bell_type (str))
queue_changed (META_PREF_VISUAL_BELL_TYPE);
}
else
{
meta_topic (META_DEBUG_PREFS, "Key %s doesn't mean anything to Metacity\n",
@@ -803,8 +862,51 @@ update_use_system_font (gboolean value)
return old != value;
}
static MetaVisualBellType
visual_bell_type_from_string (const char *value)
{
if (value)
{
if (!strcmp (value, "fullscreen"))
{
return META_VISUAL_BELL_FULLSCREEN_FLASH;
}
else if (!strcmp (value, "frame_flash"))
{
return META_VISUAL_BELL_FRAME_FLASH;
}
}
return META_VISUAL_BELL_FULLSCREEN_FLASH;
}
static gboolean
update_visual_bell_type (const char *value)
{
MetaVisualBellType old_bell_type;
old_bell_type = visual_bell_type;
visual_bell_type = visual_bell_type_from_string (value);
return (visual_bell_type != old_bell_type);
}
#endif /* HAVE_GCONF */
static gboolean
update_visual_bell (gboolean visual_bell, gboolean audible_bell)
{
gboolean old_visual = provide_visual_bell;
gboolean old_audible = bell_is_audible;
gboolean has_changed;
provide_visual_bell = visual_bell;
bell_is_audible = audible_bell;
has_changed = (old_visual != provide_visual_bell) ||
(old_audible != bell_is_audible);
return has_changed;
}
#ifdef HAVE_GCONF
static gboolean
update_titlebar_font (const char *value)
@@ -1028,7 +1130,12 @@ update_application_based (gboolean value)
{
gboolean old = application_based;
/* DISABLE application_based feature for now */
#if 0
application_based = value;
#else
application_based = FALSE;
#endif
return old != application_based;
}
@@ -1186,6 +1293,18 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_WORKSPACE_NAMES:
return "WORKSPACE_NAMES";
break;
case META_PREF_VISUAL_BELL:
return "VISUAL_BELL";
break;
case META_PREF_AUDIBLE_BELL:
return "AUDIBLE_BELL";
break;
case META_PREF_VISUAL_BELL_TYPE:
return "VISUAL_BELL_TYPE";
break;
}
return "(unknown)";
@@ -1224,80 +1343,104 @@ meta_prefs_set_num_workspaces (int n_workspaces)
/* Indexes must correspond to MetaKeybindingAction */
static MetaKeyPref screen_bindings[] = {
{ META_KEYBINDING_WORKSPACE_1, 0, 0 },
{ META_KEYBINDING_WORKSPACE_2, 0, 0 },
{ META_KEYBINDING_WORKSPACE_3, 0, 0 },
{ META_KEYBINDING_WORKSPACE_4, 0, 0 },
{ META_KEYBINDING_WORKSPACE_5, 0, 0 },
{ META_KEYBINDING_WORKSPACE_6, 0, 0 },
{ META_KEYBINDING_WORKSPACE_7, 0, 0 },
{ META_KEYBINDING_WORKSPACE_8, 0, 0 },
{ META_KEYBINDING_WORKSPACE_9, 0, 0 },
{ META_KEYBINDING_WORKSPACE_10, 0, 0 },
{ META_KEYBINDING_WORKSPACE_11, 0, 0 },
{ META_KEYBINDING_WORKSPACE_12, 0, 0 },
{ META_KEYBINDING_WORKSPACE_LEFT, 0, 0 },
{ META_KEYBINDING_WORKSPACE_RIGHT, 0, 0 },
{ META_KEYBINDING_WORKSPACE_UP, 0, 0 },
{ META_KEYBINDING_WORKSPACE_DOWN, 0, 0 },
{ META_KEYBINDING_SWITCH_WINDOWS, 0, 0 },
{ META_KEYBINDING_SWITCH_WINDOWS_BACKWARD, 0, 0 },
{ META_KEYBINDING_SWITCH_PANELS, 0, 0 },
{ META_KEYBINDING_SWITCH_PANELS_BACKWARD, 0, 0 },
{ META_KEYBINDING_CYCLE_WINDOWS, 0, 0 },
{ META_KEYBINDING_CYCLE_WINDOWS_BACKWARD, 0, 0 },
{ META_KEYBINDING_CYCLE_PANELS, 0, 0 },
{ META_KEYBINDING_CYCLE_PANELS_BACKWARD, 0, 0 },
{ META_KEYBINDING_SHOW_DESKTOP, 0, 0 },
{ META_KEYBINDING_COMMAND_1, 0, 0 },
{ META_KEYBINDING_COMMAND_2, 0, 0 },
{ META_KEYBINDING_COMMAND_3, 0, 0 },
{ META_KEYBINDING_COMMAND_4, 0, 0 },
{ META_KEYBINDING_COMMAND_5, 0, 0 },
{ META_KEYBINDING_COMMAND_6, 0, 0 },
{ META_KEYBINDING_COMMAND_7, 0, 0 },
{ META_KEYBINDING_COMMAND_8, 0, 0 },
{ META_KEYBINDING_COMMAND_9, 0, 0 },
{ META_KEYBINDING_COMMAND_10, 0, 0 },
{ META_KEYBINDING_COMMAND_11, 0, 0 },
{ META_KEYBINDING_COMMAND_12, 0, 0 },
{ NULL, 0, 0 }
{ META_KEYBINDING_WORKSPACE_1, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_2, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_3, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_4, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_5, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_6, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_7, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_8, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_9, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_10, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_11, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_12, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_LEFT, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_RIGHT, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_UP, 0, 0, FALSE },
{ META_KEYBINDING_WORKSPACE_DOWN, 0, 0, FALSE },
{ META_KEYBINDING_SWITCH_WINDOWS, 0, 0, TRUE },
{ META_KEYBINDING_SWITCH_WINDOWS_BACKWARD, 0, 0, TRUE },
{ META_KEYBINDING_SWITCH_PANELS, 0, 0, TRUE },
{ META_KEYBINDING_SWITCH_PANELS_BACKWARD, 0, 0, TRUE },
{ META_KEYBINDING_CYCLE_WINDOWS, 0, 0, TRUE },
{ META_KEYBINDING_CYCLE_WINDOWS_BACKWARD, 0, 0, TRUE },
{ META_KEYBINDING_CYCLE_PANELS, 0, 0, TRUE },
{ META_KEYBINDING_CYCLE_PANELS_BACKWARD, 0, 0, TRUE },
{ META_KEYBINDING_SHOW_DESKTOP, 0, 0, FALSE },
{ META_KEYBINDING_PANEL_MAIN_MENU, 0, 0, FALSE },
{ META_KEYBINDING_PANEL_RUN_DIALOG, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_1, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_2, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_3, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_4, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_5, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_6, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_7, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_8, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_9, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_10, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_11, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_12, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_13, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_14, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_15, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_16, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_17, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_18, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_19, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_20, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_21, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_22, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_23, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_24, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_25, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_26, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_27, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_28, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_29, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_30, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_31, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_32, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_SCREENSHOT, 0, 0, FALSE },
{ META_KEYBINDING_COMMAND_WIN_SCREENSHOT, 0, 0, FALSE },
{ NULL, 0, 0, FALSE}
};
static MetaKeyPref window_bindings[] = {
{ META_KEYBINDING_WINDOW_MENU, 0, 0 },
{ META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0 },
{ META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0 },
{ META_KEYBINDING_MAXIMIZE, 0, 0 },
{ META_KEYBINDING_UNMAXIMIZE, 0, 0 },
{ META_KEYBINDING_TOGGLE_SHADE, 0, 0 },
{ META_KEYBINDING_MINIMIZE, 0, 0 },
{ META_KEYBINDING_CLOSE, 0, 0 },
{ META_KEYBINDING_BEGIN_MOVE, 0, 0 },
{ META_KEYBINDING_BEGIN_RESIZE, 0, 0 },
{ META_KEYBINDING_TOGGLE_STICKY, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_1, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_2, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_3, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_4, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_5, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_6, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_7, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_8, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_9, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_10, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_11, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_12, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_LEFT, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_RIGHT, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_UP, 0, 0 },
{ META_KEYBINDING_MOVE_WORKSPACE_DOWN, 0, 0 },
{ META_KEYBINDING_RAISE_OR_LOWER, 0, 0 },
{ META_KEYBINDING_RAISE, 0, 0 },
{ META_KEYBINDING_LOWER, 0, 0 },
{ META_KEYBINDING_MAXIMIZE_VERTICALLY, 0, 0 },
{ META_KEYBINDING_MAXIMIZE_HORIZONTALLY, 0, 0 },
{ NULL, 0, 0 }
{ META_KEYBINDING_WINDOW_MENU, 0, 0, FALSE },
{ META_KEYBINDING_TOGGLE_FULLSCREEN, 0, 0, FALSE },
{ META_KEYBINDING_TOGGLE_MAXIMIZE, 0, 0, FALSE },
{ META_KEYBINDING_MAXIMIZE, 0, 0, FALSE },
{ META_KEYBINDING_UNMAXIMIZE, 0, 0, FALSE },
{ META_KEYBINDING_TOGGLE_SHADE, 0, 0, FALSE },
{ META_KEYBINDING_MINIMIZE, 0, 0, FALSE },
{ META_KEYBINDING_CLOSE, 0, 0, FALSE },
{ META_KEYBINDING_BEGIN_MOVE, 0, 0, FALSE },
{ META_KEYBINDING_BEGIN_RESIZE, 0, 0, FALSE },
{ META_KEYBINDING_TOGGLE_STICKY, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_1, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_2, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_3, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_4, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_5, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_6, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_7, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_8, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_9, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_10, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_11, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_12, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_LEFT, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_RIGHT, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_UP, 0, 0, FALSE },
{ META_KEYBINDING_MOVE_WORKSPACE_DOWN, 0, 0, FALSE },
{ META_KEYBINDING_RAISE_OR_LOWER, 0, 0, FALSE },
{ META_KEYBINDING_RAISE, 0, 0, FALSE },
{ META_KEYBINDING_LOWER, 0, 0, FALSE },
{ META_KEYBINDING_MAXIMIZE_VERTICALLY, 0, 0, FALSE },
{ META_KEYBINDING_MAXIMIZE_HORIZONTALLY, 0, 0, FALSE },
{ NULL, 0, 0, FALSE }
};
static void
@@ -1529,15 +1672,31 @@ update_command (const char *name,
++p;
if (!g_ascii_isdigit (*p))
if (g_ascii_isdigit (*p))
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Command %s doesn't end in number?\n", name);
return FALSE;
i = atoi (p);
i -= 1; /* count from 0 not 1 */
}
else
{
p = strrchr (name, '/');
++p;
if (strcmp (p, "command_screenshot") == 0)
{
i = SCREENSHOT_COMMAND_IDX;
}
else if (strcmp (p, "command_window_screenshot") == 0)
{
i = WIN_SCREENSHOT_COMMAND_IDX;
}
else
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Command %s doesn't end in number?\n", name);
return FALSE;
}
}
i = atoi (p);
i -= 1; /* count from 0 not 1 */
if (i >= MAX_COMMANDS)
{
@@ -1577,8 +1736,19 @@ char*
meta_prefs_get_gconf_key_for_command (int i)
{
char *key;
key = g_strdup_printf (KEY_COMMAND_PREFIX"%d", i + 1);
switch (i)
{
case SCREENSHOT_COMMAND_IDX:
key = g_strdup (KEY_COMMAND_PREFIX "screenshot");
break;
case WIN_SCREENSHOT_COMMAND_IDX:
key = g_strdup (KEY_COMMAND_PREFIX "window_screenshot");
break;
default:
key = g_strdup_printf (KEY_COMMAND_PREFIX"%d", i + 1);
break;
}
return key;
}
@@ -1711,10 +1881,15 @@ meta_prefs_change_workspace_name (int i,
key = gconf_key_for_workspace_name (i);
err = NULL;
gconf_client_set_string (default_client,
key, name,
&err);
if (name != NULL)
gconf_client_set_string (default_client,
key, name,
&err);
else
gconf_client_unset (default_client,
key, &err);
if (err)
{
meta_warning (_("Error setting name for workspace %d to \"%s\": %s\n"),
@@ -1745,6 +1920,24 @@ meta_prefs_get_button_layout (MetaButtonLayout *button_layout_p)
*button_layout_p = button_layout;
}
gboolean
meta_prefs_get_visual_bell ()
{
return provide_visual_bell;
}
gboolean
meta_prefs_bell_is_audible ()
{
return bell_is_audible;
}
MetaVisualBellType
meta_prefs_get_visual_bell_type ()
{
return visual_bell_type;
}
void
meta_prefs_get_screen_bindings (const MetaKeyPref **bindings,
int *n_bindings)

View File

@@ -42,7 +42,10 @@ typedef enum
META_PREF_DISABLE_WORKAROUNDS,
META_PREF_COMMANDS,
META_PREF_BUTTON_LAYOUT,
META_PREF_WORKSPACE_NAMES
META_PREF_WORKSPACE_NAMES,
META_PREF_VISUAL_BELL,
META_PREF_AUDIBLE_BELL,
META_PREF_VISUAL_BELL_TYPE
} MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -106,6 +109,8 @@ void meta_prefs_change_workspace_name (int i,
#define META_KEYBINDING_CYCLE_PANELS "cycle_panels"
#define META_KEYBINDING_CYCLE_PANELS_BACKWARD "cycle_panels_backward"
#define META_KEYBINDING_SHOW_DESKTOP "show_desktop"
#define META_KEYBINDING_PANEL_MAIN_MENU "panel_main_menu"
#define META_KEYBINDING_PANEL_RUN_DIALOG "panel_run_dialog"
#define META_KEYBINDING_COMMAND_1 "run_command_1"
#define META_KEYBINDING_COMMAND_2 "run_command_2"
#define META_KEYBINDING_COMMAND_3 "run_command_3"
@@ -118,6 +123,28 @@ void meta_prefs_change_workspace_name (int i,
#define META_KEYBINDING_COMMAND_10 "run_command_10"
#define META_KEYBINDING_COMMAND_11 "run_command_11"
#define META_KEYBINDING_COMMAND_12 "run_command_12"
#define META_KEYBINDING_COMMAND_13 "run_command_13"
#define META_KEYBINDING_COMMAND_14 "run_command_14"
#define META_KEYBINDING_COMMAND_15 "run_command_15"
#define META_KEYBINDING_COMMAND_16 "run_command_16"
#define META_KEYBINDING_COMMAND_17 "run_command_17"
#define META_KEYBINDING_COMMAND_18 "run_command_18"
#define META_KEYBINDING_COMMAND_19 "run_command_19"
#define META_KEYBINDING_COMMAND_20 "run_command_20"
#define META_KEYBINDING_COMMAND_21 "run_command_21"
#define META_KEYBINDING_COMMAND_22 "run_command_22"
#define META_KEYBINDING_COMMAND_23 "run_command_23"
#define META_KEYBINDING_COMMAND_24 "run_command_24"
#define META_KEYBINDING_COMMAND_25 "run_command_25"
#define META_KEYBINDING_COMMAND_26 "run_command_26"
#define META_KEYBINDING_COMMAND_27 "run_command_27"
#define META_KEYBINDING_COMMAND_28 "run_command_28"
#define META_KEYBINDING_COMMAND_29 "run_command_29"
#define META_KEYBINDING_COMMAND_30 "run_command_30"
#define META_KEYBINDING_COMMAND_31 "run_command_31"
#define META_KEYBINDING_COMMAND_32 "run_command_32"
#define META_KEYBINDING_COMMAND_SCREENSHOT "run_command_screenshot"
#define META_KEYBINDING_COMMAND_WIN_SCREENSHOT "run_command_window_screenshot"
/* Window bindings */
#define META_KEYBINDING_WINDOW_MENU "activate_window_menu"
@@ -181,6 +208,8 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_CYCLE_PANELS,
META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD,
META_KEYBINDING_ACTION_SHOW_DESKTOP,
META_KEYBINDING_ACTION_PANEL_MAIN_MENU,
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
META_KEYBINDING_ACTION_COMMAND_1,
META_KEYBINDING_ACTION_COMMAND_2,
META_KEYBINDING_ACTION_COMMAND_3,
@@ -200,6 +229,8 @@ typedef struct
const char *name;
unsigned int keysym;
MetaVirtualModifier modifiers;
/* for keybindings that can have shift or not like Alt+Tab */
gboolean add_shift;
} MetaKeyPref;
void meta_prefs_get_screen_bindings (const MetaKeyPref **bindings,
@@ -213,6 +244,18 @@ void meta_prefs_get_window_binding (const char *name,
unsigned int *keysym,
MetaVirtualModifier *modifiers);
typedef enum
{
META_VISUAL_BELL_INVALID = 0,
META_VISUAL_BELL_FULLSCREEN_FLASH,
META_VISUAL_BELL_FRAME_FLASH
} MetaVisualBellType;
gboolean meta_prefs_get_visual_bell (void);
gboolean meta_prefs_bell_is_audible (void);
MetaVisualBellType meta_prefs_get_visual_bell_type (void);
#endif

View File

@@ -92,11 +92,10 @@ ensure_size_window (MetaResizePopup *popup)
return;
popup->size_window = gtk_window_new (GTK_WINDOW_POPUP);
#ifdef HAVE_GTK_MULTIHEAD
gtk_window_set_screen (GTK_WINDOW (popup->size_window),
gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display),
popup->screen_number));
#endif
/* never shrink the size window */
gtk_window_set_resizable (GTK_WINDOW (popup->size_window),

View File

@@ -2,9 +2,10 @@
/*
* Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
* Copyright (C) 2003 Rob Adams
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -51,7 +52,7 @@ static char* get_screen_name (MetaDisplay *display,
static void update_num_workspaces (MetaScreen *screen);
static void update_focus_mode (MetaScreen *screen);
static void update_workspace_names (MetaScreen *screen);
static void set_workspace_names (MetaScreen *screen);
static void prefs_changed_callback (MetaPreference pref,
gpointer data);
@@ -352,6 +353,20 @@ reload_xinerama_infos (MetaScreen *screen)
g_assert (screen->n_xinerama_infos > 0);
g_assert (screen->xinerama_infos != NULL);
{
GList *tmp;
tmp = screen->workspaces;
while (tmp != NULL)
{
MetaWorkspace *space = tmp->data;
meta_workspace_invalidate_work_area (space);
tmp = tmp->next;
}
}
}
MetaScreen*
@@ -523,6 +538,7 @@ meta_screen_new (MetaDisplay *display,
screen->current_cursor = -1; /* invalid/unset */
screen->default_xvisual = DefaultVisualOfScreen (screen->xscreen);
screen->default_depth = DefaultDepthOfScreen (screen->xscreen);
screen->flash_window = None;
screen->wm_sn_selection_window = new_wm_sn_owner;
screen->wm_sn_atom = wm_sn_atom;
@@ -568,7 +584,6 @@ meta_screen_new (MetaDisplay *display,
set_wm_check_hint (screen);
meta_screen_update_workspace_layout (screen);
meta_screen_update_workspace_names (screen);
/* Get current workspace */
current_workspace = 0;
@@ -587,6 +602,8 @@ meta_screen_new (MetaDisplay *display,
meta_workspace_activate (meta_workspace_new (screen));
update_num_workspaces (screen);
set_workspace_names (screen);
screen->all_keys_grabbed = FALSE;
screen->keys_grabbed = FALSE;
meta_screen_grab_keys (screen);
@@ -754,7 +771,7 @@ prefs_changed_callback (MetaPreference pref,
}
else if (pref == META_PREF_WORKSPACE_NAMES)
{
update_workspace_names (screen);
set_workspace_names (screen);
}
}
@@ -950,7 +967,7 @@ update_num_workspaces (MetaScreen *screen)
{
MetaWorkspace *w = tmp->data;
if (i > new_num)
if (i >= new_num)
extras = g_list_prepend (extras, w);
else
last_remaining = w;
@@ -1036,8 +1053,8 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
MetaTabList type)
{
MetaTabEntry *entries;
GSList *tab_list;
GSList *tmp;
GList *tab_list;
GList *tmp;
int len;
int i;
@@ -1049,7 +1066,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
screen,
screen->active_workspace);
len = g_slist_length (tab_list);
len = g_list_length (tab_list);
entries = g_new (MetaTabEntry, len + 1);
entries[len].key = NULL;
@@ -1068,7 +1085,8 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
entries[i].key = (MetaTabEntryKey) window->xwindow;
entries[i].title = window->title;
entries[i].icon = window->icon;
entries[i].blank = FALSE;
if (!window->minimized || !meta_window_get_icon_geometry (window, &r))
meta_window_get_outer_rect (window, &r);
@@ -1115,7 +1133,7 @@ meta_screen_ensure_tab_popup (MetaScreen *screen,
TRUE);
g_free (entries);
g_slist_free (tab_list);
g_list_free (tab_list);
/* don't show tab popup, since proper window isn't selected yet */
}
@@ -1124,79 +1142,66 @@ void
meta_screen_ensure_workspace_popup (MetaScreen *screen)
{
MetaTabEntry *entries;
int len, rows, cols;
int len;
int i;
MetaWorkspaceLayout layout;
int n_workspaces;
int current_workspace;
if (screen->tab_popup)
return;
len = meta_screen_get_n_workspaces (screen);
current_workspace = meta_workspace_index (screen->active_workspace);
n_workspaces = meta_screen_get_n_workspaces (screen);
meta_screen_calc_workspace_layout (screen, n_workspaces,
current_workspace, &layout);
len = layout.grid_area;
entries = g_new (MetaTabEntry, len + 1);
entries[len].key = NULL;
entries[len].title = NULL;
entries[len].icon = NULL;
meta_screen_calc_workspace_layout (screen, len, &rows, &cols);
/* FIXME: handle screen->starting_corner
*/
if (screen->vertical_workspaces)
i = 0;
while (i < len)
{
int j, k, iter;
for (i = 0, iter = 0; i < rows; ++i)
{
for (j = 0; j < cols; ++j)
{
MetaWorkspace *workspace;
k = i + (j * rows);
if (k >= len)
break;
workspace = meta_screen_get_workspace_by_index (screen, k);
g_assert (workspace);
entries[iter].key = (MetaTabEntryKey) workspace;
entries[iter].title = meta_workspace_get_name (workspace);
entries[iter].icon = NULL;
g_assert (entries[iter].title != NULL);
iter++;
}
}
g_assert (iter == len);
}
else
{
for (i = 0; i < len; ++i)
if (layout.grid[i] >= 0)
{
MetaWorkspace *workspace;
workspace = meta_screen_get_workspace_by_index (screen, i);
g_assert (workspace);
workspace = meta_screen_get_workspace_by_index (screen,
layout.grid[i]);
entries[i].key = (MetaTabEntryKey) workspace;
entries[i].title = meta_workspace_get_name (workspace);
entries[i].icon = NULL;
entries[i].blank = FALSE;
g_assert (entries[i].title != NULL);
}
else
{
entries[i].key = NULL;
entries[i].title = NULL;
entries[i].icon = NULL;
entries[i].blank = TRUE;
}
++i;
}
screen->tab_popup = meta_ui_tab_popup_new (entries,
screen->number,
len,
cols,
layout.cols,
FALSE);
g_free (entries);
meta_screen_free_workspace_layout (&layout);
/* don't show tab popup, since proper window isn't selected yet */
/* don't show tab popup, since proper space isn't selected yet */
}
/* Focus top window on active workspace */
@@ -1232,19 +1237,76 @@ meta_screen_focus_top_window (MetaScreen *screen,
}
}
void
meta_screen_focus_mouse_window (MetaScreen *screen,
MetaWindow *not_this_one)
{
MetaWindow *window;
Window root_return, child_return;
int root_x_return, root_y_return;
int win_x_return, win_y_return;
unsigned int mask_return;
if (not_this_one)
meta_topic (META_DEBUG_FOCUS,
"Focusing mouse window excluding %s\n", not_this_one->desc);
meta_error_trap_push (screen->display);
XQueryPointer (screen->display->xdisplay,
screen->xroot,
&root_return,
&child_return,
&root_x_return,
&root_y_return,
&win_x_return,
&win_y_return,
&mask_return);
meta_error_trap_pop (screen->display, TRUE);
window = meta_stack_get_default_focus_window_at_point (screen->stack,
screen->active_workspace,
not_this_one,
root_x_return,
root_y_return);
/* FIXME I'm a loser on the CurrentTime front */
if (window)
{
meta_topic (META_DEBUG_FOCUS,
"Focusing mouse window %s\n", window->desc);
meta_window_focus (window, meta_display_get_current_time (screen->display));
/* Also raise the window if in click-to-focus */
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
meta_window_raise (window);
}
else
{
meta_topic (META_DEBUG_FOCUS, "No mouse window to focus found\n");
}
}
void
meta_screen_focus_default_window (MetaScreen *screen,
MetaWindow *not_this_one)
{
if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK)
meta_screen_focus_top_window (screen, not_this_one);
else
meta_screen_focus_mouse_window (screen, not_this_one);
}
const MetaXineramaScreenInfo*
meta_screen_get_xinerama_for_window (MetaScreen *screen,
MetaWindow *window)
meta_screen_get_xinerama_for_rect (MetaScreen *screen,
MetaRectangle *rect)
{
int i;
int best_xinerama, xinerama_score;
MetaRectangle window_rect;
if (screen->n_xinerama_infos == 1)
return &screen->xinerama_infos[0];
meta_window_get_outer_rect (window, &window_rect);
best_xinerama = 0;
xinerama_score = 0;
@@ -1258,7 +1320,7 @@ meta_screen_get_xinerama_for_window (MetaScreen *screen,
screen_info.width = screen->xinerama_infos[i].width;
screen_info.height = screen->xinerama_infos[i].height;
if (meta_rectangle_intersect (&screen_info, &window_rect, &dest))
if (meta_rectangle_intersect (&screen_info, rect, &dest))
{
if (dest.width * dest.height > xinerama_score)
{
@@ -1266,19 +1328,183 @@ meta_screen_get_xinerama_for_window (MetaScreen *screen,
best_xinerama = i;
}
}
++i;
}
return &screen->xinerama_infos[best_xinerama];
}
const MetaXineramaScreenInfo*
meta_screen_get_xinerama_for_window (MetaScreen *screen,
MetaWindow *window)
{
MetaRectangle window_rect;
meta_window_get_outer_rect (window, &window_rect);
return meta_screen_get_xinerama_for_rect (screen, &window_rect);
}
const MetaXineramaScreenInfo*
meta_screen_get_xinerama_neighbor (MetaScreen *screen,
int which_xinerama,
MetaScreenDirection direction)
{
MetaXineramaScreenInfo* input = screen->xinerama_infos + which_xinerama;
MetaXineramaScreenInfo* current;
int i;
for (i = 0; i < screen->n_xinerama_infos; i++)
{
current = screen->xinerama_infos + i;
if (((direction == META_SCREEN_RIGHT) &&
(current->x_origin == input->x_origin + input->width) &&
(current->y_origin >= input->y_origin) &&
(current->y_origin <= input->y_origin+input->height)) ||
((direction == META_SCREEN_LEFT) &&
(input->x_origin == current->x_origin + current->width) &&
(current->y_origin >= input->y_origin) &&
(current->y_origin <= input->y_origin + input->height)) ||
((direction == META_SCREEN_UP) &&
(input->y_origin == current->y_origin + current->height) &&
(current->x_origin >= input->x_origin) &&
(current->x_origin <= input->x_origin + input->width)) ||
((direction == META_SCREEN_DOWN) &&
(current->y_origin == input->y_origin + input->height) &&
(current->x_origin >= input->x_origin) &&
(current->x_origin <= input->x_origin + input->width)))
{
return current;
}
}
return NULL;
}
void
meta_screen_get_natural_xinerama_list (MetaScreen *screen,
int** xineramas_list,
int* n_xineramas)
{
const MetaXineramaScreenInfo* current;
const MetaXineramaScreenInfo* tmp;
GQueue* xinerama_queue;
int* visited;
int cur = 0;
int i;
*n_xineramas = screen->n_xinerama_infos;
*xineramas_list = g_new (int, screen->n_xinerama_infos);
/* we calculate a natural ordering by which to choose xineramas for
* window placement. We start at the current xinerama, and perform
* a breadth-first search of the xineramas starting from that
* xinerama. We choose preferentially left, then right, then down,
* then up. The visitation order produced by this traversal is the
* natural xinerama ordering.
*/
visited = g_new (int, screen->n_xinerama_infos);
for (i = 0; i < screen->n_xinerama_infos; i++)
{
visited[i] = FALSE;
}
current = meta_screen_get_current_xinerama (screen);
xinerama_queue = g_queue_new ();
g_queue_push_tail (xinerama_queue, (gpointer) current);
visited[current->number] = TRUE;
while (!g_queue_is_empty (xinerama_queue))
{
current = (const MetaXineramaScreenInfo*)
g_queue_pop_head (xinerama_queue);
(*xineramas_list)[cur++] = current->number;
/* enqueue each of the directions */
tmp = meta_screen_get_xinerama_neighbor (screen,
current->number,
META_SCREEN_LEFT);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (xinerama_queue,
(MetaXineramaScreenInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_xinerama_neighbor (screen,
current->number,
META_SCREEN_RIGHT);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (xinerama_queue,
(MetaXineramaScreenInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_xinerama_neighbor (screen,
current->number,
META_SCREEN_UP);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (xinerama_queue,
(MetaXineramaScreenInfo*) tmp);
visited[tmp->number] = TRUE;
}
tmp = meta_screen_get_xinerama_neighbor (screen,
current->number,
META_SCREEN_DOWN);
if (tmp && !visited[tmp->number])
{
g_queue_push_tail (xinerama_queue,
(MetaXineramaScreenInfo*) tmp);
visited[tmp->number] = TRUE;
}
}
/* in case we somehow missed some set of xineramas, go through the
* visited list and add in any xineramas that were missed
*/
for (i = 0; i < screen->n_xinerama_infos; i++)
{
if (visited[i] == FALSE)
{
(*xineramas_list)[cur++] = i;
}
}
g_free (visited);
g_queue_free (xinerama_queue);
}
gboolean
meta_screen_window_intersects_xinerama (MetaScreen *screen,
MetaWindow *window,
int which_xinerama)
{
MetaRectangle window_rect;
MetaRectangle dest, screen_rect;
meta_window_get_outer_rect (window, &window_rect);
screen_rect.x = screen->xinerama_infos[which_xinerama].x_origin;
screen_rect.y = screen->xinerama_infos[which_xinerama].y_origin;
screen_rect.width = screen->xinerama_infos[which_xinerama].width;
screen_rect.height = screen->xinerama_infos[which_xinerama].height;
if (meta_rectangle_intersect (&screen_rect, &window_rect, &dest))
return TRUE;
return FALSE;
}
const MetaXineramaScreenInfo*
meta_screen_get_current_xinerama (MetaScreen *screen)
{
if (screen->n_xinerama_infos == 1)
return &screen->xinerama_infos[0];
/* Sadly, we have to do it this way. Yuck.
*/
@@ -1307,9 +1533,11 @@ meta_screen_get_current_xinerama (MetaScreen *screen)
while (i < screen->n_xinerama_infos)
{
if ((root_x_return >= screen->xinerama_infos[i].x_origin &&
root_x_return < (screen->xinerama_infos[i].x_origin + screen->xinerama_infos[i].width) &&
root_x_return < (screen->xinerama_infos[i].x_origin +
screen->xinerama_infos[i].width) &&
root_y_return >= screen->xinerama_infos[i].y_origin &&
root_y_return < (screen->xinerama_infos[i].y_origin + screen->xinerama_infos[i].height)))
root_y_return < (screen->xinerama_infos[i].y_origin +
screen->xinerama_infos[i].height)))
{
screen->last_xinerama_index = i;
break;
@@ -1424,7 +1652,7 @@ meta_screen_update_workspace_layout (MetaScreen *screen)
}
static void
update_workspace_names (MetaScreen *screen)
set_workspace_names (MetaScreen *screen)
{
/* This updates names on root window when the pref changes,
* note we only get prefs change notify if things have
@@ -1544,7 +1772,7 @@ set_work_area_hint (MetaScreen *screen)
if (workspace->screen == screen)
{
meta_workspace_get_work_area (workspace, &area);
meta_workspace_get_work_area_all_xineramas (workspace, &area);
tmp[0] = area.x;
tmp[1] = area.y;
tmp[2] = area.width;
@@ -1594,36 +1822,39 @@ meta_screen_queue_workarea_recalc (MetaScreen *screen)
}
}
void
meta_screen_calc_workspace_layout (MetaScreen *screen,
int num_workspaces,
int *r,
int *c)
{
int cols, rows;
/*
* 3 rows, 4 columns, horizontal layout
* and starting from top left:
* +--+--+--+--+
* | 1| 2| 3| 4|
* +--+--+--+--+
* | 5| 6| 7| 8|
* +--+--+--+--+
* | 9|10|11|12|
* +--+--+--+--+
*
* vertical layout:
* +--+--+--+--+
* | 1| 4| 7|10|
* +--+--+--+--+
* | 2| 5| 8|11|
* +--+--+--+--+
* | 3| 6| 9|12|
* +--+--+--+--+
*
*/
#ifdef WITH_VERBOSE_MODE
static char *
meta_screen_corner_to_string (MetaScreenCorner corner)
{
switch (corner)
{
case META_SCREEN_TOPLEFT:
return "TopLeft";
case META_SCREEN_TOPRIGHT:
return "TopRight";
case META_SCREEN_BOTTOMLEFT:
return "BottomLeft";
case META_SCREEN_BOTTOMRIGHT:
return "BottomRight";
}
return "Unknown";
}
#endif /* WITH_VERBOSE_MODE */
void
meta_screen_calc_workspace_layout (MetaScreen *screen,
int num_workspaces,
int current_space,
MetaWorkspaceLayout *layout)
{
int rows, cols;
int grid_area;
int *grid;
int i, r, c;
int current_row, current_col;
rows = screen->rows_of_workspaces;
cols = screen->columns_of_workspaces;
if (rows <= 0 && cols <= 0)
@@ -1640,8 +1871,251 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
if (cols < 1)
cols = 1;
*r = rows;
*c = cols;
g_assert (rows != 0 && cols != 0);
grid_area = rows * cols;
meta_verbose ("Getting layout rows = %d cols = %d current = %d "
"num_spaces = %d vertical = %s corner = %s\n",
rows, cols, current_space, num_workspaces,
screen->vertical_workspaces ? "(true)" : "(false)",
meta_screen_corner_to_string (screen->starting_corner));
/* ok, we want to setup the distances in the workspace array to go
* in each direction. Remember, there are many ways that a workspace
* array can be setup.
* see http://www.freedesktop.org/standards/wm-spec/1.2/html/x109.html
* and look at the _NET_DESKTOP_LAYOUT section for details.
* For instance:
*/
/* starting_corner = META_SCREEN_TOPLEFT
* vertical_workspaces = 0 vertical_workspaces=1
* 1234 1357
* 5678 2468
*
* starting_corner = META_SCREEN_TOPRIGHT
* vertical_workspaces = 0 vertical_workspaces=1
* 4321 7531
* 8765 8642
*
* starting_corner = META_SCREEN_BOTTOMLEFT
* vertical_workspaces = 0 vertical_workspaces=1
* 5678 2468
* 1234 1357
*
* starting_corner = META_SCREEN_BOTTOMRIGHT
* vertical_workspaces = 0 vertical_workspaces=1
* 8765 8642
* 4321 7531
*
*/
/* keep in mind that we could have a ragged layout, e.g. the "8"
* in the above grids could be missing
*/
grid = g_new (int, grid_area);
current_row = -1;
current_col = -1;
i = 0;
switch (screen->starting_corner)
{
case META_SCREEN_TOPLEFT:
if (screen->vertical_workspaces)
{
c = 0;
while (c < cols)
{
r = 0;
while (r < rows)
{
grid[r*cols+c] = i;
++i;
++r;
}
++c;
}
}
else
{
r = 0;
while (r < rows)
{
c = 0;
while (c < cols)
{
grid[r*cols+c] = i;
++i;
++c;
}
++r;
}
}
break;
case META_SCREEN_TOPRIGHT:
if (screen->vertical_workspaces)
{
c = cols - 1;
while (c >= 0)
{
r = 0;
while (r < rows)
{
grid[r*cols+c] = i;
++i;
++r;
}
--c;
}
}
else
{
r = 0;
while (r < rows)
{
c = cols - 1;
while (c >= 0)
{
grid[r*cols+c] = i;
++i;
--c;
}
++r;
}
}
break;
case META_SCREEN_BOTTOMLEFT:
if (screen->vertical_workspaces)
{
c = 0;
while (c < cols)
{
r = rows - 1;
while (r >= 0)
{
grid[r*cols+c] = i;
++i;
--r;
}
++c;
}
}
else
{
r = rows - 1;
while (r >= 0)
{
c = 0;
while (c < cols)
{
grid[r*cols+c] = i;
++i;
++c;
}
--r;
}
}
break;
case META_SCREEN_BOTTOMRIGHT:
if (screen->vertical_workspaces)
{
c = cols - 1;
while (c >= 0)
{
r = rows - 1;
while (r >= 0)
{
grid[r*cols+c] = i;
++i;
--r;
}
--c;
}
}
else
{
r = rows - 1;
while (r >= 0)
{
c = cols - 1;
while (c >= 0)
{
grid[r*cols+c] = i;
++i;
--c;
}
--r;
}
}
break;
}
if (i != grid_area)
meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n",
G_GNUC_FUNCTION, i);
current_row = 0;
current_col = 0;
r = 0;
while (r < rows)
{
c = 0;
while (c < cols)
{
if (grid[r*cols+c] == current_space)
{
current_row = r;
current_col = c;
}
else if (grid[r*cols+c] >= num_workspaces)
{
/* flag nonexistent spaces with -1 */
grid[r*cols+c] = -1;
}
++c;
}
++r;
}
layout->rows = rows;
layout->cols = cols;
layout->grid = grid;
layout->grid_area = grid_area;
layout->current_row = current_row;
layout->current_col = current_col;
#ifdef WITH_VERBOSE_MODE
if (meta_is_verbose ())
{
r = 0;
while (r < layout->rows)
{
meta_verbose (" ");
meta_push_no_msg_prefix ();
c = 0;
while (c < layout->cols)
{
if (r == layout->current_row &&
c == layout->current_col)
meta_verbose ("*%2d ", layout->grid[r*layout->cols+c]);
else
meta_verbose ("%3d ", layout->grid[r*layout->cols+c]);
++c;
}
meta_verbose ("\n");
meta_pop_no_msg_prefix ();
++r;
}
}
#endif /* WITH_VERBOSE_MODE */
}
void
meta_screen_free_workspace_layout (MetaWorkspaceLayout *layout)
{
g_free (layout->grid);
}
static void
@@ -1888,9 +2362,14 @@ meta_screen_sn_event (SnMonitorEvent *event,
{
case SN_MONITOR_EVENT_INITIATED:
{
const char *wmclass;
wmclass = sn_startup_sequence_get_wmclass (sequence);
meta_topic (META_DEBUG_STARTUP,
"Received startup initiated for %s\n",
sn_startup_sequence_get_id (sequence));
"Received startup initiated for %s wmclass %s\n",
sn_startup_sequence_get_id (sequence),
wmclass ? wmclass : "(unset)");
add_sequence (screen, sequence);
}
break;
@@ -1930,24 +2409,67 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
SnStartupSequence *sequence;
startup_id = meta_window_get_startup_id (window);
meta_topic (META_DEBUG_STARTUP,
"Applying startup props to %s id \"%s\"\n",
window->desc,
startup_id ? startup_id : "(none)");
sequence = NULL;
if (startup_id == NULL)
{
tmp = screen->startup_sequences;
while (tmp != NULL)
{
const char *wmclass;
wmclass = sn_startup_sequence_get_wmclass (tmp->data);
if (wmclass != NULL &&
((window->res_class &&
strcmp (wmclass, window->res_class) == 0) ||
(window->res_name &&
strcmp (wmclass, window->res_name) == 0)))
{
sequence = tmp->data;
g_assert (window->startup_id == NULL);
window->startup_id = g_strdup (sn_startup_sequence_get_id (sequence));
startup_id = window->startup_id;
meta_topic (META_DEBUG_STARTUP,
"Ending legacy sequence %s due to window %s\n",
sn_startup_sequence_get_id (sequence),
window->desc);
sn_startup_sequence_complete (sequence);
break;
}
tmp = tmp->next;
}
}
if (startup_id == NULL)
return;
sequence = NULL;
tmp = screen->startup_sequences;
while (tmp != NULL)
if (sequence == NULL)
{
const char *id;
id = sn_startup_sequence_get_id (tmp->data);
if (strcmp (id, startup_id) == 0)
tmp = screen->startup_sequences;
while (tmp != NULL)
{
sequence = tmp->data;
break;
const char *id;
id = sn_startup_sequence_get_id (tmp->data);
if (strcmp (id, startup_id) == 0)
{
sequence = tmp->data;
break;
}
tmp = tmp->next;
}
tmp = tmp->next;
}
if (sequence != NULL)

View File

@@ -48,6 +48,14 @@ typedef enum
META_SCREEN_BOTTOMRIGHT
} MetaScreenCorner;
typedef enum
{
META_SCREEN_UP,
META_SCREEN_DOWN,
META_SCREEN_LEFT,
META_SCREEN_RIGHT
} MetaScreenDirection;
struct _MetaScreen
{
MetaDisplay *display;
@@ -70,6 +78,8 @@ struct _MetaScreen
MetaCursor current_cursor;
Window flash_window;
Window wm_sn_selection_window;
Atom wm_sn_atom;
Time wm_sn_timestamp;
@@ -124,12 +134,30 @@ void meta_screen_ensure_tab_popup (MetaScreen *scree
void meta_screen_ensure_workspace_popup (MetaScreen *screen);
void meta_screen_focus_top_window (MetaScreen *screen,
MetaWindow *not_this_one);
void meta_screen_focus_top_window (MetaScreen *screen,
MetaWindow *not_this_one);
void meta_screen_focus_mouse_window (MetaScreen *screen,
MetaWindow *not_this_one);
void meta_screen_focus_default_window (MetaScreen *screen,
MetaWindow *not_this_one);
const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen);
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_window (MetaScreen *screen,
MetaWindow *window);
const MetaXineramaScreenInfo* meta_screen_get_current_xinerama (MetaScreen *screen);
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_rect (MetaScreen *screen,
MetaRectangle *rect);
const MetaXineramaScreenInfo* meta_screen_get_xinerama_for_window (MetaScreen *screen,
MetaWindow *window);
gboolean meta_screen_window_intersects_xinerama (MetaScreen *screen,
MetaWindow *window,
int which_xinerama);
const MetaXineramaScreenInfo* meta_screen_get_xinerama_neighbor (MetaScreen *screen,
int which_xinerama,
MetaScreenDirection dir);
void meta_screen_get_natural_xinerama_list (MetaScreen *screen,
int** xineramas_list,
int* n_xineramas);
void meta_screen_update_workspace_layout (MetaScreen *screen);
void meta_screen_update_workspace_names (MetaScreen *screen);
@@ -138,10 +166,23 @@ void meta_screen_queue_workarea_recalc (MetaScreen *scree
Window meta_create_offscreen_window (Display *xdisplay,
Window parent);
void meta_screen_calc_workspace_layout (MetaScreen *screen,
int num_workspaces,
int *r,
int *c);
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
struct MetaWorkspaceLayout
{
int rows;
int cols;
int *grid;
int grid_area;
int current_row;
int current_col;
};
void meta_screen_calc_workspace_layout (MetaScreen *screen,
int num_workspaces,
int current_space,
MetaWorkspaceLayout *layout);
void meta_screen_free_workspace_layout (MetaWorkspaceLayout *layout);
void meta_screen_resize (MetaScreen *screen,
int width,

View File

@@ -2,7 +2,7 @@
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2002, 2003 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -183,20 +183,33 @@ window_is_fullscreen_size (MetaWindow *window)
{
int i;
if (window->rect.x <= 0 &&
window->rect.y <= 0 &&
window->rect.width >= window->screen->width &&
if (window->rect.width >= window->screen->width &&
window->rect.height >= window->screen->height)
return TRUE;
{
/* we use the work area since windows that try to
* position at 0,0 will get pushed down by menu panel
*/
MetaRectangle workarea;
meta_window_get_work_area_current_xinerama (window, &workarea);
if (window->rect.x <= workarea.x &&
window->rect.y <= workarea.y)
return TRUE;
}
i = 0;
while (i < window->screen->n_xinerama_infos)
{
if (window->rect.x == window->screen->xinerama_infos[i].x_origin &&
window->rect.y == window->screen->xinerama_infos[i].y_origin &&
window->rect.width >= window->screen->xinerama_infos[i].width &&
if (window->rect.width >= window->screen->xinerama_infos[i].width &&
window->rect.height >= window->screen->xinerama_infos[i].height)
return TRUE;
{
MetaRectangle workarea;
meta_window_get_work_area_current_xinerama (window, &workarea);
if (window->rect.x <= workarea.x &&
window->rect.y <= workarea.y)
return TRUE;
}
++i;
}
@@ -249,37 +262,34 @@ get_standalone_layer (MetaWindow *window)
return layer;
}
typedef struct
{
MetaStackLayer max;
} MaxLayerData;
static gboolean
max_layer_func (MetaWindow *window,
void *data)
{
MaxLayerData *d = data;
MetaStackLayer layer;
layer = get_standalone_layer (window);
if (layer > d->max)
d->max = layer;
return TRUE;
}
static MetaStackLayer
get_maximum_layer_of_ancestor (MetaWindow *window)
{
MetaWindow *w;
MetaStackLayer max;
MetaStackLayer layer;
max = get_standalone_layer (window);
w = window;
while (w != NULL)
{
if (w->xtransient_for == None ||
w->transient_parent_is_root_window)
break;
w = meta_display_lookup_x_window (w->display, w->xtransient_for);
if (w == window)
break; /* Cute, someone thought they'd make a transient_for cycle */
/* w may be null... */
if (w != NULL)
{
layer = get_standalone_layer (w);
if (layer > max)
max = layer;
}
}
MaxLayerData d;
return max;
d.max = get_standalone_layer (window);
meta_window_foreach_ancestor (window, max_layer_func, &d);
return d.max;
}
/* Note that this function can never use window->layer only
@@ -488,6 +498,8 @@ add_constraint (Constraint **constraints,
MetaWindow *below)
{
Constraint *c;
g_assert (above->screen == below->screen);
/* check if constraint is a duplicate */
c = constraints[below->stack_position];
@@ -562,7 +574,8 @@ create_constraints (Constraint **constraints,
{
MetaWindow *group_window = tmp2->data;
if (!WINDOW_IN_STACK (group_window))
if (!WINDOW_IN_STACK (group_window) ||
w->screen != group_window->screen)
{
tmp2 = tmp2->next;
continue;
@@ -597,7 +610,8 @@ create_constraints (Constraint **constraints,
parent =
meta_display_lookup_x_window (w->display, w->xtransient_for);
if (parent && WINDOW_IN_STACK (parent))
if (parent && WINDOW_IN_STACK (parent) &&
parent->screen == w->screen)
{
meta_topic (META_DEBUG_STACK, "Constraining %s above %s due to transiency\n",
w->desc, parent->desc);
@@ -1299,12 +1313,27 @@ meta_stack_get_below (MetaStack *stack,
return NULL;
else
return below;
}
}
MetaWindow*
meta_stack_get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one)
static gboolean
window_contains_point (MetaWindow *window,
int root_x,
int root_y)
{
MetaRectangle rect;
meta_window_get_outer_rect (window, &rect);
return POINT_IN_RECT (root_x, root_y, rect);
}
static MetaWindow*
get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one,
gboolean must_be_at_point,
int root_x,
int root_y)
{
/* Find the topmost, focusable, mapped, window.
* not_this_one is being unfocused or going away, so exclude it.
@@ -1353,12 +1382,16 @@ meta_stack_get_default_focus_window (MetaStack *stack,
{
if (transient_parent == NULL &&
not_this_one->xtransient_for != None &&
not_this_one->xtransient_for == window->xwindow)
not_this_one->xtransient_for == window->xwindow &&
(!must_be_at_point ||
window_contains_point (window, root_x, root_y)))
transient_parent = window;
if (topmost_in_group == NULL &&
not_this_one_group != NULL &&
not_this_one_group == meta_window_get_group (window))
not_this_one_group == meta_window_get_group (window) &&
(!must_be_at_point ||
window_contains_point (window, root_x, root_y)))
topmost_in_group = window;
}
@@ -1367,7 +1400,9 @@ meta_stack_get_default_focus_window (MetaStack *stack,
* focusing dock, even though docks are stacked higher.
*/
if (topmost_overall == NULL &&
window->type != META_WINDOW_DOCK)
window->type != META_WINDOW_DOCK &&
(!must_be_at_point ||
window_contains_point (window, root_x, root_y)))
topmost_overall = window;
/* We could try to bail out early here for efficiency in
@@ -1388,6 +1423,26 @@ meta_stack_get_default_focus_window (MetaStack *stack,
return topmost_dock;
}
MetaWindow*
meta_stack_get_default_focus_window_at_point (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one,
int root_x,
int root_y)
{
return get_default_focus_window (stack, workspace, not_this_one,
TRUE, root_x, root_y);
}
MetaWindow*
meta_stack_get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one)
{
return get_default_focus_window (stack, workspace, not_this_one,
FALSE, 0, 0);
}
GList*
meta_stack_list_windows (MetaStack *stack,
MetaWorkspace *workspace)

View File

@@ -118,9 +118,16 @@ MetaWindow* meta_stack_get_above (MetaStack *stack,
MetaWindow* meta_stack_get_below (MetaStack *stack,
MetaWindow *window,
gboolean only_within_layer);
MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one);
MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one);
MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
MetaWorkspace *workspace,
MetaWindow *not_this_one,
int root_x,
int root_y);
GList* meta_stack_list_windows (MetaStack *stack,
MetaWorkspace *workspace);

View File

@@ -44,6 +44,7 @@ struct _TabEntry
GtkWidget *widget;
GdkRectangle rect;
GdkRectangle inner_rect;
guint blank : 1;
};
struct _MetaTabPopup
@@ -121,11 +122,10 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
popup = g_new (MetaTabPopup, 1);
popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP);
#ifdef HAVE_GTK_MULTIHEAD
gtk_window_set_screen (GTK_WINDOW (popup->outline_window),
gdk_display_get_screen (gdk_display_get_default (),
screen_number));
#endif
gtk_widget_set_app_paintable (popup->outline_window, TRUE);
gtk_widget_realize (popup->outline_window);
@@ -134,11 +134,10 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
G_CALLBACK (outline_window_expose), popup);
popup->window = gtk_window_new (GTK_WINDOW_POPUP);
#ifdef HAVE_GTK_MULTIHEAD
gtk_window_set_screen (GTK_WINDOW (popup->window),
gdk_display_get_screen (gdk_display_get_default (),
screen_number));
#endif
gtk_window_set_position (GTK_WINDOW (popup->window),
GTK_WIN_POS_CENTER_ALWAYS);
@@ -160,6 +159,7 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
te->title = g_strdup (entries[i].title);
te->widget = NULL;
te->icon = entries[i].icon;
te->blank = entries[i].blank;
if (te->icon)
g_object_ref (G_OBJECT (te->icon));
@@ -227,8 +227,13 @@ meta_ui_tab_popup_new (const MetaTabEntry *entries,
TabEntry *te;
te = tmp->data;
if (outline)
if (te->blank)
{
/* just stick a widget here to avoid special cases */
image = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
}
else if (outline)
{
image = selectable_image_new (te->icon);

View File

@@ -39,6 +39,7 @@ struct _MetaTabEntry
GdkPixbuf *icon;
int x, y, width, height;
int inner_x, inner_y, inner_width, inner_height;
guint blank : 1;
};
MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries,

View File

@@ -4760,8 +4760,10 @@ theme_get_style (MetaTheme *theme,
resize = META_FRAME_RESIZE_LAST; /* compiler */
break;
}
if (flags & META_FRAME_HAS_FOCUS)
/* re invert the styles used for focus/unfocussed while flashing a frame */
if (((flags & META_FRAME_HAS_FOCUS) && !(flags & META_FRAME_IS_FLASHING))
|| (!(flags & META_FRAME_HAS_FOCUS) && (flags & META_FRAME_IS_FLASHING)))
focus = META_FRAME_FOCUS_YES;
else
focus = META_FRAME_FOCUS_NO;

View File

@@ -24,6 +24,18 @@
<border name="button_border" left="0" right="0" top="9" bottom="0"/>
</frame_geometry>
<frame_geometry name="border" has_title="false">
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
<distance name="left_titlebar_edge" value="0"/>
<distance name="right_titlebar_edge" value="0"/>
<distance name="button_width" value="0"/>
<distance name="button_height" value="0"/>
<distance name="title_vertical_pad" value="4"/>
<border name="title_border" left="0" right="0" top="0" bottom="0"/>
<border name="button_border" left="0" right="0" top="0" bottom="0"/>
</frame_geometry>
<!-- Buttons -->
@@ -217,12 +229,31 @@
<frame focus="no" state="maximized_and_shaded" style="normal_shaded"/>
</frame_style_set>
<draw_ops name="blank">
<!-- nothing -->
</draw_ops>
<frame_style name="border" geometry="border" parent="normal">
<piece position="title" draw_ops="blank"/>
</frame_style>
<frame_style_set name="border">
<frame focus="yes" state="normal" resize="both" style="border"/>
<frame focus="no" state="normal" resize="both" style="border"/>
<frame focus="yes" state="maximized" style="border"/>
<frame focus="no" state="maximized" style="border"/>
<frame focus="yes" state="shaded" style="border"/>
<frame focus="no" state="shaded" style="border"/>
<frame focus="yes" state="maximized_and_shaded" style="border"/>
<frame focus="no" state="maximized_and_shaded" style="border"/>
</frame_style_set>
<window type="normal" style_set="normal"/>
<window type="dialog" style_set="normal"/>
<window type="modal_dialog" style_set="normal"/>
<window type="menu" style_set="normal"/>
<window type="utility" style_set="normal"/>
<window type="border" style_set="normal"/>
<window type="border" style_set="border"/>
<menu_icon function="maximize" state="normal">
<draw_ops>

View File

@@ -398,11 +398,11 @@
</draw_ops>
<draw_ops name="title_background">
<rectangle color="#ffffff" filled="true"
x="width - title_width - IconTitleSpacing + (height / 2) + height"
y="0"
width="width"
height="height"/>
<line color="#ffffff" width="100"
x1="width - title_width - IconTitleSpacing + (height / 2) + height"
y1="height / 2"
x2="width"
y2="height / 2"/>
<line color="#ffffff" width="48"
x1="width - title_width + (height / 2) + (height * 2)"
y1="0 - height"

View File

@@ -4,7 +4,8 @@ THEMES= \
Crux \
Esco \
AgingGorilla \
Metabox
Metabox \
Simple
THEME_DIR=$(datadir)/themes
THEME_SUBDIR=metacity-1

BIN
src/themes/Simple/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

View File

@@ -0,0 +1,316 @@
<?xml version="1.0"?>
<metacity_theme>
<info>
<name>Simple</name>
<author>Tuomas Kuosmanen &lt;tigert@ximian.com&gt;</author>
<copyright>&#194; Tuomas Kuosmanen, 2002, based on Atlanta theme by Havoc.</copyright>
<date>April, 2002</date>
<description>Default GNOME window theme</description>
</info>
<frame_geometry name="normal">
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
<distance name="left_titlebar_edge" value="2"/>
<distance name="right_titlebar_edge" value="2"/>
<distance name="button_width" value="16"/>
<distance name="button_height" value="16"/>
<distance name="title_vertical_pad" value="0"/>
<border name="title_border" left="1" right="1" top="2" bottom="2"/>
<border name="button_border" left="1" right="1" top="0" bottom="0"/>
</frame_geometry>
<!-- strip borders off the normal geometry -->
<frame_geometry name="normal_small_borders" parent="normal">
<distance name="left_width" value="0"/>
<distance name="right_width" value="0"/>
<distance name="bottom_height" value="0"/>
<distance name="left_titlebar_edge" value="0"/>
<distance name="right_titlebar_edge" value="0"/>
</frame_geometry>
<frame_geometry name="utility" title_scale="xx-small">
<distance name="left_width" value="3"/>
<distance name="right_width" value="3"/>
<distance name="bottom_height" value="4"/>
<distance name="left_titlebar_edge" value="3"/>
<distance name="right_titlebar_edge" value="3"/>
<distance name="button_width" value="16"/>
<distance name="button_height" value="16"/>
<distance name="title_vertical_pad" value="1"/>
<border name="title_border" left="3" right="4" top="3" bottom="3"/>
<border name="button_border" left="0" right="0" top="0" bottom="0"/>
</frame_geometry>
<frame_geometry name="border" has_title="false">
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
<distance name="left_titlebar_edge" value="0"/>
<distance name="right_titlebar_edge" value="0"/>
<distance name="button_width" value="0"/>
<distance name="button_height" value="0"/>
<distance name="title_vertical_pad" value="4"/>
<border name="title_border" left="0" right="0" top="0" bottom="0"/>
<border name="button_border" left="0" right="0" top="0" bottom="0"/>
</frame_geometry>
<!-- define constants -->
<constant name="ArrowWidth" value="8"/>
<constant name="ArrowHeight" value="4"/>
<constant name="ButtonIPad" value="4"/>
<constant name="ThickLineWidth" value="3"/>
<constant name="IconTitleSpacing" value="6"/>
<constant name="SpacerWidth" value="2"/>
<constant name="SpacerHeight" value="10"/>
<!-- Buttons -->
<draw_ops name="button_pressed_bg">
<rectangle color="gtk:light[NORMAL]" filled="true"
x="1" y="1" width="width" height="height"/>
<rectangle color="gtk:dark[NORMAL]" filled="true"
x="0" y="0" width="width - 1" height="height - 1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.9" filled="true"
x="1" y="1" width="width - 2" height="height - 2"/>
<!-- gtk_box state="active" shadow="out" x="0" y="0" width="width" height="height"/ -->
</draw_ops>
<draw_ops name="menu_button">
<icon x="1"
y="1"
width="width-2" height="height-2"/>
</draw_ops>
<draw_ops name="menu_button_pressed">
<include name="menu_button"/>
</draw_ops>
<draw_ops name="minimize_button">
<image filename="minimize.png" x="0" y="0" width="object_width" height="object_height"/>
</draw_ops>
<draw_ops name="minimize_button_pressed">
<include name="button_pressed_bg"/>
<include name="minimize_button"/>
</draw_ops>
<draw_ops name="maximize_button">
<image filename="maximize.png" x="0" y="0" width="object_width" height="object_height"/>
</draw_ops>
<draw_ops name="maximize_button_pressed">
<include name="button_pressed_bg"/>
<include name="maximize_button"/>
</draw_ops>
<draw_ops name="restore_button">
<image filename="maximized.png" x="0" y="0" width="object_width" height="object_height"/>
</draw_ops>
<draw_ops name="restore_button_pressed">
<include name="button_pressed_bg"/>
<include name="restore_button"/>
</draw_ops>
<draw_ops name="close_button">
<image filename="close.png" x="0" y="0" width="object_width" height="object_height"/>
</draw_ops>
<draw_ops name="close_button_pressed">
<include name="button_pressed_bg"/>
<include name="close_button"/>
</draw_ops>
<draw_ops name="outer_bevel">
<rectangle color="#000000"
x="0" y="0" width="width" height="height" filled="true"/>
<rectangle color="gtk:bg[NORMAL]"
x="1" y="1" width="width-2" height="height-2" filled="true"/>
<line color="gtk:light[NORMAL]"
x1="1" y1="1" x2="1" y2="height-3"/>
<line color="gtk:light[NORMAL]"
x1="1" y1="1" x2="width-3" y2="1"/>
<line color="gtk:dark[NORMAL]"
x1="width-2" y1="2" x2="width-2" y2="height-2"/>
<line color="gtk:dark[NORMAL]"
x1="2" y1="height-2" x2="width-3" y2="height-2"/>
</draw_ops>
<draw_ops name="blank">
<!-- nothing -->
</draw_ops>
<draw_ops name="focus_outline">
<rectangle color="gtk:dark[NORMAL]"
x="left_width-1" y="top_height-1"
width="width-left_width-right_width+1"
height="height-top_height-bottom_height+1"/>
</draw_ops>
<draw_ops name="focus_background">
<include name="outer_bevel"/>
</draw_ops>
<draw_ops name="title_tile">
<line color="gtk:bg[SELECTED]" x1="0" y1="0" x2="width" y2="0"/>
<line color="blend/gtk:bg[SELECTED]/#000000/0.1" x1="0" y1="1" x2="width" y2="1"/>
</draw_ops>
<draw_ops name="title_tile_unfocused">
<line color="blend/gtk:bg[NORMAL]/#000000/0.1" x1="0" y1="0" x2="width" y2="0"/>
<line color="blend/gtk:bg[NORMAL]/#000000/0.2" x1="0" y1="1" x2="width" y2="1"/>
</draw_ops>
<draw_ops name="title_bg">
<tile name="title_tile" tile_width="width" tile_height="2" x="0" y="0" width="width" height="height"/>
<rectangle color="blend/gtk:bg[SELECTED]/#000000/0.6" filled="false" x="0" y="0" width="width-1" height="height-1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.5" filled="true" x="0" y="0" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.5" filled="true" x="width-1" y="0" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.5" filled="true" x="0" y="height-1" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.5" filled="true" x="width-1" y="height-1" width="1" height="1"/>
</draw_ops>
<draw_ops name="title_bg_unfocused">
<tile name="title_tile_unfocused" tile_width="width" tile_height="2" x="0" y="0" width="width-1" height="height-1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.7" filled="false" x="0" y="0" width="width-1" height="height-1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.8" filled="true" x="0" y="0" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.8" filled="true" x="width-1" y="0" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.8" filled="true" x="0" y="height-1" width="1" height="1"/>
<rectangle color="blend/#000000/gtk:bg[NORMAL]/0.8" filled="true" x="width-1" y="height-1" width="1" height="1"/>
</draw_ops>
<draw_ops name="title_text_focused">
<clip x="0" y="0" width="width-SpacerWidth" height="height"/>
<title color="blend/gtk:fg[SELECTED]/#000000/0.7"
x="(0 `max` (width-title_width-mini_icon_width-IconTitleSpacing)) / 2 + mini_icon_width + IconTitleSpacing + 1"
y="((height - title_height) / 2) `max` 0 + 1"/>
<title color="gtk:fg[SELECTED]"
x="(0 `max` (width-title_width-mini_icon_width-IconTitleSpacing)) / 2 + mini_icon_width + IconTitleSpacing"
y="((height - title_height) / 2) `max` 0"/>
</draw_ops>
<draw_ops name="title_text">
<clip x="0" y="0" width="width-SpacerWidth" height="height"/>
<title color="blend/gtk:dark[NORMAL]/#000000/0.5"
x="(0 `max` (width-title_width-mini_icon_width-IconTitleSpacing)) / 2 + mini_icon_width + IconTitleSpacing"
y="((height - title_height) / 2) `max` 0"/>
</draw_ops>
<draw_ops name="title_normal">
<include name="title_bg_unfocused"/>
<include name="title_text"/>
</draw_ops>
<draw_ops name="title_focused">
<include name="title_bg"/>
<include name="title_text_focused"/>
</draw_ops>
<draw_ops name="title_utility">
<include name="title_text"/>
</draw_ops>
<draw_ops name="title_utility_focused">
<include name="title_bg"/>
<include name="title_text_focused"/>
</draw_ops>
<frame_style name="normal_unfocused" geometry="normal">
<piece position="entire_background" draw_ops="outer_bevel"/>
<piece position="title" draw_ops="title_normal"/>
<!-- we don't specify for prelight, so normal is used -->
<button function="close" state="normal" draw_ops="close_button"/>
<button function="close" state="pressed" draw_ops="close_button_pressed"/>
<button function="minimize" state="normal" draw_ops="minimize_button"/>
<button function="minimize" state="pressed" draw_ops="minimize_button_pressed"/>
<button function="maximize" state="normal" draw_ops="maximize_button"/>
<button function="maximize" state="pressed" draw_ops="maximize_button_pressed"/>
<button function="menu" state="normal" draw_ops="menu_button"/>
<button function="menu" state="pressed" draw_ops="menu_button_pressed"/>
</frame_style>
<frame_style name="normal_focused" geometry="normal" parent="normal_unfocused">
<piece position="entire_background" draw_ops="focus_background"/>
<piece position="title" draw_ops="title_focused"/>
</frame_style>
<frame_style name="shaded_focused" geometry="normal" parent="normal_unfocused">
<piece position="title" draw_ops="title_focused"/>
</frame_style>
<frame_style name="maximized_unfocused" geometry="normal_small_borders" parent="normal_unfocused">
<piece position="entire_background" draw_ops="blank"/>
<button function="maximize" state="normal" draw_ops="restore_button"/>
<button function="maximize" state="pressed" draw_ops="restore_button_pressed"/>
</frame_style>
<frame_style name="maximized_focused" geometry="normal_small_borders" parent="normal_focused">
<piece position="entire_background" draw_ops="focus_outline"/>
<button function="maximize" state="normal" draw_ops="restore_button"/>
<button function="maximize" state="pressed" draw_ops="restore_button_pressed"/>
</frame_style>
<frame_style name="utility_unfocused" geometry="utility" parent="normal_unfocused">
<piece position="title" draw_ops="title_utility"/>
</frame_style>
<frame_style name="utility_focused" geometry="utility" parent="normal_focused">
<piece position="title" draw_ops="title_utility_focused"/>
</frame_style>
<frame_style name="border" geometry="border" parent="normal_unfocused">
<piece position="entire_background" draw_ops="outer_bevel"/>
<piece position="title" draw_ops="blank"/>
</frame_style>
<frame_style_set name="normal">
<frame focus="yes" state="normal" resize="both" style="normal_focused"/>
<frame focus="no" state="normal" resize="both" style="normal_unfocused"/>
<frame focus="yes" state="maximized" style="maximized_focused"/>
<frame focus="no" state="maximized" style="maximized_unfocused"/>
<frame focus="yes" state="shaded" style="shaded_focused"/>
<frame focus="no" state="shaded" style="normal_unfocused"/>
<frame focus="yes" state="maximized_and_shaded" style="maximized_focused"/>
<frame focus="no" state="maximized_and_shaded" style="maximized_unfocused"/>
</frame_style_set>
<frame_style_set name="utility" parent="normal">
<frame focus="yes" state="normal" resize="both" style="utility_focused"/>
<frame focus="no" state="normal" resize="both" style="utility_unfocused"/>
<!-- this is a bunch of crack since utility windows shouldn't be maximized -->
<frame focus="yes" state="maximized" style="utility_focused"/>
<frame focus="no" state="maximized" style="utility_unfocused"/>
<frame focus="yes" state="shaded" style="utility_focused"/>
<frame focus="no" state="shaded" style="utility_unfocused"/>
<frame focus="yes" state="maximized_and_shaded" style="utility_focused"/>
<frame focus="no" state="maximized_and_shaded" style="utility_unfocused"/>
</frame_style_set>
<frame_style_set name="border" parent="normal">
<frame focus="yes" state="normal" resize="both" style="border"/>
<frame focus="no" state="normal" resize="both" style="border"/>
<!-- this is a bunch of crack since utility windows shouldn't be maximized -->
<frame focus="yes" state="maximized" style="utility_focused"/>
<frame focus="no" state="maximized" style="utility_unfocused"/>
<frame focus="yes" state="shaded" style="utility_focused"/>
<frame focus="no" state="shaded" style="utility_unfocused"/>
<frame focus="yes" state="maximized_and_shaded" style="utility_focused"/>
<frame focus="no" state="maximized_and_shaded" style="utility_unfocused"/>
</frame_style_set>
<window type="normal" style_set="normal"/>
<window type="dialog" style_set="normal"/>
<window type="modal_dialog" style_set="normal"/>
<window type="menu" style_set="normal"/>
<window type="utility" style_set="utility"/>
<window type="border" style_set="border"/>
<menu_icon function="close" state="normal" draw_ops="close_button"/>
<menu_icon function="maximize" state="normal" draw_ops="maximize_button"/>
<menu_icon function="unmaximize" state="normal" draw_ops="restore_button"/>
<menu_icon function="minimize" state="normal" draw_ops="minimize_button"/>
</metacity_theme>

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -21,12 +21,10 @@ metacity_mag_SOURCES= \
metacity_grayscale_SOURCES= \
metacity-grayscale.c
if BUILD_CONFIG_DIALOG
metacity_properties_SOURCES= \
metacity-properties.c
metacity_properties_LDFLAGS = -export-dynamic
endif
uidir=$(pkgdatadir)/glade
ui_DATA=metacity-properties.glade
@@ -34,9 +32,15 @@ ui_DATA=metacity-properties.glade
propicondir=$(datadir)/pixmaps
propicon_DATA=metacity-properties.png
METACITY_PROPERTIES_DESKTOP_IN=metacity-properties.desktop.in
if BUILD_CONFIG_DIALOG
METACITY_PROPERTIES_DESKTOP=metacity-properties.desktop
else
METACITY_PROPERTIES_DESKTOP=
endif
desktopdir=$(datadir)/control-center-2.0/capplets
Desktop_in_files=metacity-properties.desktop.in
desktop_DATA=$(Desktop_in_files:.desktop.in=.desktop)
desktop_DATA=$(METACITY_PROPERTIES_DESKTOP)
if BUILD_CONFIG_DIALOG
CONFIG_DIALOG=metacity-properties
@@ -57,5 +61,5 @@ if BUILD_CONFIG_DIALOG
metacity_properties_LDADD= @METACITY_PROPS_LIBS@
endif
EXTRA_DIST=$(icon_DATA) $(ui_DATA) $(propicon_DATA) $(Desktop_in_files)
EXTRA_DIST=$(icon_DATA) $(ui_DATA) $(propicon_DATA) $(METACITY_PROPERTIES_DESKTOP_IN)

View File

@@ -51,28 +51,6 @@ meta_ui_init (int *argc, char ***argv)
if (!gtk_init_check (argc, argv))
meta_fatal ("Unable to open X display %s\n", XDisplayName (NULL));
{
/* FIXME hackaround for Pango opening a separate display
* connection and doing a server grab while we have a grab
* on the primary display connection. This forces Pango to
* go ahead and do its font cache before we try to grab
* the server.
*/
PangoFontMetrics *metrics;
PangoLanguage *lang;
PangoContext *context;
PangoFontDescription *font_desc;
context = gdk_pango_context_get ();
lang = gtk_get_default_language ();
font_desc = pango_font_description_from_string ("Sans 12");
metrics = pango_context_get_metrics (context, font_desc, lang);
pango_font_metrics_unref (metrics);
pango_font_description_free (font_desc);
g_object_unref (G_OBJECT (context));
}
meta_stock_icons_init ();
}
@@ -238,12 +216,15 @@ meta_ui_reset_frame_bg (MetaUI *ui,
}
void
meta_ui_apply_frame_shape (MetaUI *ui,
Window xwindow,
int new_window_width,
int new_window_height)
meta_ui_apply_frame_shape (MetaUI *ui,
Window xwindow,
int new_window_width,
int new_window_height,
gboolean window_has_shape)
{
meta_frames_apply_shapes (ui->frames, xwindow, new_window_width, new_window_height);
meta_frames_apply_shapes (ui->frames, xwindow,
new_window_width, new_window_height,
window_has_shape);
}
void
@@ -309,21 +290,16 @@ meta_image_window_new (Display *xdisplay,
int max_height)
{
MetaImageWindow *iw;
GdkDisplay *gdisplay;
GdkScreen *gscreen;
iw = g_new (MetaImageWindow, 1);
iw->window = gtk_window_new (GTK_WINDOW_POPUP);
#ifdef HAVE_GTK_MULTIHEAD
{
GdkDisplay *gdisplay;
GdkScreen *gscreen;
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
gscreen = gdk_display_get_screen (gdisplay, screen_number);
gtk_window_set_screen (GTK_WINDOW (iw->window), gscreen);
}
#endif
gdisplay = gdk_x11_lookup_xdisplay (xdisplay);
gscreen = gdk_display_get_screen (gdisplay, screen_number);
gtk_window_set_screen (GTK_WINDOW (iw->window), gscreen);
gtk_widget_realize (iw->window);
iw->pixmap = gdk_pixmap_new (iw->window->window,
@@ -410,11 +386,8 @@ get_cmap (GdkPixmap *pixmap)
else
{
meta_verbose ("Using system cmap to snapshot pixmap\n");
#ifdef HAVE_GTK_MULTIHEAD
cmap = gdk_screen_get_system_colormap (gdk_drawable_get_screen (pixmap));
#else
cmap = gdk_colormap_get_system ();
#endif
g_object_ref (G_OBJECT (cmap));
}
}

View File

@@ -73,10 +73,11 @@ void meta_ui_unflicker_frame_bg (MetaUI *ui,
void meta_ui_reset_frame_bg (MetaUI *ui,
Window xwindow);
void meta_ui_apply_frame_shape (MetaUI *ui,
Window xwindow,
int new_window_width,
int new_window_height);
void meta_ui_apply_frame_shape (MetaUI *ui,
Window xwindow,
int new_window_width,
int new_window_height,
gboolean window_has_shape);
void meta_ui_queue_frame_draw (MetaUI *ui,
Window xwindow);

View File

@@ -280,9 +280,13 @@ topic_name (MetaDebugTopic topic)
return "PREFS";
case META_DEBUG_GROUPS:
return "GROUPS";
case META_DEBUG_RESIZING:
return "RESIZING";
case META_DEBUG_SHAPES:
return "SHAPES";
}
return "Window manager";
return "WM";
}
static int sync_count = 0;

View File

@@ -64,7 +64,9 @@ typedef enum
META_DEBUG_ERRORS = 1 << 14,
META_DEBUG_STARTUP = 1 << 15,
META_DEBUG_PREFS = 1 << 16,
META_DEBUG_GROUPS = 1 << 17
META_DEBUG_GROUPS = 1 << 17,
META_DEBUG_RESIZING = 1 << 18,
META_DEBUG_SHAPES = 1 << 19
} MetaDebugTopic;

View File

@@ -1,7 +1,7 @@
/* MetaWindow property handling */
/*
* Copyright (C) 2001, 2002 Red Hat, Inc.
* Copyright (C) 2001, 2002, 2003 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -23,6 +23,7 @@
#include "window-props.h"
#include "xprops.h"
#include "frame.h"
#include "group.h"
#include <X11/Xatom.h>
typedef void (* InitValueFunc) (MetaDisplay *display,
@@ -228,7 +229,7 @@ init_wm_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_STRING;
value->type = META_PROP_VALUE_TEXT_PROPERTY;
value->atom = XA_WM_NAME;
}
@@ -302,7 +303,7 @@ init_wm_icon_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_STRING;
value->type = META_PROP_VALUE_TEXT_PROPERTY;
value->atom = XA_WM_ICON_NAME;
}
@@ -412,7 +413,442 @@ reload_net_startup_id (MetaWindow *window,
window->desc);
}
#define N_HOOKS 23
static void
init_update_counter (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_SYNC_COUNTER;
value->atom = display->atom_metacity_update_counter;
}
static void
reload_update_counter (MetaWindow *window,
MetaPropValue *value)
{
if (value->type != META_PROP_VALUE_INVALID)
{
#ifdef HAVE_XSYNC
XSyncCounter counter = value->v.xcounter;
window->update_counter = counter;
meta_verbose ("Window has _METACITY_UPDATE_COUNTER 0x%lx\n",
window->update_counter);
#endif
}
}
static void
init_normal_hints (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_SIZE_HINTS;
value->atom = XA_WM_NORMAL_HINTS;
}
#define FLAG_TOGGLED_ON(old,new,flag) \
(((old)->flags & (flag)) == 0 && \
((new)->flags & (flag)) != 0)
#define FLAG_TOGGLED_OFF(old,new,flag) \
(((old)->flags & (flag)) != 0 && \
((new)->flags & (flag)) == 0)
#define FLAG_CHANGED(old,new,flag) \
(FLAG_TOGGLED_ON(old,new,flag) || FLAG_TOGGLED_OFF(old,new,flag))
static void
spew_size_hints_differences (const XSizeHints *old,
const XSizeHints *new)
{
if (FLAG_CHANGED (old, new, USPosition))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: USPosition now %s\n",
FLAG_TOGGLED_ON (old, new, USPosition) ? "set" : "unset");
if (FLAG_CHANGED (old, new, USSize))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: USSize now %s\n",
FLAG_TOGGLED_ON (old, new, USSize) ? "set" : "unset");
if (FLAG_CHANGED (old, new, PPosition))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PPosition now %s\n",
FLAG_TOGGLED_ON (old, new, PPosition) ? "set" : "unset");
if (FLAG_CHANGED (old, new, PSize))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PSize now %s\n",
FLAG_TOGGLED_ON (old, new, PSize) ? "set" : "unset");
if (FLAG_CHANGED (old, new, PMinSize))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PMinSize now %s (%d x %d -> %d x %d)\n",
FLAG_TOGGLED_ON (old, new, PMinSize) ? "set" : "unset",
old->min_width, old->min_height,
new->min_width, new->min_height);
if (FLAG_CHANGED (old, new, PMaxSize))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PMaxSize now %s (%d x %d -> %d x %d)\n",
FLAG_TOGGLED_ON (old, new, PMaxSize) ? "set" : "unset",
old->max_width, old->max_height,
new->max_width, new->max_height);
if (FLAG_CHANGED (old, new, PResizeInc))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PResizeInc now %s (width_inc %d -> %d height_inc %d -> %d)\n",
FLAG_TOGGLED_ON (old, new, PResizeInc) ? "set" : "unset",
old->width_inc, new->width_inc,
old->height_inc, new->height_inc);
if (FLAG_CHANGED (old, new, PAspect))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PAspect now %s (min %d/%d -> %d/%d max %d/%d -> %d/%d)\n",
FLAG_TOGGLED_ON (old, new, PAspect) ? "set" : "unset",
old->min_aspect.x, old->min_aspect.y,
new->min_aspect.x, new->min_aspect.y,
old->max_aspect.x, old->max_aspect.y,
new->max_aspect.x, new->max_aspect.y);
if (FLAG_CHANGED (old, new, PBaseSize))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PBaseSize now %s (%d x %d -> %d x %d)\n",
FLAG_TOGGLED_ON (old, new, PBaseSize) ? "set" : "unset",
old->base_width, old->base_height,
new->base_width, new->base_height);
if (FLAG_CHANGED (old, new, PWinGravity))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PWinGravity now %s (%d -> %d)\n",
FLAG_TOGGLED_ON (old, new, PWinGravity) ? "set" : "unset",
old->win_gravity, new->win_gravity);
}
void
meta_set_normal_hints (MetaWindow *window,
XSizeHints *hints)
{
int x, y, w, h;
/* Save the last ConfigureRequest, which we put here.
* Values here set in the hints are supposed to
* be ignored.
*/
x = window->size_hints.x;
y = window->size_hints.y;
w = window->size_hints.width;
h = window->size_hints.height;
/* as far as I can tell, value->v.size_hints.flags is just to
* check whether we had old-style normal hints without gravity,
* base size as returned by XGetNormalHints(), so we don't
* really use it as we fixup window->size_hints to have those
* fields if they're missing.
*/
/*
* When the window is first created, NULL hints will
* be passed in which will initialize all of the fields
* as if flags were zero
*/
if (hints)
window->size_hints = *hints;
else
window->size_hints.flags = 0;
/* Put back saved ConfigureRequest. */
window->size_hints.x = x;
window->size_hints.y = y;
window->size_hints.width = w;
window->size_hints.height = h;
if (window->size_hints.flags & PBaseSize)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets base size %d x %d\n",
window->desc,
window->size_hints.base_width,
window->size_hints.base_height);
}
else if (window->size_hints.flags & PMinSize)
{
window->size_hints.base_width = window->size_hints.min_width;
window->size_hints.base_height = window->size_hints.min_height;
}
else
{
window->size_hints.base_width = 0;
window->size_hints.base_height = 0;
}
window->size_hints.flags |= PBaseSize;
if (window->size_hints.flags & PMinSize)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets min size %d x %d\n",
window->desc,
window->size_hints.min_width,
window->size_hints.min_height);
}
else if (window->size_hints.flags & PBaseSize)
{
window->size_hints.min_width = window->size_hints.base_width;
window->size_hints.min_height = window->size_hints.base_height;
}
else
{
window->size_hints.min_width = 0;
window->size_hints.min_height = 0;
}
window->size_hints.flags |= PMinSize;
if (window->size_hints.flags & PMaxSize)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets max size %d x %d\n",
window->desc,
window->size_hints.max_width,
window->size_hints.max_height);
}
else
{
window->size_hints.max_width = G_MAXINT;
window->size_hints.max_height = G_MAXINT;
window->size_hints.flags |= PMaxSize;
}
if (window->size_hints.max_width < window->size_hints.min_width)
{
/* someone is on crack */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets max width %d less than min width %d, disabling resize\n",
window->desc,
window->size_hints.max_width,
window->size_hints.min_width);
window->size_hints.max_width = window->size_hints.min_width;
}
if (window->size_hints.max_height < window->size_hints.min_height)
{
/* another cracksmoker */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets max height %d less than min height %d, disabling resize\n",
window->desc,
window->size_hints.max_height,
window->size_hints.min_height);
window->size_hints.max_height = window->size_hints.min_height;
}
if (window->size_hints.min_width < 1)
{
/* another cracksmoker */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets min width to 0, which makes no sense\n",
window->desc);
window->size_hints.min_width = 1;
}
if (window->size_hints.max_width < 1)
{
/* another cracksmoker */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets max width to 0, which makes no sense\n",
window->desc);
window->size_hints.max_width = 1;
}
if (window->size_hints.min_height < 1)
{
/* another cracksmoker */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets min height to 0, which makes no sense\n",
window->desc);
window->size_hints.min_height = 1;
}
if (window->size_hints.max_height < 1)
{
/* another cracksmoker */
meta_topic (META_DEBUG_GEOMETRY,
"Window %s sets max height to 0, which makes no sense\n",
window->desc);
window->size_hints.max_height = 1;
}
if (window->size_hints.flags & PResizeInc)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets resize width inc: %d height inc: %d\n",
window->desc,
window->size_hints.width_inc,
window->size_hints.height_inc);
if (window->size_hints.width_inc == 0)
{
window->size_hints.width_inc = 1;
meta_topic (META_DEBUG_GEOMETRY, "Corrected 0 width_inc to 1\n");
}
if (window->size_hints.height_inc == 0)
{
window->size_hints.height_inc = 1;
meta_topic (META_DEBUG_GEOMETRY, "Corrected 0 height_inc to 1\n");
}
}
else
{
window->size_hints.width_inc = 1;
window->size_hints.height_inc = 1;
window->size_hints.flags |= PResizeInc;
}
if (window->size_hints.flags & PAspect)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets min_aspect: %d/%d max_aspect: %d/%d\n",
window->desc,
window->size_hints.min_aspect.x,
window->size_hints.min_aspect.y,
window->size_hints.max_aspect.x,
window->size_hints.max_aspect.y);
/* don't divide by 0 */
if (window->size_hints.min_aspect.y < 1)
window->size_hints.min_aspect.y = 1;
if (window->size_hints.max_aspect.y < 1)
window->size_hints.max_aspect.y = 1;
}
else
{
window->size_hints.min_aspect.x = 1;
window->size_hints.min_aspect.y = G_MAXINT;
window->size_hints.max_aspect.x = G_MAXINT;
window->size_hints.max_aspect.y = 1;
window->size_hints.flags |= PAspect;
}
if (window->size_hints.flags & PWinGravity)
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s sets gravity %d\n",
window->desc,
window->size_hints.win_gravity);
}
else
{
meta_topic (META_DEBUG_GEOMETRY, "Window %s doesn't set gravity, using NW\n",
window->desc);
window->size_hints.win_gravity = NorthWestGravity;
window->size_hints.flags |= PWinGravity;
}
}
static void
reload_normal_hints (MetaWindow *window,
MetaPropValue *value)
{
if (value->type != META_PROP_VALUE_INVALID)
{
XSizeHints old_hints;
meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n", window->desc);
old_hints = window->size_hints;
meta_set_normal_hints (window, value->v.size_hints.hints);
spew_size_hints_differences (&old_hints, &window->size_hints);
meta_window_recalc_features (window);
}
}
static void
init_wm_protocols (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_ATOM_LIST;
value->atom = display->atom_wm_protocols;
}
static void
reload_wm_protocols (MetaWindow *window,
MetaPropValue *value)
{
int i;
window->take_focus = FALSE;
window->delete_window = FALSE;
window->net_wm_ping = FALSE;
if (value->type == META_PROP_VALUE_INVALID)
return;
i = 0;
while (i < value->v.atom_list.n_atoms)
{
if (value->v.atom_list.atoms[i] ==
window->display->atom_wm_take_focus)
window->take_focus = TRUE;
else if (value->v.atom_list.atoms[i] ==
window->display->atom_wm_delete_window)
window->delete_window = TRUE;
else if (value->v.atom_list.atoms[i] ==
window->display->atom_net_wm_ping)
window->net_wm_ping = TRUE;
++i;
}
meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n",
window->startup_id ? window->startup_id : "unset",
window->desc);
}
static void
init_wm_hints (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_WM_HINTS;
value->atom = XA_WM_HINTS;
}
static void
reload_wm_hints (MetaWindow *window,
MetaPropValue *value)
{
Window old_group_leader;
old_group_leader = window->xgroup_leader;
/* Fill in defaults */
window->input = TRUE;
window->initially_iconic = FALSE;
window->xgroup_leader = None;
window->wm_hints_pixmap = None;
window->wm_hints_mask = None;
if (value->type != META_PROP_VALUE_INVALID)
{
const XWMHints *hints = value->v.wm_hints;
if (hints->flags & InputHint)
window->input = hints->input;
if (hints->flags & StateHint)
window->initially_iconic = (hints->initial_state == IconicState);
if (hints->flags & WindowGroupHint)
window->xgroup_leader = hints->window_group;
if (hints->flags & IconPixmapHint)
window->wm_hints_pixmap = hints->icon_pixmap;
if (hints->flags & IconMaskHint)
window->wm_hints_mask = hints->icon_mask;
meta_verbose ("Read WM_HINTS input: %d iconic: %d group leader: 0x%lx pixmap: 0x%lx mask: 0x%lx\n",
window->input, window->initially_iconic,
window->xgroup_leader,
window->wm_hints_pixmap,
window->wm_hints_mask);
}
if (window->xgroup_leader != old_group_leader)
{
meta_verbose ("Window %s changed its group leader to 0x%lx\n",
window->desc, window->xgroup_leader);
meta_window_group_leader_changed (window);
}
meta_icon_cache_property_changed (&window->icon_cache,
window->display,
XA_WM_HINTS);
meta_window_queue_update_icon (window);
meta_window_queue_move_resize (window);
}
#define N_HOOKS 25
void
meta_display_init_window_prop_hooks (MetaDisplay *display)
@@ -442,11 +878,6 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
hooks[i].reload_func = reload_net_wm_pid;
++i;
hooks[i].property = XA_WM_NORMAL_HINTS;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom_net_wm_name;
hooks[i].init_func = init_net_wm_name;
hooks[i].reload_func = reload_net_wm_name;
@@ -466,11 +897,6 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
hooks[i].init_func = init_wm_icon_name;
hooks[i].reload_func = reload_wm_icon_name;
++i;
hooks[i].property = XA_WM_HINTS;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom_net_wm_state;
hooks[i].init_func = NULL;
@@ -541,6 +967,26 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
hooks[i].init_func = init_net_startup_id;
hooks[i].reload_func = reload_net_startup_id;
++i;
hooks[i].property = display->atom_metacity_update_counter;
hooks[i].init_func = init_update_counter;
hooks[i].reload_func = reload_update_counter;
++i;
hooks[i].property = XA_WM_NORMAL_HINTS;
hooks[i].init_func = init_normal_hints;
hooks[i].reload_func = reload_normal_hints;
++i;
hooks[i].property = display->atom_wm_protocols;
hooks[i].init_func = init_wm_protocols;
hooks[i].reload_func = reload_wm_protocols;
++i;
hooks[i].property = XA_WM_HINTS;
hooks[i].init_func = init_wm_hints;
hooks[i].reload_func = reload_wm_hints;
++i;
if (i != N_HOOKS)
g_error ("Initialized %d hooks should have been %d\n", i, N_HOOKS);

View File

@@ -33,4 +33,7 @@ void meta_window_reload_properties (MetaWindow *window,
void meta_display_init_window_prop_hooks (MetaDisplay *display);
void meta_display_free_window_prop_hooks (MetaDisplay *display);
void meta_set_normal_hints (MetaWindow *window,
XSizeHints *hints);
#endif /* META_WINDOW_PROPS_H */

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -22,6 +23,7 @@
#ifndef META_WINDOW_H
#define META_WINDOW_H
#include <config.h>
#include "screen.h"
#include "util.h"
#include "stack.h"
@@ -31,8 +33,8 @@
typedef struct _MetaGroup MetaGroup;
typedef void (*MetaWindowForeachFunc) (MetaWindow *window,
void *data);
typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
void *data);
typedef enum
{
@@ -189,6 +191,9 @@ struct _MetaWindow
/* Are we in the move_resize queue? */
guint move_resize_queued : 1;
/* Are we in the update_icon queue? */
guint update_icon_queued : 1;
/* Used by keybindings.c */
guint keys_grabbed : 1; /* normal keybindings grabbed */
@@ -216,6 +221,17 @@ struct _MetaWindow
/* Info on which props we got our attributes from */
guint using_net_wm_name : 1; /* vs. plain wm_name */
guint using_net_wm_icon_name : 1; /* vs. plain wm_icon_name */
/* has a shape mask */
guint has_shape : 1;
/* icon props have changed */
guint need_reread_icon : 1;
#ifdef HAVE_XSYNC
/* XSync update counter */
XSyncCounter update_counter;
#endif
/* Number of UnmapNotify that are caused by us, if
* we get UnmapNotify with none pending then the client
@@ -403,10 +419,14 @@ void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
gboolean meta_window_visible_on_workspace (MetaWindow *window,
MetaWorkspace *workspace);
/* Get minimum work area for all workspaces we're on */
void meta_window_get_work_area (MetaWindow *window,
gboolean for_current_xinerama,
MetaRectangle *area);
void meta_window_get_work_area_current_xinerama (MetaWindow *window,
MetaRectangle *area);
void meta_window_get_work_area_for_xinerama (MetaWindow *window,
int which_xinerama,
MetaRectangle *area);
void meta_window_get_work_area_all_xineramas (MetaWindow *window,
MetaRectangle *area);
gboolean meta_window_same_application (MetaWindow *window,
MetaWindow *other_window);
@@ -422,11 +442,14 @@ void meta_window_refresh_resize_popup (MetaWindow *window);
void meta_window_free_delete_dialog (MetaWindow *window);
void meta_window_foreach_transient (MetaWindow *window,
MetaWindowForeachFunc func,
void *data);
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
MetaWindow *transient);
void meta_window_foreach_transient (MetaWindow *window,
MetaWindowForeachFunc func,
void *data);
gboolean meta_window_is_ancestor_of_transient (MetaWindow *window,
MetaWindow *transient);
void meta_window_foreach_ancestor (MetaWindow *window,
MetaWindowForeachFunc func,
void *data);
gboolean meta_window_warp_pointer (MetaWindow *window,
MetaGrabOp grab_op);
@@ -445,4 +468,12 @@ gboolean meta_window_get_icon_geometry (MetaWindow *window,
const char* meta_window_get_startup_id (MetaWindow *window);
void meta_window_recalc_features (MetaWindow *window);
void meta_window_queue_update_icon (MetaWindow *window);
#endif

View File

@@ -1,6 +1,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <string.h>
int gravities[10] = {
NorthWestGravity,
@@ -15,17 +16,68 @@ int gravities[10] = {
StaticGravity
};
Window windows[10];
typedef struct
{
int x, y, width, height;
} Rectangle;
int x_offset[3] = { 0, -50, -100 };
int y_offset[3] = { 0, -50, -100 };
Window windows[10];
int doubled[10] = { 0, };
Rectangle window_rects[10];
#define WINDOW_WIDTH 100
#define WINDOW_HEIGHT 100
int x_offset[3] = { 0, - WINDOW_WIDTH/2, -WINDOW_WIDTH };
int y_offset[3] = { 0, - WINDOW_HEIGHT/2, -WINDOW_HEIGHT };
double screen_x_fraction[3] = { 0, 0.5, 1.0 };
double screen_y_fraction[3] = { 0, 0.5, 1.0 };
int screen_width;
int screen_height;
static const char*
window_gravity_to_string (int gravity)
{
switch (gravity)
{
case NorthWestGravity:
return "NorthWestGravity";
break;
case NorthGravity:
return "NorthGravity";
break;
case NorthEastGravity:
return "NorthEastGravity";
break;
case WestGravity:
return "WestGravity";
break;
case CenterGravity:
return "CenterGravity";
break;
case EastGravity:
return "EastGravity";
break;
case SouthWestGravity:
return "SouthWestGravity";
break;
case SouthGravity:
return "SouthGravity";
break;
case SouthEastGravity:
return "SouthEastGravity";
break;
case StaticGravity:
return "StaticGravity";
break;
default:
return "NorthWestGravity";
break;
}
}
static void
calculate_position (int i, int *x, int *y)
calculate_position (int i, int doubled, int *x, int *y)
{
if (i == 9)
{
@@ -34,11 +86,45 @@ calculate_position (int i, int *x, int *y)
}
else
{
*x = screen_x_fraction[i % 3] * screen_width + x_offset[i % 3];
*y = screen_y_fraction[i / 3] * screen_height + y_offset[i / 3];
int xoff = x_offset[i % 3];
int yoff = y_offset[i / 3];
if (doubled)
{
xoff *= 2;
yoff *= 2;
}
*x = screen_x_fraction[i % 3] * screen_width + xoff;
*y = screen_y_fraction[i / 3] * screen_height + yoff;
}
}
static int
find_window (Window window)
{
int i;
for (i=0; i<10; i++)
{
if (windows[i] == window)
return i;
}
return -1;
}
typedef struct {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long input_mode;
unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)
int main (int argc, char **argv)
{
Display *d;
@@ -47,6 +133,12 @@ int main (int argc, char **argv)
int i;
int screen;
XEvent ev;
int noframes;
if (argc > 1 && strcmp (argv[1], "--noframes") == 0)
noframes = 1;
else
noframes = 0;
d = XOpenDisplay (NULL);
@@ -58,25 +150,58 @@ int main (int argc, char **argv)
{
int x, y;
calculate_position (i, &x, &y);
calculate_position (i, doubled[i], &x, &y);
w = XCreateSimpleWindow(d, RootWindow(d, screen),
x, y, 100, 100, 0,
WhitePixel(d, screen), WhitePixel(d, screen));
w = XCreateSimpleWindow (d, RootWindow (d, screen),
x, y, WINDOW_WIDTH, WINDOW_HEIGHT, 0,
WhitePixel (d, screen), WhitePixel (d, screen));
windows[i] = w;
XSelectInput (d, w, ButtonPressMask);
window_rects[i].x = x;
window_rects[i].y = y;
window_rects[i].width = WINDOW_WIDTH;
window_rects[i].height = WINDOW_HEIGHT;
XSelectInput (d, w, ButtonPressMask | ExposureMask | StructureNotifyMask);
hints.flags = USPosition | PMinSize | PMaxSize | PWinGravity;
hints.min_width = 100;
hints.min_height = 100;
hints.max_width = 200;
hints.max_height = 200;
hints.min_width = WINDOW_WIDTH / 2;
hints.min_height = WINDOW_HEIGHT / 2;
#if 1
/* we constrain max size below the "doubled" size so that
* the WM will have to deal with constraints
* at the same time it's dealing with configure request
*/
hints.max_width = WINDOW_WIDTH * 2 - WINDOW_WIDTH / 2;
hints.max_height = WINDOW_HEIGHT * 2 - WINDOW_HEIGHT / 2;
#else
hints.max_width = WINDOW_WIDTH * 2 + WINDOW_WIDTH / 2;
hints.max_height = WINDOW_HEIGHT * 2 + WINDOW_HEIGHT / 2;
#endif
hints.win_gravity = gravities[i];
XSetWMNormalHints (d, w, &hints);
XStoreName (d, w, window_gravity_to_string (hints.win_gravity));
if (noframes)
{
MotifWmHints mwm;
Atom mwm_atom;
mwm.decorations = 0;
mwm.flags = MWM_HINTS_DECORATIONS;
mwm_atom = XInternAtom (d, "_MOTIF_WM_HINTS", False);
XChangeProperty (d, w, mwm_atom, mwm_atom,
32, PropModeReplace,
(unsigned char *)&mwm,
sizeof (MotifWmHints)/sizeof (long));
}
XMapWindow (d, w);
}
@@ -84,25 +209,106 @@ int main (int argc, char **argv)
{
XNextEvent (d, &ev);
if (ev.xany.type == ButtonPress)
if (ev.xany.type == ConfigureNotify)
{
i = find_window (ev.xconfigure.window);
if (i >= 0)
{
Window ignored;
window_rects[i].width = ev.xconfigure.width;
window_rects[i].height = ev.xconfigure.height;
XClearArea (d, windows[i], 0, 0,
ev.xconfigure.width,
ev.xconfigure.height,
True);
if (!ev.xconfigure.send_event)
XTranslateCoordinates (d, windows[i], DefaultRootWindow (d),
0, 0,
&window_rects[i].x, &window_rects[i].y,
&ignored);
else
{
window_rects[i].x = ev.xconfigure.x;
window_rects[i].y = ev.xconfigure.y;
}
}
}
else if (ev.xany.type == Expose)
{
i = find_window (ev.xexpose.window);
if (i >= 0)
{
GC gc;
XGCValues values;
char buf[256];
values.foreground = BlackPixel (d, screen);
gc = XCreateGC (d, windows[i],
GCForeground, &values);
sprintf (buf,
"%d,%d",
window_rects[i].x,
window_rects[i].y);
XDrawString (d, windows[i], gc, 10, 15,
buf, strlen (buf));
sprintf (buf,
"%dx%d",
window_rects[i].width,
window_rects[i].height);
XDrawString (d, windows[i], gc, 10, 35,
buf, strlen (buf));
XFreeGC (d, gc);
}
}
else if (ev.xany.type == ButtonPress)
{
for (i=0; i<10; i++)
{
if (windows[i] == ev.xbutton.window)
{
if (ev.xbutton.button == Button1)
{
int x, y;
i = find_window (ev.xbutton.window);
if (i >= 0)
{
/* Button 1 = move, 2 = resize, 3 = both at once */
if (ev.xbutton.button == Button1)
{
int x, y;
calculate_position (i, &x, &y);
w = XMoveWindow (d, windows[i], x, y);
}
else
{
w = XResizeWindow (d, windows[i], 200, 200);
}
}
}
calculate_position (i, doubled[i], &x, &y);
XMoveWindow (d, windows[i], x, y);
}
else if (ev.xbutton.button == Button2)
{
if (doubled[i])
XResizeWindow (d, windows[i], WINDOW_WIDTH, WINDOW_HEIGHT);
else
XResizeWindow (d, windows[i], WINDOW_WIDTH*2, WINDOW_HEIGHT*2);
doubled[i] = !doubled[i];
}
else if (ev.xbutton.button == Button3)
{
int x, y;
calculate_position (i, !doubled[i], &x, &y);
if (doubled[i])
XMoveResizeWindow (d, windows[i], x, y, WINDOW_WIDTH, WINDOW_HEIGHT);
else
XMoveResizeWindow (d, windows[i], x, y, WINDOW_WIDTH*2, WINDOW_HEIGHT*2);
doubled[i] = !doubled[i];
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More