Compare commits
	
		
			179 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 83a449df95 | ||
|   | 9c683aaea9 | ||
|   | 634b76b82c | ||
|   | a3ea43da52 | ||
|   | f464b85ffc | ||
|   | db055c6029 | ||
|   | eedc74943b | ||
|   | 82b134ed46 | ||
|   | cc1de7e7d0 | ||
|   | a199d74069 | ||
|   | 7a23d3024a | ||
|   | 734888406c | ||
|   | e0ce24b3f5 | ||
|   | c13e62f72c | ||
|   | 3d958de33e | ||
|   | 4689688af3 | ||
|   | d402a68c73 | ||
|   | 66d1dd3679 | ||
|   | 43e48fc962 | ||
|   | 1fea2a5101 | ||
|   | 92e317ec2a | ||
|   | c5d1d2db62 | ||
|   | b1725bc18c | ||
|   | 5500c2b3a8 | ||
|   | 82db52aaf4 | ||
|   | 654d966e6c | ||
|   | 92663c81f5 | ||
|   | e3ebcc004d | ||
|   | 26e41bc24a | ||
|   | c9e9412540 | ||
|   | 14d6d63ad0 | ||
|   | 2134213f92 | ||
|   | 1935e508f7 | ||
|   | 83b6ec7899 | ||
|   | 9c0ffc26c1 | ||
|   | 39b28a7e42 | ||
|   | 09799c6617 | ||
|   | 9fad2246ae | ||
|   | 585da56118 | ||
|   | cccb482cd9 | ||
|   | eb79c75266 | ||
|   | 19171122ca | ||
|   | a4665b1a14 | ||
|   | 829f9ac61f | ||
|   | 24b846328f | ||
|   | 96c43866b1 | ||
|   | 9043191927 | ||
|   | 6e6ed81c19 | ||
|   | 3597035f67 | ||
|   | 9f39a18fc5 | ||
|   | ab2de9dccd | ||
|   | d66c6cf55e | ||
|   | 4f24f7e5fc | ||
|   | 3cd0e86bdd | ||
|   | 4d230daf09 | ||
|   | 9dd642f4af | ||
|   | a9f9176ba5 | ||
|   | 637cce0f91 | ||
|   | 74b97dcd14 | ||
|   | 4e28a4d654 | ||
|   | 9d62d13f88 | ||
|   | eeca838778 | ||
|   | d6f0d2c64c | ||
|   | 44cfceba00 | ||
|   | 349fb7c297 | ||
|   | f9b5cdfeb1 | ||
|   | de8eb1f8ee | ||
|   | 0ff602be06 | ||
|   | 7246d0ede2 | ||
|   | 50468b6563 | ||
|   | 6793236642 | ||
|   | d8ccc7896f | ||
|   | defd9aed32 | ||
|   | 6ee1d4348d | ||
|   | 27dbd12d7b | ||
|   | 93fc5c5561 | ||
|   | b48d290064 | ||
|   | 6bdb3cf115 | ||
|   | 3b39026ba2 | ||
|   | 70ffb564ff | ||
|   | 4760d043d3 | ||
|   | 8405e75931 | ||
|   | 6c4a283b4c | ||
|   | 7c6b55e79e | ||
|   | d8c4b22b88 | ||
|   | bbd98e7b86 | ||
|   | 0536438317 | ||
|   | e2151a5fd7 | ||
|   | c84da3ce1b | ||
|   | bb50f65532 | ||
|   | 28752718c5 | ||
|   | 4c76791d4c | ||
|   | a66ae4ad55 | ||
|   | 7841e80496 | ||
|   | 27626d14b7 | ||
|   | f75e96cd3c | ||
|   | 9bc1521615 | ||
|   | f2158218be | ||
|   | 183190d089 | ||
|   | ebc3775f19 | ||
|   | 97d7e84a04 | ||
|   | 2b2b728b64 | ||
|   | 46fa843b0e | ||
|   | e7d336ab0e | ||
|   | 6e23b0af3b | ||
|   | 735c33bd9f | ||
|   | 47626a17d7 | ||
|   | ce86d3f230 | ||
|   | 31878239c3 | ||
|   | 1133a4ff9c | ||
|   | 5822443b20 | ||
|   | cf05167c55 | ||
|   | a9504f1495 | ||
|   | 3716c30264 | ||
|   | c1bf1ec718 | ||
|   | 8b220079d0 | ||
|   | 2df95970d9 | ||
|   | a4569974a1 | ||
|   | c9d3ab772c | ||
|   | 1a276a2ee5 | ||
|   | 4c4c720dc1 | ||
|   | ad707be01e | ||
|   | 19d1f97600 | ||
|   | 4f079affea | ||
|   | b4888103a6 | ||
|   | e2364b82ef | ||
|   | ba92645044 | ||
|   | 2eb8b09b1a | ||
|   | bca610ed50 | ||
|   | 53d6938b55 | ||
|   | 286160646b | ||
|   | 58068260a5 | ||
|   | 57e8ce0d42 | ||
|   | 4ed1e8b3e2 | ||
|   | 8181454af5 | ||
|   | aa482e6d4f | ||
|   | 0c9b2c6757 | ||
|   | bbfc435a5c | ||
|   | 7e53094044 | ||
|   | 565f002bc4 | ||
|   | 42fdd4f4d8 | ||
|   | 217aa2898e | ||
|   | 02e7c1bb2b | ||
|   | bb57a8b6f3 | ||
|   | 65d0f1a213 | ||
|   | 4344b7ba69 | ||
|   | b0072add05 | ||
|   | 4ea00e102b | ||
|   | ed99d12e8b | ||
|   | 0a2bb1b71c | ||
|   | 4bc8c70c75 | ||
|   | 9f2581318a | ||
|   | 48b9807c86 | ||
|   | 0a821d2341 | ||
|   | 78092a404f | ||
|   | d3df33ecdb | ||
|   | 1160744830 | ||
|   | e884fc784e | ||
|   | c16788f481 | ||
|   | a1790fb6a8 | ||
|   | cbce4fd39d | ||
|   | 93c0620151 | ||
|   | 2faf56947b | ||
|   | 53777b133b | ||
|   | 594a69317a | ||
|   | 3f9c375f1c | ||
|   | 544c8edd9e | ||
|   | 654bd15319 | ||
|   | b85171007e | ||
|   | f6ec33fa0c | ||
|   | 7d0ff87cbe | ||
|   | 8994e621f7 | ||
|   | d746591894 | ||
|   | 161c1088f9 | ||
|   | 07c0471902 | ||
|   | 5f4ee1b6e7 | ||
|   | aa3a4a48e4 | ||
|   | 0d27c9600f | ||
|   | 1986b20499 | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -43,7 +43,7 @@ POTFILES | ||||
| 50-metacity-desktop-key.xml | ||||
| 50-metacity-key.xml | ||||
| inlinepixbufs.h | ||||
| libmutter-private.pc | ||||
| libmutter.pc | ||||
| mutter | ||||
| mutter-theme-viewer | ||||
| mutter.desktop | ||||
|   | ||||
							
								
								
									
										36
									
								
								configure.in
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								configure.in
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ AC_PREREQ(2.50) | ||||
|  | ||||
| m4_define([mutter_major_version], [2]) | ||||
| m4_define([mutter_minor_version], [91]) | ||||
| m4_define([mutter_micro_version], [3]) | ||||
| m4_define([mutter_micro_version], [93]) | ||||
|  | ||||
| m4_define([mutter_version], | ||||
|           [mutter_major_version.mutter_minor_version.mutter_micro_version]) | ||||
| @@ -61,7 +61,7 @@ AC_CHECK_SIZEOF(__int64) | ||||
| ## byte order | ||||
| AC_C_BIGENDIAN | ||||
|  | ||||
| GTK_MIN_VERSION=2.90.7 | ||||
| GTK_MIN_VERSION=2.91.7 | ||||
| CANBERRA_GTK=libcanberra-gtk3 | ||||
| CANBERRA_GTK_VERSION=0.26 | ||||
|  | ||||
| @@ -96,11 +96,6 @@ AC_ARG_ENABLE(startup-notification, | ||||
|                  [disable mutter's startup notification support, for embedded/size-sensitive custom non-GNOME builds]),, | ||||
|   enable_startup_notification=auto) | ||||
|  | ||||
| AC_ARG_WITH(introspection, | ||||
|   AC_HELP_STRING([--without-introspection], | ||||
|                  [disable the use of GObject introspection]),, | ||||
|   with_introspection=auto) | ||||
|  | ||||
| AC_ARG_WITH(libcanberra, | ||||
|   AC_HELP_STRING([--without-libcanberra], | ||||
|                  [disable the use of libcanberra for playing sounds]),, | ||||
| @@ -214,24 +209,15 @@ else | ||||
|   AC_MSG_ERROR([no. Mutter requires Clutter version $CLUTTER_VERSION.]) | ||||
| fi | ||||
|  | ||||
| if test x$with_introspection != xno; then | ||||
|   PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.9.5, have_introspection=yes, have_introspection=no) | ||||
|   if test x$have_introspection=xyes; then | ||||
|     MUTTER_PC_MODULES="$MUTTER_PC_MODULES gobject-introspection-1.0" | ||||
| INTROSPECTION_VERSION=0.9.5 | ||||
| GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_VERSION]) | ||||
|  | ||||
| if test x$found_introspection != xno; then | ||||
|   AC_DEFINE(HAVE_INTROSPECTION, 1, [Define if GObject introspection is available]) | ||||
|     G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` | ||||
|     AC_SUBST(G_IR_SCANNER) | ||||
|     G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` | ||||
|     AC_SUBST(G_IR_COMPILER) | ||||
|     G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` | ||||
|     AC_SUBST(G_IR_GENERATE) | ||||
|     GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` | ||||
|     AC_SUBST(GIRDIR) | ||||
|     TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" | ||||
|     AC_SUBST(TYPELIBDIR) | ||||
|   MUTTER_PC_MODULES="$MUTTER_PC_MODULES gobject-introspection-1.0" | ||||
|   META_GIR=[Meta_]mutter_major_version[_]mutter_minor_version[_gir] | ||||
|   AC_SUBST(META_GIR) | ||||
| fi | ||||
| fi | ||||
| AM_CONDITIONAL(WITH_INTROSPECTION, test "$have_introspection" = "yes") | ||||
|  | ||||
| AC_MSG_CHECKING([Xcursor]) | ||||
| if $PKG_CONFIG xcursor; then | ||||
| @@ -524,7 +510,7 @@ doc/Makefile | ||||
| doc/man/Makefile | ||||
| src/Makefile | ||||
| src/wm-tester/Makefile | ||||
| src/libmutter-private.pc | ||||
| src/libmutter.pc | ||||
| src/mutter-plugins.pc | ||||
| src/tools/Makefile | ||||
| src/compositor/plugins/Makefile | ||||
| @@ -561,7 +547,7 @@ mutter-$VERSION | ||||
| 	Solaris Xinerama:         ${use_solaris_xinerama} | ||||
| 	Startup notification:     ${have_startup_notification} | ||||
| 	libcanberra:              ${have_libcanberra} | ||||
| 	Introspection:            ${have_introspection} | ||||
| 	Introspection:            ${found_introspection} | ||||
| 	Session management:       ${found_sm} | ||||
| 	Shape extension:          ${found_shape} | ||||
| 	Xsync:                    ${found_xsync} | ||||
|   | ||||
| @@ -22,6 +22,16 @@ This document has separate sections for each format version. You may | ||||
| want to read the document in reverse order, since the base features | ||||
| are discussed under version 1. | ||||
|  | ||||
| New Features in Theme Format Version 3.3 | ||||
| ======================================== | ||||
|  | ||||
| Add two additional button background functions - left_single_background and | ||||
| right_single_background - for button groups with just a single button. | ||||
|  | ||||
| There are now additional frame states to style left/right tiled windows | ||||
| differently ("tiled_left", "tiled_right", "tiled_left_and_shaded", | ||||
| "tiled_right_and_shaded"). | ||||
|  | ||||
| New Features in Theme Format Version 3.2 | ||||
| ======================================== | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								mutter.doap
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								mutter.doap
									
									
									
									
									
								
							| @@ -6,6 +6,16 @@ | ||||
|  | ||||
|   <name xml:lang="en">mutter</name> | ||||
|   <shortdesc xml:lang="en">Window and compositing manager based on Clutter</shortdesc> | ||||
|   <description>Mutter is a window and compositing manager that displays and | ||||
| manages your desktop via OpenGL. Mutter combines a sophisticated display engine | ||||
| using the Clutter toolkit with solid window-management logic inherited from the | ||||
| Metacity window manager. | ||||
|  | ||||
| While Mutter can be used stand-alone, it is primarily intended to be used as | ||||
| the display core of a larger system such as GNOME Shell. For this reason, | ||||
| Mutter is very extensible via plugins, which are used both to add fancy visual | ||||
| effects and to rework the window management behaviors to meet the needs of the | ||||
| environment.</description> | ||||
|   <!-- | ||||
|   <homepage rdf:resource="http://www.gnome.org/" /> | ||||
|   --> | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| # List of source files containing translatable strings. | ||||
| # Please keep this file sorted alphabetically. | ||||
| src/core/all-keybindings.h | ||||
| src/core/bell.c | ||||
| src/core/core.c | ||||
| src/core/delete.c | ||||
| @@ -7,6 +8,7 @@ src/core/display.c | ||||
| src/core/errors.c | ||||
| src/core/keybindings.c | ||||
| src/core/main.c | ||||
| src/core/mutter.c | ||||
| src/core/prefs.c | ||||
| src/core/screen.c | ||||
| src/core/session.c | ||||
| @@ -14,7 +16,6 @@ src/core/util.c | ||||
| src/core/window.c | ||||
| src/core/window-props.c | ||||
| src/core/xprops.c | ||||
| src/include/all-keybindings.h | ||||
| src/mutter.desktop.in | ||||
| src/mutter-wm.desktop.in | ||||
| src/mutter.schemas.in | ||||
|   | ||||
							
								
								
									
										1236
									
								
								po/en_GB.po
									
									
									
									
									
								
							
							
						
						
									
										1236
									
								
								po/en_GB.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1300
									
								
								po/zh_CN.po
									
									
									
									
									
								
							
							
						
						
									
										1300
									
								
								po/zh_CN.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										551
									
								
								po/zh_HK.po
									
									
									
									
									
								
							
							
						
						
									
										551
									
								
								po/zh_HK.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										553
									
								
								po/zh_TW.po
									
									
									
									
									
								
							
							
						
						
									
										553
									
								
								po/zh_TW.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										216
									
								
								src/Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										216
									
								
								src/Makefile.am
									
									
									
									
									
								
							| @@ -1,11 +1,30 @@ | ||||
| # Flag build for parallelism; see https://savannah.gnu.org/patch/?6905 | ||||
| .AUTOPARALLEL: | ||||
|  | ||||
| lib_LTLIBRARIES = libmutter-private.la | ||||
| lib_LTLIBRARIES = libmutter.la | ||||
|  | ||||
| SUBDIRS=wm-tester tools compositor/plugins | ||||
|  | ||||
| INCLUDES=@MUTTER_CFLAGS@ -I $(srcdir)/include -I$(srcdir)/compositor -DMUTTER_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUTTER_PKGDATADIR=\"$(pkgdatadir)\" -DMUTTER_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"mutter\" -DSN_API_NOT_YET_FROZEN=1 -DMUTTER_MAJOR_VERSION=$(MUTTER_MAJOR_VERSION) -DMUTTER_MINOR_VERSION=$(MUTTER_MINOR_VERSION) -DMUTTER_MICRO_VERSION=$(MUTTER_MICRO_VERSION) -DMUTTER_PLUGIN_API_VERSION=$(MUTTER_PLUGIN_API_VERSION) -DMUTTER_PKGLIBDIR=\"$(pkglibdir)\" -DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\" | ||||
| INCLUDES=								\ | ||||
| 	$(MUTTER_CFLAGS)						\ | ||||
| 	-I$(srcdir)							\ | ||||
| 	-I$(srcdir)/core						\ | ||||
| 	-I$(srcdir)/ui							\ | ||||
| 	-I$(srcdir)/compositor						\ | ||||
| 	-DMUTTER_LIBEXECDIR=\"$(libexecdir)\"				\ | ||||
| 	-DHOST_ALIAS=\"@HOST_ALIAS@\"					\ | ||||
| 	-DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"		\ | ||||
| 	-DMUTTER_PKGDATADIR=\"$(pkgdatadir)\"				\ | ||||
| 	-DMUTTER_DATADIR=\"$(datadir)\"					\ | ||||
| 	-DG_LOG_DOMAIN=\"mutter\"					\ | ||||
| 	-DSN_API_NOT_YET_FROZEN=1					\ | ||||
| 	-DMUTTER_MAJOR_VERSION=$(MUTTER_MAJOR_VERSION)			\ | ||||
| 	-DMUTTER_MINOR_VERSION=$(MUTTER_MINOR_VERSION)			\ | ||||
| 	-DMUTTER_MICRO_VERSION=$(MUTTER_MICRO_VERSION)			\ | ||||
| 	-DMUTTER_PLUGIN_API_VERSION=$(MUTTER_PLUGIN_API_VERSION)	\ | ||||
| 	-DMUTTER_PKGLIBDIR=\"$(pkglibdir)\"				\ | ||||
| 	-DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\"			\ | ||||
| 	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" | ||||
|  | ||||
| mutter_built_sources = \ | ||||
| 	mutter-marshal.h \ | ||||
| @@ -13,14 +32,14 @@ mutter_built_sources = \ | ||||
| 	mutter-enum-types.h \ | ||||
| 	mutter-enum-types.c | ||||
|  | ||||
| mutter_SOURCES= 				\ | ||||
| libmutter_la_SOURCES =				\ | ||||
| 	core/async-getprop.c			\ | ||||
| 	core/async-getprop.h			\ | ||||
| 	core/bell.c				\ | ||||
| 	core/bell.h				\ | ||||
| 	core/boxes.c				\ | ||||
| 	core/boxes-private.h			\ | ||||
| 	include/boxes.h				\ | ||||
| 	meta/boxes.h				\ | ||||
| 	compositor/cogl-utils.c			\ | ||||
| 	compositor/cogl-utils.h			\ | ||||
| 	compositor/compositor.c			\ | ||||
| @@ -46,36 +65,36 @@ mutter_SOURCES= 				\ | ||||
| 	compositor/meta-window-shape.h		\ | ||||
| 	compositor/region-utils.c		\ | ||||
| 	compositor/region-utils.h		\ | ||||
| 	include/compositor.h			\ | ||||
| 	include/meta-plugin.h			\ | ||||
| 	include/meta-shadow-factory.h		\ | ||||
| 	include/meta-window-actor.h		\ | ||||
| 	include/compositor-mutter.h 		\ | ||||
| 	meta/compositor.h			\ | ||||
| 	meta/meta-plugin.h			\ | ||||
| 	meta/meta-shadow-factory.h		\ | ||||
| 	meta/meta-window-actor.h		\ | ||||
| 	meta/compositor-mutter.h 		\ | ||||
| 	core/above-tab-keycode.c		\ | ||||
| 	core/constraints.c			\ | ||||
| 	core/constraints.h			\ | ||||
| 	core/core.c				\ | ||||
| 	core/delete.c				\ | ||||
| 	core/display.c				\ | ||||
| 	core/display-private.h			\ | ||||
| 	include/display.h			\ | ||||
| 	meta/display.h				\ | ||||
| 	ui/draw-workspace.c			\ | ||||
| 	ui/draw-workspace.h			\ | ||||
| 	core/edge-resistance.c			\ | ||||
| 	core/edge-resistance.h			\ | ||||
| 	core/errors.c				\ | ||||
| 	include/errors.h			\ | ||||
| 	meta/errors.h				\ | ||||
| 	core/eventqueue.c			\ | ||||
| 	core/eventqueue.h			\ | ||||
| 	core/frame.c				\ | ||||
| 	core/frame-private.h			\ | ||||
| 	include/frame.h				\ | ||||
| 	core/frame.h				\ | ||||
| 	ui/gradient.c				\ | ||||
| 	ui/gradient.h				\ | ||||
| 	meta/gradient.h				\ | ||||
| 	core/group-private.h			\ | ||||
| 	core/group-props.c			\ | ||||
| 	core/group-props.h			\ | ||||
| 	core/group.c				\ | ||||
| 	include/group.h				\ | ||||
| 	meta/group.h				\ | ||||
| 	core/iconcache.c			\ | ||||
| 	core/iconcache.h			\ | ||||
| 	core/keybindings.c			\ | ||||
| @@ -85,11 +104,11 @@ mutter_SOURCES= 				\ | ||||
| 	core/place.c				\ | ||||
| 	core/place.h				\ | ||||
| 	core/prefs.c				\ | ||||
| 	include/prefs.h				\ | ||||
| 	meta/prefs.h				\ | ||||
| 	core/screen.c				\ | ||||
| 	core/screen-private.h			\ | ||||
| 	include/screen.h			\ | ||||
| 	include/types.h                         \ | ||||
| 	meta/screen.h				\ | ||||
| 	meta/types.h				\ | ||||
| 	core/session.c				\ | ||||
| 	core/session.h				\ | ||||
| 	core/stack.c				\ | ||||
| @@ -97,19 +116,19 @@ mutter_SOURCES= 				\ | ||||
| 	core/stack-tracker.c			\ | ||||
| 	core/stack-tracker.h			\ | ||||
| 	core/util.c				\ | ||||
| 	include/util.h				\ | ||||
| 	meta/util.h				\ | ||||
| 	core/window-props.c			\ | ||||
| 	core/window-props.h			\ | ||||
| 	core/window.c				\ | ||||
| 	core/window-private.h			\ | ||||
| 	include/window.h			\ | ||||
| 	meta/window.h				\ | ||||
| 	core/workspace.c			\ | ||||
| 	core/workspace-private.h		\ | ||||
| 	core/xprops.c				\ | ||||
| 	include/xprops.h			\ | ||||
| 	include/common.h			\ | ||||
| 	include/core.h				\ | ||||
| 	include/ui.h				\ | ||||
| 	core/xprops.h				\ | ||||
| 	meta/common.h				\ | ||||
| 	core/core.h				\ | ||||
| 	ui/ui.h					\ | ||||
| 	inlinepixbufs.h				\ | ||||
| 	ui/fixedtip.c				\ | ||||
| 	ui/fixedtip.h				\ | ||||
| @@ -120,71 +139,55 @@ mutter_SOURCES= 				\ | ||||
| 	ui/metaaccellabel.c			\ | ||||
| 	ui/metaaccellabel.h			\ | ||||
| 	ui/resizepopup.c			\ | ||||
| 	include/resizepopup.h			\ | ||||
| 	ui/resizepopup.h			\ | ||||
| 	ui/tabpopup.c				\ | ||||
| 	include/tabpopup.h				\ | ||||
| 	ui/tabpopup.h				\ | ||||
| 	ui/tile-preview.c			\ | ||||
| 	include/tile-preview.h			\ | ||||
| 	ui/tile-preview.h			\ | ||||
| 	ui/theme-parser.c			\ | ||||
| 	ui/theme.c				\ | ||||
| 	ui/theme.h				\ | ||||
| 	meta/theme.h				\ | ||||
| 	ui/theme-private.h			\ | ||||
| 	ui/ui.c					\ | ||||
| 	include/all-keybindings.h               \ | ||||
| 	core/all-keybindings.h			\ | ||||
| 	meta/preview-widget.h			\ | ||||
| 	ui/preview-widget.c			\ | ||||
| 	$(mutter_built_sources) | ||||
|  | ||||
| # by setting libmutter_private_la_CFLAGS, the files shared with | ||||
| # mutter proper will be compiled with different names. | ||||
| libmutter_private_la_CFLAGS = | ||||
| libmutter_private_la_SOURCES=			\ | ||||
| 	core/boxes.c				\ | ||||
| 	include/boxes.h				\ | ||||
| 	ui/gradient.c				\ | ||||
| 	ui/gradient.h				\ | ||||
| 	core/util.c				\ | ||||
| 	include/util.h				\ | ||||
| 	include/common.h			\ | ||||
| 	ui/preview-widget.c			\ | ||||
| 	ui/preview-widget.h			\ | ||||
| 	ui/theme-parser.c			\ | ||||
| 	ui/theme.c				\ | ||||
| 	ui/theme.h | ||||
|  | ||||
| libmutter_private_la_LDFLAGS = -no-undefined | ||||
| libmutter_private_la_LIBADD  = @MUTTER_LIBS@ | ||||
| libmutter_la_LDFLAGS = -no-undefined | ||||
| libmutter_la_LIBADD  = $(MUTTER_LIBS) | ||||
|  | ||||
| # Headers installed for plugins; introspected information will | ||||
| # be extracted into Mutter-<version>.gir | ||||
| libmutterinclude_base_headers =		\ | ||||
| 	include/boxes.h				\ | ||||
| 	ui/gradient.h				\ | ||||
| 	include/main.h				\ | ||||
| 	include/util.h				\ | ||||
| 	include/common.h			\ | ||||
| 	ui/theme.h				\ | ||||
| 	include/prefs.h				\ | ||||
| 	include/window.h			\ | ||||
| 	include/workspace.h			\ | ||||
| 	include/compositor.h			\ | ||||
| 	include/compositor-mutter.h		\ | ||||
| 	include/types.h				\ | ||||
| 	include/errors.h			\ | ||||
| 	include/screen.h			\ | ||||
| 	include/display.h			\ | ||||
| 	include/group.h				\ | ||||
| 	include/keybindings.h			\ | ||||
| 	include/meta-plugin.h			\ | ||||
| 	include/meta-shadow-factory.h		\ | ||||
| 	include/meta-window-actor.h | ||||
| 	meta/boxes.h				\ | ||||
| 	meta/common.h				\ | ||||
| 	meta/compositor-mutter.h		\ | ||||
| 	meta/compositor.h			\ | ||||
| 	meta/display.h				\ | ||||
| 	meta/errors.h				\ | ||||
| 	meta/gradient.h				\ | ||||
| 	meta/group.h				\ | ||||
| 	meta/keybindings.h			\ | ||||
| 	meta/main.h				\ | ||||
| 	meta/meta-plugin.h			\ | ||||
| 	meta/meta-shadow-factory.h		\ | ||||
| 	meta/meta-window-actor.h		\ | ||||
| 	meta/prefs.h				\ | ||||
| 	meta/screen.h				\ | ||||
| 	meta/theme.h				\ | ||||
| 	meta/types.h				\ | ||||
| 	meta/util.h				\ | ||||
| 	meta/window.h				\ | ||||
| 	meta/workspace.h | ||||
|  | ||||
| # Excluded from scanning for introspection but installed | ||||
| # preview-widget.h: only part of libmutter-private | ||||
| # atomnames.h: macros cause problems for scanning process | ||||
| libmutterinclude_extra_headers =		\ | ||||
| 	ui/preview-widget.h			\ | ||||
| 	include/atomnames.h | ||||
| 	meta/preview-widget.h			\ | ||||
| 	meta/atomnames.h | ||||
|  | ||||
| libmutterincludedir = $(includedir)/mutter/mutter-private | ||||
| libmutterincludedir = $(includedir)/mutter/meta | ||||
|  | ||||
| libmutterinclude_HEADERS =			\ | ||||
| 	$(libmutterinclude_base_headers)	\ | ||||
| @@ -195,9 +198,14 @@ mutter_theme_viewer_SOURCES=  \ | ||||
|  | ||||
| bin_PROGRAMS=mutter mutter-theme-viewer | ||||
|  | ||||
| mutter_SOURCES = core/mutter.c | ||||
| mutter_LDADD = $(MUTTER_LIBS) libmutter.la | ||||
|  | ||||
| if HAVE_INTROSPECTION | ||||
| include $(INTROSPECTION_MAKEFILE) | ||||
|  | ||||
| api_version = $(MUTTER_MAJOR_VERSION).$(MUTTER_MINOR_VERSION) | ||||
|  | ||||
| if WITH_INTROSPECTION | ||||
| # These files are in package-private directories, even though they may be used | ||||
| # by plugins.  If you're writing a plugin, use g-ir-compiler --add-include-path | ||||
| # and g-ir-compiler --includedir. | ||||
| @@ -207,50 +215,32 @@ gir_DATA = Meta-$(api_version).gir | ||||
| typelibdir = $(pkglibdir) | ||||
| typelib_DATA = Meta-$(api_version).typelib | ||||
|  | ||||
| # We need to strip out the attribute that would point back to libmutter-introspect | ||||
| # so that libgirepository looks for symbols in the executable instead | ||||
| Meta-$(api_version).gir: $(G_IR_SCANNER) mutter $(libmutterinclude_HEADERS) $(mutter_SOURCES) Makefile | ||||
| 	$(AM_V_GEN) pwd=`pwd` ;				\ | ||||
|         cd $(srcdir) &&					\ | ||||
| 	$(G_IR_SCANNER)					\ | ||||
| 		--namespace=Meta			\ | ||||
| 		--nsversion=$(api_version)		\ | ||||
| 		--warn-all				\ | ||||
| 		--warn-error				\ | ||||
| 		--include=GObject-2.0			\ | ||||
| 		--include=Gdk-3.0			\ | ||||
| 		--include=Gtk-3.0			\ | ||||
| 		--include=Clutter-1.0			\ | ||||
| 		--pkg=clutter-1.0			\ | ||||
| 		--pkg=gtk+-3.0				\ | ||||
| 		--include=xlib-2.0			\ | ||||
| 		--include=xfixes-4.0			\ | ||||
| 		--program=$$pwd/mutter			\ | ||||
| 		mutter-enum-types.h			\ | ||||
| 		$(filter %.c,$(mutter_SOURCES))		\ | ||||
| 		$(libmutterinclude_base_headers)	\ | ||||
| 		$(INCLUDES)				\ | ||||
| 		-o $$pwd/$@ | ||||
| INTROSPECTION_GIRS = Meta-$(api_version).gir | ||||
|  | ||||
| Meta-$(api_version).gir: libmutter.la | ||||
| @META_GIR@_INCLUDES = GObject-2.0 Gdk-3.0 Gtk-3.0 Clutter-1.0 xlib-2.0 xfixes-4.0 | ||||
| @META_GIR@_PACKAGES = clutter-1.0 gtk+-3.0 | ||||
| @META_GIR@_CFLAGS = $(INCLUDES) | ||||
| @META_GIR@_LIBS = libmutter.la | ||||
| @META_GIR@_FILES =				\ | ||||
| 	mutter-enum-types.h			\ | ||||
| 	$(libmutterinclude_base_headers)	\ | ||||
| 	$(filter %.c,$(libmutter_la_SOURCES)) | ||||
| @META_GIR@_SCANNERFLAGS = --warn-all --warn-error | ||||
|  | ||||
| Meta-$(api_version).typelib: $(G_IR_COMPILER) Meta-$(api_version).gir | ||||
| 	$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) Meta-$(api_version).gir -o $@ | ||||
| endif | ||||
|  | ||||
| EFENCE= | ||||
| mutter_LDADD=@MUTTER_LIBS@ $(EFENCE) | ||||
| mutter_LDFLAGS=-export-dynamic | ||||
| mutter_theme_viewer_LDADD= $(MUTTER_LIBS) libmutter.la | ||||
|  | ||||
| mutter_theme_viewer_LDADD= @MUTTER_LIBS@ libmutter-private.la | ||||
|  | ||||
| testboxes_SOURCES=include/util.h core/util.c include/boxes.h core/boxes.c core/testboxes.c | ||||
| testgradient_SOURCES=ui/gradient.h ui/gradient.c ui/testgradient.c | ||||
| testasyncgetprop_SOURCES=core/async-getprop.h core/async-getprop.c core/testasyncgetprop.c | ||||
| testboxes_SOURCES = core/testboxes.c | ||||
| testgradient_SOURCES = ui/testgradient.c | ||||
| testasyncgetprop_SOURCES = core/testasyncgetprop.c | ||||
|  | ||||
| noinst_PROGRAMS=testboxes testgradient testasyncgetprop | ||||
|  | ||||
| testboxes_LDADD= @MUTTER_LIBS@ | ||||
| testgradient_LDADD= @MUTTER_LIBS@ | ||||
| testasyncgetprop_LDADD= @MUTTER_LIBS@ | ||||
| testboxes_LDADD = $(MUTTER_LIBS) libmutter.la | ||||
| testgradient_LDADD = $(MUTTER_LIBS) libmutter.la | ||||
| testasyncgetprop_LDADD = $(MUTTER_LIBS) libmutter.la | ||||
|  | ||||
| @INTLTOOL_DESKTOP_RULE@ | ||||
|  | ||||
| @@ -264,7 +254,7 @@ wmproperties_in_files=mutter-wm.desktop.in | ||||
| wmproperties_files=$(wmproperties_in_files:.desktop.in=.desktop) | ||||
| wmproperties_DATA = $(wmproperties_files) | ||||
|  | ||||
| schemadir   = @GCONF_SCHEMA_FILE_DIR@ | ||||
| schemadir   = $(GCONF_SCHEMA_FILE_DIR) | ||||
| schema_in_files = mutter.schemas.in | ||||
| schema_DATA = $(schema_in_files:.schemas.in=.schemas) | ||||
|  | ||||
| @@ -299,7 +289,7 @@ inlinepixbufs.h: $(IMAGES) | ||||
|  | ||||
| pkgconfigdir = $(libdir)/pkgconfig | ||||
|  | ||||
| pkgconfig_DATA = libmutter-private.pc mutter-plugins.pc | ||||
| pkgconfig_DATA = libmutter.pc mutter-plugins.pc | ||||
|  | ||||
| EXTRA_DIST=$(desktopfiles_files) 	\ | ||||
| 	$(wmproperties_files)		\ | ||||
| @@ -307,7 +297,7 @@ EXTRA_DIST=$(desktopfiles_files) 	\ | ||||
| 	$(desktopfiles_in_files)	\ | ||||
| 	$(wmproperties_in_files)	\ | ||||
| 	$(schema_in_files)		\ | ||||
| 	libmutter-private.pc.in	\ | ||||
| 	libmutter.pc.in \ | ||||
| 	mutter-plugins.pc.in  \ | ||||
| 	mutter-enum-types.h.in \ | ||||
| 	mutter-enum-types.c.in \ | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|  | ||||
| #include <X11/extensions/Xfixes.h> | ||||
|  | ||||
| #include "compositor.h" | ||||
| #include "display.h" | ||||
| #include <meta/compositor.h> | ||||
| #include <meta/display.h> | ||||
| #include "meta-plugin-manager.h" | ||||
| #include <clutter/clutter.h> | ||||
|  | ||||
|   | ||||
| @@ -4,19 +4,19 @@ | ||||
|  | ||||
| #include <clutter/x11/clutter-x11.h> | ||||
|  | ||||
| #include "screen.h" | ||||
| #include "errors.h" | ||||
| #include "window.h" | ||||
| #include <meta/screen.h> | ||||
| #include <meta/errors.h> | ||||
| #include <meta/window.h> | ||||
| #include "compositor-private.h" | ||||
| #include "compositor-mutter.h" | ||||
| #include <meta/compositor-mutter.h> | ||||
| #include "xprops.h" | ||||
| #include "prefs.h" | ||||
| #include "meta-shadow-factory.h" | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/meta-shadow-factory.h> | ||||
| #include "meta-window-actor-private.h" | ||||
| #include "meta-window-group.h" | ||||
| #include "meta-background-actor.h" | ||||
| #include "../core/window-private.h" /* to check window->hidden */ | ||||
| #include "../core/display-private.h" /* for meta_display_lookup_x_window() */ | ||||
| #include "window-private.h" /* to check window->hidden */ | ||||
| #include "display-private.h" /* for meta_display_lookup_x_window() */ | ||||
| #include <X11/extensions/shape.h> | ||||
| #include <X11/extensions/Xcomposite.h> | ||||
|  | ||||
| @@ -550,18 +550,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor, | ||||
|  | ||||
|   info->plugin_mgr = | ||||
|     meta_plugin_manager_get (screen); | ||||
|  | ||||
|   if (info->plugin_mgr != meta_plugin_manager_get_default ()) | ||||
|     { | ||||
|       /* The default plugin manager has been initialized during | ||||
|        * global preferences load. | ||||
|        */ | ||||
|       if (!meta_plugin_manager_load (info->plugin_mgr)) | ||||
|         g_critical ("failed to load plugins"); | ||||
|     } | ||||
|  | ||||
|   if (!meta_plugin_manager_initialize (info->plugin_mgr)) | ||||
|     g_critical ("failed to initialize plugins"); | ||||
|   meta_plugin_manager_initialize (info->plugin_mgr); | ||||
|  | ||||
|   /* | ||||
|    * Delay the creation of the overlay window as long as we can, to avoid | ||||
| @@ -974,7 +963,10 @@ meta_compositor_sync_stack (MetaCompositor  *compositor, | ||||
|  | ||||
|           if (old_window->hidden && | ||||
|               !meta_window_actor_effect_in_progress (old_actor)) | ||||
|             { | ||||
|               old_stack = g_list_delete_link (old_stack, old_stack); | ||||
|               old_actor = NULL; | ||||
|             } | ||||
|           else | ||||
|             break; | ||||
|         } | ||||
| @@ -1195,3 +1187,47 @@ meta_get_overlay_window (MetaScreen *screen) | ||||
|  | ||||
|   return info->output; | ||||
| } | ||||
|  | ||||
| #define FLASH_TIME_MS 50 | ||||
|  | ||||
| static void | ||||
| flash_out_completed (ClutterAnimation *animation, | ||||
|                      ClutterActor     *flash) | ||||
| { | ||||
|   clutter_actor_destroy (flash); | ||||
| } | ||||
|  | ||||
| static void | ||||
| flash_in_completed (ClutterAnimation *animation, | ||||
|                     ClutterActor     *flash) | ||||
| { | ||||
|   clutter_actor_animate (flash, CLUTTER_EASE_IN_QUAD, | ||||
|                          FLASH_TIME_MS, | ||||
|                          "opacity", 0, | ||||
|                          "signal-after::completed", flash_out_completed, flash, | ||||
|                          NULL); | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_compositor_flash_screen (MetaCompositor *compositor, | ||||
|                               MetaScreen     *screen) | ||||
| { | ||||
|   ClutterActor *stage; | ||||
|   ClutterActor *flash; | ||||
|   ClutterColor black = { 0, 0, 0, 255 }; | ||||
|   gfloat width, height; | ||||
|  | ||||
|   stage = meta_get_stage_for_screen (screen); | ||||
|   clutter_actor_get_size (stage, &width, &height); | ||||
|  | ||||
|   flash = clutter_rectangle_new_with_color (&black); | ||||
|   clutter_actor_set_size (flash, width, height); | ||||
|   clutter_actor_set_opacity (flash, 0); | ||||
|   clutter_container_add_actor (CLUTTER_CONTAINER (stage), flash); | ||||
|  | ||||
|   clutter_actor_animate (flash, CLUTTER_EASE_OUT_QUAD, | ||||
|                          FLASH_TIME_MS, | ||||
|                          "opacity", 192, | ||||
|                          "signal-after::completed", flash_in_completed, flash, | ||||
|                          NULL); | ||||
| } | ||||
|   | ||||
| @@ -32,7 +32,7 @@ | ||||
|  | ||||
| #include "cogl-utils.h" | ||||
| #include "compositor-private.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "meta-background-actor.h" | ||||
|  | ||||
| struct _MetaBackgroundActorClass | ||||
| @@ -190,10 +190,14 @@ static void | ||||
| meta_background_actor_paint (ClutterActor *actor) | ||||
| { | ||||
|   MetaBackgroundActor *self = META_BACKGROUND_ACTOR (actor); | ||||
|   guchar opacity = clutter_actor_get_paint_opacity (actor); | ||||
|   int width, height; | ||||
|  | ||||
|   meta_screen_get_size (self->screen, &width, &height); | ||||
|  | ||||
|   cogl_material_set_color4ub (self->material, | ||||
|                               opacity, opacity, opacity, opacity); | ||||
|  | ||||
|   cogl_set_source (self->material); | ||||
|  | ||||
|   if (self->visible_region) | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
|  | ||||
| #include <clutter/clutter.h> | ||||
|  | ||||
| #include "screen.h" | ||||
| #include <meta/screen.h> | ||||
|  | ||||
| /** | ||||
|  * MetaBackgroundActor: | ||||
|   | ||||
| @@ -21,7 +21,7 @@ | ||||
|  * 02111-1307, USA. | ||||
|  */ | ||||
|  | ||||
| #include "meta-plugin.h" | ||||
| #include <meta/meta-plugin.h> | ||||
| #include "meta-module.h" | ||||
|  | ||||
| #include <gmodule.h> | ||||
|   | ||||
| @@ -24,20 +24,18 @@ | ||||
| #include "config.h" | ||||
| #include "compositor-private.h" | ||||
| #include "meta-plugin-manager.h" | ||||
| #include "prefs.h" | ||||
| #include "errors.h" | ||||
| #include "workspace.h" | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/errors.h> | ||||
| #include <meta/workspace.h> | ||||
| #include "meta-module.h" | ||||
| #include "../core/window-private.h" | ||||
| #include "window-private.h" | ||||
|  | ||||
| #include <string.h> | ||||
| #include <stdlib.h> | ||||
|  | ||||
| #include <clutter/x11/clutter-x11.h> | ||||
|  | ||||
| /* | ||||
|  * There is only one instace of each module per the process. | ||||
|  */ | ||||
| static GHashTable *plugin_modules = NULL; | ||||
| static GSList *plugin_types; | ||||
|  | ||||
| /* | ||||
|  * We have one "default plugin manager" that acts for the first screen, | ||||
| @@ -45,270 +43,79 @@ static GHashTable *plugin_modules = NULL; | ||||
|  * plugin managers for each screen. (This is ugly. Probably we should | ||||
|  * have one plugin manager and only make the plugins per-screen.) | ||||
|  */ | ||||
|  | ||||
| static MetaPluginManager *default_plugin_manager; | ||||
|  | ||||
| static gboolean meta_plugin_manager_reload (MetaPluginManager *plugin_mgr); | ||||
|  | ||||
| struct MetaPluginManager | ||||
| { | ||||
|   MetaScreen   *screen; | ||||
|  | ||||
|   GList /* MetaPlugin */ *plugins;  /* TODO -- maybe use hash table */ | ||||
|   GList                        *unload;  /* Plugins that are disabled and pending unload */ | ||||
|  | ||||
|   guint         idle_unload_id; | ||||
| }; | ||||
|  | ||||
| /* | ||||
|  * Checks that the plugin is compatible with the WM and sets up the plugin | ||||
|  * struct. | ||||
|  * Loads the given plugin. | ||||
|  */ | ||||
| static MetaPlugin * | ||||
| meta_plugin_load (MetaPluginManager *mgr, | ||||
|                   MetaModule        *module, | ||||
|                   const gchar       *params) | ||||
| { | ||||
|   MetaPlugin *plugin = NULL; | ||||
|   GType         plugin_type = meta_module_get_plugin_type (module); | ||||
|  | ||||
|   if (!plugin_type) | ||||
|     { | ||||
|       g_warning ("Plugin type not registered !!!"); | ||||
|       return NULL; | ||||
|     } | ||||
|  | ||||
|   plugin = g_object_new (plugin_type, | ||||
|                          "params", params, | ||||
|                          NULL); | ||||
|  | ||||
|   return plugin; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Attempst to unload a plugin; returns FALSE if plugin cannot be unloaded at | ||||
|  * present (e.g., and effect is in progress) and should be scheduled for | ||||
|  * removal later. | ||||
|  */ | ||||
| static gboolean | ||||
| meta_plugin_unload (MetaPlugin *plugin) | ||||
| { | ||||
|   if (meta_plugin_running (plugin)) | ||||
|     { | ||||
|       g_object_set (plugin, "disabled", TRUE, NULL); | ||||
|       return FALSE; | ||||
|     } | ||||
|  | ||||
|   g_object_unref (plugin); | ||||
|  | ||||
|   return TRUE; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Iddle callback to remove plugins that could not be removed directly and are | ||||
|  * pending for removal. | ||||
|  */ | ||||
| static gboolean | ||||
| meta_plugin_manager_idle_unload (MetaPluginManager *plugin_mgr) | ||||
| { | ||||
|   GList *l = plugin_mgr->unload; | ||||
|   gboolean dont_remove = TRUE; | ||||
|  | ||||
|   while (l) | ||||
|     { | ||||
|       MetaPlugin *plugin = l->data; | ||||
|  | ||||
|       if (meta_plugin_unload (plugin)) | ||||
|         { | ||||
|           /* Remove from list */ | ||||
|           GList *p = l->prev; | ||||
|           GList *n = l->next; | ||||
|  | ||||
|           if (!p) | ||||
|             plugin_mgr->unload = n; | ||||
|           else | ||||
|             p->next = n; | ||||
|  | ||||
|           if (n) | ||||
|             n->prev = p; | ||||
|  | ||||
|           g_list_free_1 (l); | ||||
|  | ||||
|           l = n; | ||||
|         } | ||||
|       else | ||||
|         l = l->next; | ||||
|     } | ||||
|  | ||||
|   if (!plugin_mgr->unload) | ||||
|     { | ||||
|       /* If no more unloads are pending, remove the handler as well */ | ||||
|       dont_remove = FALSE; | ||||
|       plugin_mgr->idle_unload_id = 0; | ||||
|     } | ||||
|  | ||||
|   return dont_remove; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Unloads all plugins | ||||
|  */ | ||||
| static void | ||||
| meta_plugin_manager_unload (MetaPluginManager *plugin_mgr) | ||||
| { | ||||
|   GList *plugins = plugin_mgr->plugins; | ||||
|  | ||||
|   while (plugins) | ||||
|     { | ||||
|       MetaPlugin *plugin = plugins->data; | ||||
|  | ||||
|       /* If the plugin could not be removed, move it to the unload list */ | ||||
|       if (!meta_plugin_unload (plugin)) | ||||
|         { | ||||
|           plugin_mgr->unload = g_list_prepend (plugin_mgr->unload, plugin); | ||||
|  | ||||
|           if (!plugin_mgr->idle_unload_id) | ||||
|             { | ||||
|               plugin_mgr->idle_unload_id = g_idle_add ((GSourceFunc) | ||||
|                             meta_plugin_manager_idle_unload, | ||||
|                             plugin_mgr); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|       plugins = plugins->next; | ||||
|     } | ||||
|  | ||||
|   g_list_free (plugin_mgr->plugins); | ||||
|   plugin_mgr->plugins = NULL; | ||||
| } | ||||
|  | ||||
| static void | ||||
| prefs_changed_callback (MetaPreference pref, | ||||
|                         void          *data) | ||||
| { | ||||
|   MetaPluginManager *plugin_mgr = data; | ||||
|  | ||||
|   if (pref == META_PREF_CLUTTER_PLUGINS) | ||||
|     { | ||||
|       meta_plugin_manager_reload (plugin_mgr); | ||||
|     } | ||||
| } | ||||
|  | ||||
| static MetaModule * | ||||
| meta_plugin_manager_get_module (const gchar *path) | ||||
| { | ||||
|   MetaModule *module = g_hash_table_lookup (plugin_modules, path); | ||||
|  | ||||
|   if (!module && | ||||
|       (module = g_object_new (META_TYPE_MODULE, "path", path, NULL))) | ||||
|     { | ||||
|       g_hash_table_insert (plugin_modules, g_strdup (path), module); | ||||
|     } | ||||
|  | ||||
|   return module; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Loads all plugins listed in gconf registry. | ||||
|  */ | ||||
| gboolean | ||||
| meta_plugin_manager_load (MetaPluginManager *plugin_mgr) | ||||
| void | ||||
| meta_plugin_manager_load (MetaPluginManager *plugin_mgr, | ||||
|                           const gchar       *plugin_name) | ||||
| { | ||||
|   const gchar *dpath = MUTTER_PLUGIN_DIR "/"; | ||||
|   GSList      *plugins, *fallback = NULL; | ||||
|  | ||||
|   plugins = meta_prefs_get_clutter_plugins (); | ||||
|  | ||||
|   if (!plugins) | ||||
|     { | ||||
|       /* | ||||
|        * If no plugins are specified, try to load the default plugin. | ||||
|        */ | ||||
|       fallback = g_slist_append (fallback, "default"); | ||||
|       plugins = fallback; | ||||
|     } | ||||
|  | ||||
|   while (plugins) | ||||
|     { | ||||
|       gchar   *plugin_string; | ||||
|       gchar   *params; | ||||
|  | ||||
|       plugin_string = g_strdup (plugins->data); | ||||
|  | ||||
|       if (plugin_string) | ||||
|         { | ||||
|           MetaModule *module; | ||||
|   gchar       *path; | ||||
|   MetaModule  *module; | ||||
|   GType        plugin_type; | ||||
|  | ||||
|           params = strchr (plugin_string, ':'); | ||||
|   if (g_path_is_absolute (plugin_name)) | ||||
|     path = g_strdup (plugin_name); | ||||
|   else | ||||
|     path = g_strconcat (dpath, plugin_name, ".so", NULL); | ||||
|  | ||||
|           if (params) | ||||
|   module = g_object_new (META_TYPE_MODULE, "path", path, NULL); | ||||
|   if (!module || !g_type_module_use (G_TYPE_MODULE (module))) | ||||
|     { | ||||
|               *params = 0; | ||||
|               ++params; | ||||
|       /* This is fatal under the assumption that a monitoring | ||||
|        * process like gnome-session will take over and handle | ||||
|        * our untimely exit. | ||||
|        */ | ||||
|       g_printerr ("Unable to load plugin module [%s]: %s", | ||||
|                   path, g_module_error()); | ||||
|       exit (1); | ||||
|     } | ||||
|  | ||||
|           if (g_path_is_absolute (plugin_string)) | ||||
|             path = g_strdup (plugin_string); | ||||
|           else | ||||
|             path = g_strconcat (dpath, plugin_string, ".so", NULL); | ||||
|  | ||||
|           module = meta_plugin_manager_get_module (path); | ||||
|  | ||||
|           if (module) | ||||
|             { | ||||
|               gboolean      use_succeeded; | ||||
|  | ||||
|               /* | ||||
|                * This dlopens the module and registers the plugin type with the | ||||
|                * GType system, if the module is not already loaded.  When we | ||||
|                * create a plugin, the type system also calls g_type_module_use() | ||||
|                * to guarantee the module will not be unloaded during the plugin | ||||
|                * life time. Consequently we can unuse() the module again. | ||||
|                */ | ||||
|               use_succeeded = g_type_module_use (G_TYPE_MODULE (module)); | ||||
|  | ||||
|               if (use_succeeded) | ||||
|                 { | ||||
|                   MetaPlugin *plugin = meta_plugin_load (plugin_mgr, module, params); | ||||
|  | ||||
|                   if (plugin) | ||||
|                     plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin); | ||||
|                   else | ||||
|                     g_warning ("Plugin load for [%s] failed", path); | ||||
|   plugin_type = meta_module_get_plugin_type (module); | ||||
|   meta_plugin_manager_register (plugin_mgr, plugin_type); | ||||
|  | ||||
|   g_type_module_unuse (G_TYPE_MODULE (module)); | ||||
|                 } | ||||
|             } | ||||
|           else | ||||
|             g_warning ("Unable to load plugin module [%s]: %s", | ||||
|                        path, g_module_error()); | ||||
|  | ||||
|   g_free (path); | ||||
|           g_free (plugin_string); | ||||
| } | ||||
|  | ||||
|       plugins = plugins->next; | ||||
|     } | ||||
|  | ||||
|  | ||||
|   if (fallback) | ||||
|     g_slist_free (fallback); | ||||
|  | ||||
|   if (plugin_mgr->plugins != NULL) | ||||
| /* | ||||
|  * Registers the given plugin type | ||||
|  */ | ||||
| void | ||||
| meta_plugin_manager_register (MetaPluginManager *plugin_mgr, | ||||
|                               GType              plugin_type) | ||||
| { | ||||
|       meta_prefs_add_listener (prefs_changed_callback, plugin_mgr); | ||||
|       return TRUE; | ||||
|   MetaPlugin  *plugin; | ||||
|  | ||||
|   plugin_types = g_slist_prepend (plugin_types, GSIZE_TO_POINTER (plugin_type)); | ||||
|  | ||||
|   plugin = g_object_new (plugin_type, NULL); | ||||
|   plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin); | ||||
| } | ||||
|  | ||||
|   return FALSE; | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| void | ||||
| meta_plugin_manager_initialize (MetaPluginManager *plugin_mgr) | ||||
| { | ||||
|   GList *iter; | ||||
|  | ||||
|   if (!plugin_mgr->plugins) | ||||
|     { | ||||
|       /* | ||||
|        * If no plugins are specified, load the default plugin. | ||||
|        */ | ||||
|       meta_plugin_manager_load (plugin_mgr, "default"); | ||||
|     } | ||||
|  | ||||
|   for (iter = plugin_mgr->plugins; iter; iter = iter->next) | ||||
|     { | ||||
|       MetaPlugin *plugin = (MetaPlugin*) iter->data; | ||||
| @@ -321,26 +128,6 @@ meta_plugin_manager_initialize (MetaPluginManager *plugin_mgr) | ||||
|       if (klass->start) | ||||
|         klass->start (plugin); | ||||
|     } | ||||
|  | ||||
|   return TRUE; | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * Reloads all plugins | ||||
|  */ | ||||
| static gboolean | ||||
| meta_plugin_manager_reload (MetaPluginManager *plugin_mgr) | ||||
| { | ||||
|   /* TODO -- brute force; should we build a list of plugins to load and list of | ||||
|    * plugins to unload? We are probably not going to have large numbers of | ||||
|    * plugins loaded at the same time, so it might not be worth it. | ||||
|    */ | ||||
|  | ||||
|   /* Prevent stale grabs on unloaded plugins */ | ||||
|   meta_check_end_modal (plugin_mgr->screen); | ||||
|  | ||||
|   meta_plugin_manager_unload (plugin_mgr); | ||||
|   return meta_plugin_manager_load (plugin_mgr); | ||||
| } | ||||
|  | ||||
| static MetaPluginManager * | ||||
| @@ -348,14 +135,7 @@ meta_plugin_manager_new (MetaScreen *screen) | ||||
| { | ||||
|   MetaPluginManager *plugin_mgr; | ||||
|  | ||||
|   if (!plugin_modules) | ||||
|     { | ||||
|       plugin_modules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, | ||||
|                                               NULL); | ||||
|     } | ||||
|  | ||||
|   plugin_mgr = g_new0 (MetaPluginManager, 1); | ||||
|  | ||||
|   plugin_mgr->screen = screen; | ||||
|  | ||||
|   if (screen) | ||||
| @@ -397,7 +177,20 @@ meta_plugin_manager_get (MetaScreen *screen) | ||||
|     } | ||||
|   else | ||||
|     { | ||||
|       return meta_plugin_manager_new (screen); | ||||
|       GSList *iter; | ||||
|       GType plugin_type; | ||||
|       MetaPlugin *plugin; | ||||
|  | ||||
|       plugin_mgr = meta_plugin_manager_new (screen); | ||||
|  | ||||
|       for (iter = plugin_types; iter; iter = iter->next) | ||||
|         { | ||||
|           plugin_type = (GType)GPOINTER_TO_SIZE (iter->data); | ||||
|           plugin = g_object_new (plugin_type, "screen", screen,  NULL); | ||||
|           plugin_mgr->plugins = g_list_prepend (plugin_mgr->plugins, plugin); | ||||
|         } | ||||
|  | ||||
|       return plugin_mgr; | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -24,11 +24,11 @@ | ||||
| #ifndef META_PLUGIN_MANAGER_H_ | ||||
| #define META_PLUGIN_MANAGER_H_ | ||||
|  | ||||
| #include "types.h" | ||||
| #include "screen.h" | ||||
| #include <meta/types.h> | ||||
| #include <meta/screen.h> | ||||
|  | ||||
| #define  META_PLUGIN_FROM_MANAGER_ | ||||
| #include "meta-plugin.h" | ||||
| #include <meta/meta-plugin.h> | ||||
| #undef   META_PLUGIN_FROM_MANAGER_ | ||||
|  | ||||
| #define META_PLUGIN_MINIMIZE         (1<<0) | ||||
| @@ -49,8 +49,12 @@ typedef struct MetaPluginManager MetaPluginManager; | ||||
| MetaPluginManager * meta_plugin_manager_get         (MetaScreen *screen); | ||||
| MetaPluginManager * meta_plugin_manager_get_default (void); | ||||
|  | ||||
| gboolean meta_plugin_manager_load         (MetaPluginManager *mgr); | ||||
| gboolean meta_plugin_manager_initialize   (MetaPluginManager *plugin_mgr); | ||||
| void     meta_plugin_manager_load         (MetaPluginManager *mgr, | ||||
|                                            const gchar       *plugin_name); | ||||
| void     meta_plugin_manager_register     (MetaPluginManager *mgr, | ||||
|                                            GType              plugin_type); | ||||
| void     meta_plugin_manager_initialize   (MetaPluginManager *mgr); | ||||
|  | ||||
| gboolean meta_plugin_manager_event_simple (MetaPluginManager *mgr, | ||||
|                                            MetaWindowActor   *actor, | ||||
|                                            unsigned long      event); | ||||
|   | ||||
| @@ -21,9 +21,10 @@ | ||||
|  * 02111-1307, USA. | ||||
|  */ | ||||
|  | ||||
| #include "meta-plugin.h" | ||||
| #include "screen.h" | ||||
| #include "display.h" | ||||
| #include <meta/meta-plugin.h> | ||||
| #include "meta-plugin-manager.h" | ||||
| #include <meta/screen.h> | ||||
| #include <meta/display.h> | ||||
|  | ||||
| #include <string.h> | ||||
| #include <X11/Xlib.h> | ||||
| @@ -43,7 +44,6 @@ enum | ||||
| { | ||||
|   PROP_0, | ||||
|   PROP_SCREEN, | ||||
|   PROP_PARAMS, | ||||
|   PROP_FEATURES, | ||||
|   PROP_DISABLED, | ||||
|   PROP_DEBUG_MODE, | ||||
| @@ -52,7 +52,6 @@ enum | ||||
| struct _MetaPluginPrivate | ||||
| { | ||||
|   MetaScreen   *screen; | ||||
|   gchar        *params; | ||||
|   gulong        features; | ||||
|  | ||||
|   gint          running; | ||||
| @@ -61,6 +60,46 @@ struct _MetaPluginPrivate | ||||
|   gboolean      debug    : 1; | ||||
| }; | ||||
|  | ||||
| static void | ||||
| meta_plugin_set_features (MetaPlugin *plugin) | ||||
| { | ||||
|   MetaPluginPrivate  *priv     = plugin->priv; | ||||
|   MetaPluginClass    *klass    = META_PLUGIN_GET_CLASS (plugin); | ||||
|  | ||||
|   priv->features = 0; | ||||
|  | ||||
|   /* | ||||
|    * Feature flags: identify events that the plugin can handle; a plugin can | ||||
|    * handle one or more events. | ||||
|    */ | ||||
|   if (klass->minimize) | ||||
|     priv->features |= META_PLUGIN_MINIMIZE; | ||||
|  | ||||
|   if (klass->maximize) | ||||
|     priv->features |= META_PLUGIN_MAXIMIZE; | ||||
|  | ||||
|   if (klass->unmaximize) | ||||
|     priv->features |= META_PLUGIN_UNMAXIMIZE; | ||||
|  | ||||
|   if (klass->map) | ||||
|     priv->features |= META_PLUGIN_MAP; | ||||
|  | ||||
|   if (klass->destroy) | ||||
|     priv->features |= META_PLUGIN_DESTROY; | ||||
|  | ||||
|   if (klass->switch_workspace) | ||||
|     priv->features |= META_PLUGIN_SWITCH_WORKSPACE; | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_plugin_constructed (GObject *object) | ||||
| { | ||||
|   meta_plugin_set_features (META_PLUGIN (object)); | ||||
|  | ||||
|   if (G_OBJECT_CLASS (meta_plugin_parent_class)->constructed) | ||||
|       G_OBJECT_CLASS (meta_plugin_parent_class)->constructed (object); | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_plugin_dispose (GObject *object) | ||||
| { | ||||
| @@ -70,97 +109,9 @@ meta_plugin_dispose (GObject *object) | ||||
| static void | ||||
| meta_plugin_finalize (GObject *object) | ||||
| { | ||||
|   MetaPluginPrivate *priv = META_PLUGIN (object)->priv; | ||||
|  | ||||
|   g_free (priv->params); | ||||
|   priv->params = NULL; | ||||
|  | ||||
|   G_OBJECT_CLASS (meta_plugin_parent_class)->finalize (object); | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_plugin_parse_params (MetaPlugin *plugin) | ||||
| { | ||||
|   char                  *p; | ||||
|   gulong                features = 0; | ||||
|   MetaPluginPrivate  *priv     = plugin->priv; | ||||
|   MetaPluginClass    *klass    = META_PLUGIN_GET_CLASS (plugin); | ||||
|  | ||||
| /* | ||||
|  * Feature flags: identify events that the plugin can handle; a plugin can | ||||
|  * handle one or more events. | ||||
|  */ | ||||
|   if (klass->minimize) | ||||
|     features |= META_PLUGIN_MINIMIZE; | ||||
|  | ||||
|   if (klass->maximize) | ||||
|     features |= META_PLUGIN_MAXIMIZE; | ||||
|  | ||||
|   if (klass->unmaximize) | ||||
|     features |= META_PLUGIN_UNMAXIMIZE; | ||||
|  | ||||
|   if (klass->map) | ||||
|     features |= META_PLUGIN_MAP; | ||||
|  | ||||
|   if (klass->destroy) | ||||
|     features |= META_PLUGIN_DESTROY; | ||||
|  | ||||
|   if (klass->switch_workspace) | ||||
|     features |= META_PLUGIN_SWITCH_WORKSPACE; | ||||
|  | ||||
|   if (priv->params) | ||||
|     { | ||||
|       gboolean debug = FALSE; | ||||
|  | ||||
|       if ((p = strstr (priv->params, "disable:"))) | ||||
|         { | ||||
|           gchar *d = g_strdup (p+8); | ||||
|  | ||||
|           p = strchr (d, ';'); | ||||
|  | ||||
|           if (p) | ||||
|             *p = 0; | ||||
|  | ||||
|           if (strstr (d, "minimize")) | ||||
|             features &= ~ META_PLUGIN_MINIMIZE; | ||||
|  | ||||
|           if (strstr (d, "maximize")) | ||||
|             features &= ~ META_PLUGIN_MAXIMIZE; | ||||
|  | ||||
|           if (strstr (d, "unmaximize")) | ||||
|             features &= ~ META_PLUGIN_UNMAXIMIZE; | ||||
|  | ||||
|           if (strstr (d, "map")) | ||||
|             features &= ~ META_PLUGIN_MAP; | ||||
|  | ||||
|           if (strstr (d, "destroy")) | ||||
|             features &= ~ META_PLUGIN_DESTROY; | ||||
|  | ||||
|           if (strstr (d, "switch-workspace")) | ||||
|             features &= ~META_PLUGIN_SWITCH_WORKSPACE; | ||||
|  | ||||
|           g_free (d); | ||||
|         } | ||||
|  | ||||
|       if (strstr (priv->params, "debug")) | ||||
|         debug = TRUE; | ||||
|  | ||||
|       if (debug != priv->debug) | ||||
|         { | ||||
|           priv->debug = debug; | ||||
|  | ||||
|           g_object_notify (G_OBJECT (plugin), "debug-mode"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   if (features != priv->features) | ||||
|     { | ||||
|       priv->features = features; | ||||
|  | ||||
|       g_object_notify (G_OBJECT (plugin), "features"); | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_plugin_set_property (GObject      *object, | ||||
|                           guint         prop_id, | ||||
| @@ -174,10 +125,6 @@ meta_plugin_set_property (GObject      *object, | ||||
|     case PROP_SCREEN: | ||||
|       priv->screen = g_value_get_object (value); | ||||
|       break; | ||||
|     case PROP_PARAMS: | ||||
|       priv->params = g_value_dup_string (value); | ||||
|       meta_plugin_parse_params (META_PLUGIN (object)); | ||||
|       break; | ||||
|     case PROP_DISABLED: | ||||
|       priv->disabled = g_value_get_boolean (value); | ||||
|       break; | ||||
| @@ -203,9 +150,6 @@ meta_plugin_get_property (GObject    *object, | ||||
|     case PROP_SCREEN: | ||||
|       g_value_set_object (value, priv->screen); | ||||
|       break; | ||||
|     case PROP_PARAMS: | ||||
|       g_value_set_string (value, priv->params); | ||||
|       break; | ||||
|     case PROP_DISABLED: | ||||
|       g_value_set_boolean (value, priv->disabled); | ||||
|       break; | ||||
| @@ -227,6 +171,7 @@ meta_plugin_class_init (MetaPluginClass *klass) | ||||
| { | ||||
|   GObjectClass      *gobject_class = G_OBJECT_CLASS (klass); | ||||
|  | ||||
|   gobject_class->constructed     = meta_plugin_constructed; | ||||
|   gobject_class->finalize        = meta_plugin_finalize; | ||||
|   gobject_class->dispose         = meta_plugin_dispose; | ||||
|   gobject_class->set_property    = meta_plugin_set_property; | ||||
| @@ -240,15 +185,6 @@ meta_plugin_class_init (MetaPluginClass *klass) | ||||
|                                                         META_TYPE_SCREEN, | ||||
|                                                         G_PARAM_READWRITE)); | ||||
|  | ||||
|   g_object_class_install_property (gobject_class, | ||||
| 				   PROP_PARAMS, | ||||
| 				   g_param_spec_string ("params", | ||||
| 							"Parameters", | ||||
| 							"Plugin Parameters", | ||||
| 							NULL, | ||||
| 							G_PARAM_READWRITE | | ||||
|                                                         G_PARAM_CONSTRUCT)); | ||||
|  | ||||
|   g_object_class_install_property (gobject_class, | ||||
| 				   PROP_FEATURES, | ||||
| 				   g_param_spec_ulong ("features", | ||||
| @@ -613,3 +549,18 @@ meta_plugin_get_screen (MetaPlugin *plugin) | ||||
|   return priv->screen; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_plugin_type_register: | ||||
|  * @plugin_type: a #MetaPlugin type | ||||
|  * | ||||
|  * Register @plugin_type as a compositor plugin type to be used. | ||||
|  * You must call this before calling meta_init(). | ||||
|  */ | ||||
| void | ||||
| meta_plugin_type_register (GType plugin_type) | ||||
| { | ||||
|   MetaPluginManager *plugin_manager; | ||||
|  | ||||
|   plugin_manager = meta_plugin_manager_get_default (); | ||||
|   meta_plugin_manager_register (plugin_manager, plugin_type); | ||||
| } | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
| #include <cairo.h> | ||||
| #include <clutter/clutter.h> | ||||
| #include "meta-window-shape.h" | ||||
| #include "meta-shadow-factory.h" | ||||
| #include <meta/meta-shadow-factory.h> | ||||
|  | ||||
| /** | ||||
|  * MetaShadow: | ||||
|   | ||||
| @@ -187,8 +187,10 @@ meta_shaped_texture_dirty_mask (MetaShapedTexture *stex) | ||||
|       cogl_texture_get_gl_texture (priv->mask_texture, | ||||
|                                    &mask_gl_tex, &mask_gl_target); | ||||
|  | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
|       if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB) | ||||
|         glDeleteTextures (1, &mask_gl_tex); | ||||
| #endif | ||||
|  | ||||
|       cogl_handle_unref (priv->mask_texture); | ||||
|       priv->mask_texture = COGL_INVALID_HANDLE; | ||||
| @@ -253,6 +255,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex) | ||||
|  | ||||
|       cogl_texture_get_gl_texture (paint_tex, NULL, &paint_gl_target); | ||||
|  | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
|       if (paint_gl_target == GL_TEXTURE_RECTANGLE_ARB) | ||||
|         { | ||||
|           GLuint tex; | ||||
| @@ -275,6 +278,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex) | ||||
|                                              COGL_PIXEL_FORMAT_A_8); | ||||
|         } | ||||
|       else | ||||
| #endif /* GL_TEXTURE_RECTANGLE_ARB */ | ||||
|         priv->mask_texture = cogl_texture_new_from_data (tex_width, tex_height, | ||||
|                                                          COGL_TEXTURE_NONE, | ||||
|                                                          COGL_PIXEL_FORMAT_A_8, | ||||
|   | ||||
| @@ -31,6 +31,8 @@ | ||||
| #include <clutter/clutter.h> | ||||
| #ifdef HAVE_GLX_TEXTURE_PIXMAP | ||||
| #include <clutter/glx/clutter-glx.h> | ||||
| #else | ||||
| #include <clutter/x11/clutter-x11.h> | ||||
| #endif /* HAVE_GLX_TEXTURE_PIXMAP */ | ||||
|  | ||||
| G_BEGIN_DECLS | ||||
|   | ||||
| @@ -97,6 +97,7 @@ meta_texture_tower_free (MetaTextureTower *tower) | ||||
|   g_slice_free (MetaTextureTower, tower); | ||||
| } | ||||
|  | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
| static gboolean | ||||
| texture_is_rectangle (CoglHandle texture) | ||||
| { | ||||
| @@ -106,10 +107,12 @@ texture_is_rectangle (CoglHandle texture) | ||||
|   cogl_texture_get_gl_texture (texture, &gl_tex, &gl_target); | ||||
|   return gl_target == GL_TEXTURE_RECTANGLE_ARB; | ||||
| } | ||||
| #endif /* GL_TEXTURE_RECTANGLE_ARB */ | ||||
|  | ||||
| static void | ||||
| free_texture (CoglHandle texture) | ||||
| { | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
|   GLuint gl_tex; | ||||
|   GLenum gl_target; | ||||
|  | ||||
| @@ -117,6 +120,7 @@ free_texture (CoglHandle texture) | ||||
|  | ||||
|   if (gl_target == GL_TEXTURE_RECTANGLE_ARB) | ||||
|     glDeleteTextures (1, &gl_tex); | ||||
| #endif /* GL_TEXTURE_RECTANGLE_ARB */ | ||||
|  | ||||
|   cogl_handle_unref (texture); | ||||
| } | ||||
| @@ -362,11 +366,13 @@ get_paint_level (int width, int height) | ||||
|     return (int)(0.5 + lambda); | ||||
| } | ||||
|  | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
| static gboolean | ||||
| is_power_of_two (int x) | ||||
| { | ||||
|   return (x & (x - 1)) == 0; | ||||
| } | ||||
| #endif /* GL_TEXTURE_RECTANGLE_ARB */ | ||||
|  | ||||
| static void | ||||
| texture_tower_create_texture (MetaTextureTower *tower, | ||||
| @@ -374,6 +380,7 @@ texture_tower_create_texture (MetaTextureTower *tower, | ||||
|                               int               width, | ||||
|                               int               height) | ||||
| { | ||||
| #ifdef GL_TEXTURE_RECTANGLE_ARB | ||||
|   if ((!is_power_of_two (width) || !is_power_of_two (height)) && | ||||
|       texture_is_rectangle (tower->textures[level - 1])) | ||||
|     { | ||||
| @@ -396,6 +403,7 @@ texture_tower_create_texture (MetaTextureTower *tower, | ||||
|                                                               TEXTURE_FORMAT); | ||||
|     } | ||||
|   else | ||||
| #endif /* GL_TEXTURE_RECTANGLE_ARB */ | ||||
|     { | ||||
|       tower->textures[level] = cogl_texture_new_with_size (width, height, | ||||
|                                                            COGL_TEXTURE_NO_AUTO_MIPMAP, | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
| #include <config.h> | ||||
|  | ||||
| #include <X11/extensions/Xdamage.h> | ||||
| #include "compositor-mutter.h" | ||||
| #include <meta/compositor-mutter.h> | ||||
|  | ||||
| MetaWindowActor *meta_window_actor_new (MetaWindow *window); | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,7 @@ | ||||
| /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ | ||||
|  | ||||
| #include <config.h> | ||||
|  | ||||
| #define _ISOC99_SOURCE /* for roundf */ | ||||
| #include <math.h> | ||||
|  | ||||
| @@ -11,10 +13,10 @@ | ||||
| #include <clutter/x11/clutter-x11.h> | ||||
| #include <gdk/gdk.h> /* for gdk_rectangle_union() */ | ||||
|  | ||||
| #include "display.h" | ||||
| #include "errors.h" | ||||
| #include <meta/display.h> | ||||
| #include <meta/errors.h> | ||||
| #include "frame.h" | ||||
| #include "window.h" | ||||
| #include <meta/window.h> | ||||
| #include "xprops.h" | ||||
|  | ||||
| #include "compositor-private.h" | ||||
| @@ -22,6 +24,15 @@ | ||||
| #include "meta-shaped-texture.h" | ||||
| #include "meta-window-actor-private.h" | ||||
|  | ||||
| enum { | ||||
|   POSITION_CHANGED, | ||||
|   SIZE_CHANGED, | ||||
|   LAST_SIGNAL | ||||
| }; | ||||
|  | ||||
| static guint signals[LAST_SIGNAL] = {0}; | ||||
|  | ||||
|  | ||||
| struct _MetaWindowActorPrivate | ||||
| { | ||||
|   XWindowAttributes attrs; | ||||
| @@ -273,6 +284,21 @@ meta_window_actor_class_init (MetaWindowActorClass *klass) | ||||
|   g_object_class_install_property (object_class, | ||||
|                                    PROP_SHADOW_CLASS, | ||||
|                                    pspec); | ||||
|  | ||||
|   signals[POSITION_CHANGED] = | ||||
|     g_signal_new ("position-changed", | ||||
|                   G_TYPE_FROM_CLASS (klass), | ||||
|                   G_SIGNAL_RUN_LAST, | ||||
|                   0, NULL, NULL, | ||||
|                   g_cclosure_marshal_VOID__VOID, | ||||
|                   G_TYPE_NONE, 0); | ||||
|   signals[SIZE_CHANGED] = | ||||
|     g_signal_new ("size-changed", | ||||
|                   G_TYPE_FROM_CLASS (klass), | ||||
|                   G_SIGNAL_RUN_LAST, | ||||
|                   0, NULL, NULL, | ||||
|                   g_cclosure_marshal_VOID__VOID, | ||||
|                   G_TYPE_NONE, 0); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @@ -299,7 +325,6 @@ window_decorated_notify (MetaWindow *mw, | ||||
|   MetaDisplay            *display  = meta_screen_get_display (screen); | ||||
|   Display                *xdisplay = meta_display_get_xdisplay (display); | ||||
|   Window                  new_xwindow; | ||||
|   MetaCompScreen         *info; | ||||
|   XWindowAttributes       attrs; | ||||
|  | ||||
|   /* | ||||
| @@ -315,8 +340,6 @@ window_decorated_notify (MetaWindow *mw, | ||||
|  | ||||
|   meta_window_actor_detach (self); | ||||
|  | ||||
|   info = meta_screen_get_compositor_data (screen); | ||||
|  | ||||
|   /* | ||||
|    * First of all, clean up any resources we are currently using and will | ||||
|    * be replacing. | ||||
| @@ -350,6 +373,14 @@ window_decorated_notify (MetaWindow *mw, | ||||
|   meta_window_actor_constructed (G_OBJECT (self)); | ||||
| } | ||||
|  | ||||
| static void | ||||
| window_appears_focused_notify (MetaWindow *mw, | ||||
|                                GParamSpec *arg1, | ||||
|                                gpointer    data) | ||||
| { | ||||
|   clutter_actor_queue_redraw (CLUTTER_ACTOR (data)); | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_window_actor_constructed (GObject *object) | ||||
| { | ||||
| @@ -360,9 +391,6 @@ meta_window_actor_constructed (GObject *object) | ||||
|   Window                  xwindow  = priv->xwindow; | ||||
|   Display                *xdisplay = meta_display_get_xdisplay (display); | ||||
|   XRenderPictFormat      *format; | ||||
|   MetaCompositor         *compositor; | ||||
|  | ||||
|   compositor = meta_display_get_compositor (display); | ||||
|  | ||||
| #ifdef HAVE_SHAPE | ||||
|   /* Listen for ShapeNotify events on the window */ | ||||
| @@ -402,6 +430,8 @@ meta_window_actor_constructed (GObject *object) | ||||
|  | ||||
|       g_signal_connect (priv->window, "notify::decorated", | ||||
|                         G_CALLBACK (window_decorated_notify), self); | ||||
|       g_signal_connect (priv->window, "notify::appears-focused", | ||||
|                         G_CALLBACK (window_appears_focused_notify), self); | ||||
|     } | ||||
|   else | ||||
|     { | ||||
| @@ -477,6 +507,12 @@ meta_window_actor_dispose (GObject *object) | ||||
|  | ||||
|   info->windows = g_list_remove (info->windows, (gconstpointer) self); | ||||
|  | ||||
|   if (priv->window) | ||||
|     { | ||||
|       g_object_unref (priv->window); | ||||
|       priv->window = NULL; | ||||
|     } | ||||
|  | ||||
|   /* | ||||
|    * Release the extra reference we took on the actor. | ||||
|    */ | ||||
| @@ -509,7 +545,11 @@ meta_window_actor_set_property (GObject      *object, | ||||
|   switch (prop_id) | ||||
|     { | ||||
|     case PROP_META_WINDOW: | ||||
|       priv->window = g_value_get_object (value); | ||||
|       { | ||||
|         if (priv->window) | ||||
|           g_object_unref (priv->window); | ||||
|         priv->window = g_value_dup_object (value); | ||||
|       } | ||||
|       break; | ||||
|     case PROP_META_SCREEN: | ||||
|       priv->screen = g_value_get_pointer (value); | ||||
| @@ -881,6 +921,19 @@ meta_window_actor_get_texture (MetaWindowActor *self) | ||||
|   return self->priv->actor; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_window_actor_is_destroyed: | ||||
|  * | ||||
|  * Gets whether the X window that the actor was displaying has been destroyed | ||||
|  * | ||||
|  * Return value: %TRUE when the window is destroyed, otherwise %FALSE | ||||
|  */ | ||||
| gboolean | ||||
| meta_window_actor_is_destroyed (MetaWindowActor *self) | ||||
| { | ||||
|   return self->priv->disposed; | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| meta_window_actor_is_override_redirect (MetaWindowActor *self) | ||||
| { | ||||
| @@ -1307,6 +1360,8 @@ meta_window_actor_sync_actor_position (MetaWindowActor *self) | ||||
|                               window_rect.x, window_rect.y); | ||||
|   clutter_actor_set_size (CLUTTER_ACTOR (self), | ||||
|                           window_rect.width, window_rect.height); | ||||
|  | ||||
|   g_signal_emit (self, signals[POSITION_CHANGED], 0); | ||||
| } | ||||
|  | ||||
| void | ||||
| @@ -1598,6 +1653,8 @@ meta_window_actor_update_bounding_region (MetaWindowActor *self, | ||||
|    */ | ||||
|   if (!priv->shaped) | ||||
|     meta_window_actor_invalidate_shadow (self); | ||||
|  | ||||
|   g_signal_emit (self, signals[SIZE_CHANGED], 0); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @@ -1762,7 +1819,6 @@ check_needs_pixmap (MetaWindowActor *self) | ||||
|   MetaCompScreen      *info     = meta_screen_get_compositor_data (screen); | ||||
|   MetaCompositor      *compositor; | ||||
|   Window               xwindow  = priv->xwindow; | ||||
|   gboolean             full     = FALSE; | ||||
|  | ||||
|   if (!priv->needs_pixmap) | ||||
|     return; | ||||
| @@ -1823,9 +1879,11 @@ check_needs_pixmap (MetaWindowActor *self) | ||||
|        * do it here. | ||||
|        * See: http://bugzilla.clutter-project.org/show_bug.cgi?id=2236 | ||||
|        */ | ||||
| #ifdef HAVE_GLX_TEXTURE_PIXMAP | ||||
|       if (G_UNLIKELY (!clutter_glx_texture_pixmap_using_extension ( | ||||
|                                   CLUTTER_GLX_TEXTURE_PIXMAP (priv->actor)))) | ||||
|         g_warning ("NOTE: Not using GLX TFP!\n"); | ||||
| #endif | ||||
|  | ||||
|       g_object_get (priv->actor, | ||||
|                     "pixmap-width", &pxm_width, | ||||
| @@ -1833,8 +1891,6 @@ check_needs_pixmap (MetaWindowActor *self) | ||||
|                     NULL); | ||||
|  | ||||
|       meta_window_actor_update_bounding_region (self, pxm_width, pxm_height); | ||||
|  | ||||
|       full = TRUE; | ||||
|     } | ||||
|  | ||||
|   meta_error_trap_pop (display); | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|  | ||||
| #include <clutter/clutter.h> | ||||
|  | ||||
| #include "screen.h" | ||||
| #include <meta/screen.h> | ||||
|  | ||||
| /** | ||||
|  * MetaWindowGroup: | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
|  | ||||
| pkglibdir=@MUTTER_PLUGIN_DIR@ | ||||
|  | ||||
| INCLUDES=@MUTTER_CFLAGS@ -I $(top_srcdir)/src/include -DMUTTER_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUTTER_PKGDATADIR=\"$(pkgdatadir)\" -DMUTTER_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"mutter\" -DSN_API_NOT_YET_FROZEN=1 -DMUTTER_MAJOR_VERSION=$(MUTTER_MAJOR_VERSION) -DMUTTER_MINOR_VERSION=$(MUTTER_MINOR_VERSION) -DMUTTER_MICRO_VERSION=$(MUTTER_MICRO_VERSION) -DMUTTER_PLUGIN_API_VERSION=$(MUTTER_PLUGIN_API_VERSION) -DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\" | ||||
| INCLUDES=@MUTTER_CFLAGS@ -I $(top_srcdir)/src -DMUTTER_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUTTER_PKGDATADIR=\"$(pkgdatadir)\" -DMUTTER_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"mutter\" -DSN_API_NOT_YET_FROZEN=1 -DMUTTER_MAJOR_VERSION=$(MUTTER_MAJOR_VERSION) -DMUTTER_MINOR_VERSION=$(MUTTER_MINOR_VERSION) -DMUTTER_MICRO_VERSION=$(MUTTER_MICRO_VERSION) -DMUTTER_PLUGIN_API_VERSION=$(MUTTER_PLUGIN_API_VERSION) -DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\" | ||||
|  | ||||
| default_la_CFLAGS   = -fPIC | ||||
| default_la_SOURCES  = default.c | ||||
|   | ||||
| @@ -1,41 +0,0 @@ | ||||
|  | ||||
| Plugins implement effects associated with WM events, such as window map, | ||||
| minimizing, maximizing, unmaximizing, destruction and workspace switching. The | ||||
| plugin API is documented in src/include/compositor-clutter-plugin.h; in | ||||
| addition the simple plugin can be used as a reference implementation. | ||||
|  | ||||
| The API is intended to be generic, exposing no implementation details of the WM | ||||
| to the plugins; this will facilitate reuse without modification with another WM | ||||
| (there are plans to use the same plugin API with Matchbox 2). | ||||
|  | ||||
| Multiple plugins can implement the same effect and be loaded at the same time; | ||||
| however, stacking arbitrary effects in this way might not work as expected; | ||||
| this is particularly true of more complex effects, such as those for workspace | ||||
| switching. | ||||
|  | ||||
| Plugins are installed in ${prefix}/lib/metacity/plugins/clutter; from there the | ||||
| WM will load plugins listed in the clutter_plugins key in the Metacity gconf | ||||
| general preferences group. Each entry in preferences has the format | ||||
|  | ||||
|   'name: optional parameters' | ||||
|  | ||||
| where 'name' is the name of the library without the .so suffix. | ||||
|  | ||||
| As noted above, additional parameters can be passed to the plugin via the | ||||
| preference key. In such case, the plugin name is immediately followed by a | ||||
| colon, separating it from the parameters. Two common parameters should be | ||||
| handled by all plugins: | ||||
|  | ||||
|   'debug'   indicates that the plugin is run in a debug mode (what exactly that | ||||
|             means is left to the plugin to determine). | ||||
|  | ||||
|   'disable' parameter indicates which effects within the plugin should be | ||||
|             disabled; the format of the disable parameter is | ||||
|  | ||||
|               'disable: effect1[, effect2];' | ||||
|  | ||||
|             where effect1, etc., matches the effects listed in the | ||||
|             compositor-clutter-plugin.h file (currently one of 'map', 'destroy', | ||||
|             'maximize', 'unmaximize', 'switch-workspace'). Example 'disable: | ||||
|             minimize, maximize;'. | ||||
|  | ||||
| @@ -21,8 +21,8 @@ | ||||
|  * 02111-1307, USA. | ||||
|  */ | ||||
|  | ||||
| #include "meta-plugin.h" | ||||
| #include "window.h" | ||||
| #include <meta/meta-plugin.h> | ||||
| #include <meta/window.h> | ||||
|  | ||||
| #include <libintl.h> | ||||
| #define _(x) dgettext (GETTEXT_PACKAGE, x) | ||||
| @@ -319,12 +319,10 @@ switch_workspace (MetaPlugin *plugin, | ||||
| { | ||||
|   MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv; | ||||
|   GList        *l; | ||||
|   gint          n_workspaces; | ||||
|   ClutterActor *workspace0  = clutter_group_new (); | ||||
|   ClutterActor *workspace1  = clutter_group_new (); | ||||
|   ClutterActor *stage; | ||||
|   int           screen_width, screen_height; | ||||
|   MetaScreen   *screen = meta_plugin_get_screen (plugin); | ||||
|   ClutterAnimation *animation; | ||||
|  | ||||
|   stage = meta_plugin_get_stage (plugin); | ||||
| @@ -350,8 +348,6 @@ switch_workspace (MetaPlugin *plugin, | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|   n_workspaces = meta_screen_get_n_workspaces (screen); | ||||
|  | ||||
|   l = g_list_last (meta_plugin_get_window_actors (plugin)); | ||||
|  | ||||
|   while (l) | ||||
|   | ||||
| @@ -180,7 +180,7 @@ meta_region_iterator_next (MetaRegionIterator *iter) | ||||
|   iter->rectangle = iter->next_rectangle; | ||||
|   iter->line_start = iter->line_end; | ||||
|  | ||||
|   if (iter->i < iter->n_rectangles) | ||||
|   if (iter->i + 1 < iter->n_rectangles) | ||||
|     { | ||||
|       cairo_region_get_rectangle (iter->region, iter->i + 1, &iter->next_rectangle); | ||||
|       iter->line_end = iter->next_rectangle.y != iter->rectangle.y; | ||||
|   | ||||
							
								
								
									
										241
									
								
								src/core/above-tab-keycode.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										241
									
								
								src/core/above-tab-keycode.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,241 @@ | ||||
| /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ | ||||
|  | ||||
| /* Find the keycode for the key above the tab key */ | ||||
| /* | ||||
|  * Copyright 2010 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 | ||||
|  * 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. | ||||
|  */ | ||||
|  | ||||
| /* The standard cycle-windows keybinding should be the key above the | ||||
|  * tab key. This will have a different keysym on different keyboards - | ||||
|  * it's the ` (grave) key on US keyboards but something else on many | ||||
|  * other national layouts. So we need to figure out the keycode for | ||||
|  * this key without reference to key symbol. | ||||
|  * | ||||
|  * The "correct" way to do this is to get the XKB geometry from the | ||||
|  * X server, find the Tab key, find the key above the Tab key in the | ||||
|  * same section and use the keycode for that key. This is what I | ||||
|  * implemented here, but unfortunately, fetching the geometry is rather | ||||
|  * slow (It could take 20ms or more.) | ||||
|  * | ||||
|  * If you looking for a way to optimize Mutter startup performance: | ||||
|  * On all Linux systems using evdev the key above TAB will have | ||||
|  * keycode 49. (KEY_GRAVE=41 + the 8 code point offset between | ||||
|  * evdev keysyms and X keysyms.) So a configure option | ||||
|  * --with-above-tab-keycode=49 could be added that bypassed this | ||||
|  * code. It wouldn't work right for displaying Mutter remotely | ||||
|  * to a non-Linux X server, but that is pretty rare. | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
|  | ||||
| #include <string.h> | ||||
|  | ||||
| #include "display-private.h" | ||||
|  | ||||
| #include <X11/keysym.h> | ||||
|  | ||||
| #ifdef HAVE_XKB | ||||
| #include <X11/XKBlib.h> | ||||
| #include <X11/extensions/XKBgeom.h> | ||||
|  | ||||
| static guint | ||||
| compute_above_tab_keycode (Display *xdisplay) | ||||
| { | ||||
|   XkbDescPtr keyboard; | ||||
|   XkbGeometryPtr geometry; | ||||
|   int i, j, k; | ||||
|   int tab_keycode; | ||||
|   char *tab_name; | ||||
|   XkbSectionPtr tab_section; | ||||
|   XkbBoundsRec tab_bounds; | ||||
|   XkbKeyPtr best_key = NULL; | ||||
|   guint best_keycode = (guint)-1; | ||||
|   int best_x_dist = G_MAXINT; | ||||
|   int best_y_dist = G_MAXINT; | ||||
|  | ||||
|   /* We need only the Names and the Geometry, but asking for these results | ||||
|    * in the Keyboard information retrieval failing for unknown reasons. | ||||
|    * (Testing with xorg-1.9.1.) So we ask for a part that we don't need | ||||
|    * as well. | ||||
|    */ | ||||
|   keyboard = XkbGetKeyboard (xdisplay, | ||||
|                              XkbGBN_ClientSymbolsMask | XkbGBN_KeyNamesMask | XkbGBN_GeometryMask, | ||||
|                              XkbUseCoreKbd); | ||||
|  | ||||
|   geometry = keyboard->geom; | ||||
|  | ||||
|   /* There could potentially be multiple keys with the Tab keysym on the keyboard; | ||||
|    * but XKeysymToKeycode() returns us the one that the alt-Tab binding will | ||||
|    * use which is good enough | ||||
|    */ | ||||
|   tab_keycode = XKeysymToKeycode (xdisplay, XK_Tab); | ||||
|   if (tab_keycode == 0 || tab_keycode < keyboard->min_key_code || tab_keycode > keyboard->max_key_code) | ||||
|     goto out; | ||||
|  | ||||
|   /* The keyboard geometry is stored by key "name" rather than keycode. | ||||
|    * (Key names are 4-character strings like like TAB or AE01.) We use the | ||||
|    * 'names' part of the keyboard description to map keycode to key name. | ||||
|    * | ||||
|    * XKB has a "key aliases" feature where a single keyboard key can have | ||||
|    * multiple names (with separate sets of aliases in the 'names' part and | ||||
|    * in the 'geometry' part), but I don't really understand it or how it is used, | ||||
|    * so I'm ignoring it here. | ||||
|    */ | ||||
|  | ||||
|   tab_name = keyboard->names->keys[tab_keycode].name; /* Not NULL terminated! */ | ||||
|  | ||||
|   /* First, iterate through the keyboard geometry to find the tab key; the keyboard | ||||
|    * geometry has a three-level heirarchy of section > row > key | ||||
|    */ | ||||
|   for (i = 0; i < geometry->num_sections; i++) | ||||
|     { | ||||
|       XkbSectionPtr section = &geometry->sections[i]; | ||||
|       for (j = 0; j < section->num_rows; j++) | ||||
|         { | ||||
|           int x = 0; | ||||
|           int y = 0; | ||||
|  | ||||
|           XkbRowPtr row = §ion->rows[j]; | ||||
|           for (k = 0; k < row->num_keys; k++) | ||||
|             { | ||||
|               XkbKeyPtr key = &row->keys[k]; | ||||
|               XkbShapePtr shape = XkbKeyShape (geometry, key); | ||||
|  | ||||
|               if (row->vertical) | ||||
|                 y += key->gap; | ||||
|               else | ||||
|                 x += key->gap; | ||||
|  | ||||
|               if (strncmp (key->name.name, tab_name, XkbKeyNameLength) == 0) | ||||
|                 { | ||||
|                   tab_section = section; | ||||
|                   tab_bounds = shape->bounds; | ||||
|                   tab_bounds.x1 += row->left + x; | ||||
|                   tab_bounds.x2 += row->left + x; | ||||
|                   tab_bounds.y1 += row->top + y; | ||||
|                   tab_bounds.y2 += row->top + y; | ||||
|  | ||||
|                   goto found_tab; | ||||
|                 } | ||||
|  | ||||
|               if (row->vertical) | ||||
|                 y += (shape->bounds.y2 - shape->bounds.y1); | ||||
|               else | ||||
|                 x += (shape->bounds.x2 - shape->bounds.x1); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   /* No tab key found */ | ||||
|   goto out; | ||||
|  | ||||
|  found_tab: | ||||
|  | ||||
|   /* Now find the key that: | ||||
|    *  - Is in the same section as the Tab key | ||||
|    *  - Has a horizontal center in the Tab key's horizonal bounds | ||||
|    *  - Is above the Tab key at a distance closer than any other key | ||||
|    *  - In case of ties, has its horizontal center as close as possible | ||||
|    *    to the Tab key's horizontal center | ||||
|    */ | ||||
|   for (j = 0; j < tab_section->num_rows; j++) | ||||
|     { | ||||
|       int x = 0; | ||||
|       int y = 0; | ||||
|  | ||||
|       XkbRowPtr row = &tab_section->rows[j]; | ||||
|       for (k = 0; k < row->num_keys; k++) | ||||
|         { | ||||
|           XkbKeyPtr key = &row->keys[k]; | ||||
|           XkbShapePtr shape = XkbKeyShape(geometry, key); | ||||
|           XkbBoundsRec bounds = shape->bounds; | ||||
|           int x_center; | ||||
|           int x_dist, y_dist; | ||||
|  | ||||
|           if (row->vertical) | ||||
|             y += key->gap; | ||||
|           else | ||||
|             x += key->gap; | ||||
|  | ||||
|           bounds.x1 += row->left + x; | ||||
|           bounds.x2 += row->left + x; | ||||
|           bounds.y1 += row->top + y; | ||||
|           bounds.y2 += row->top + y; | ||||
|  | ||||
|           y_dist = tab_bounds.y1 - bounds.y2; | ||||
|           if (y_dist < 0) | ||||
|             continue; | ||||
|  | ||||
|           x_center = (bounds.x1 + bounds.x2) / 2; | ||||
|           if (x_center < tab_bounds.x1 || x_center > tab_bounds.x2) | ||||
|             continue; | ||||
|  | ||||
|           x_dist = ABS (x_center - (tab_bounds.x1 + tab_bounds.x2) / 2); | ||||
|  | ||||
|           if (y_dist < best_y_dist || | ||||
|               (y_dist == best_y_dist && x_dist < best_x_dist)) | ||||
|             { | ||||
|               best_key = key; | ||||
|               best_x_dist = x_dist; | ||||
|               best_y_dist = y_dist; | ||||
|              } | ||||
|  | ||||
|           if (row->vertical) | ||||
|             y += (shape->bounds.y2 - shape->bounds.y1); | ||||
|           else | ||||
|             x += (shape->bounds.x2 - shape->bounds.x1); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   if (best_key == NULL) | ||||
|     goto out; | ||||
|  | ||||
|   /* Now we need to resolve the name of the best key back to a keycode */ | ||||
|   for (i = keyboard->min_key_code; i < keyboard->max_key_code; i++) | ||||
|     { | ||||
|       if (strncmp (best_key->name.name, keyboard->names->keys[i].name, XkbKeyNameLength) == 0) | ||||
|         { | ||||
|           best_keycode = i; | ||||
|           break; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  out: | ||||
|   XkbFreeKeyboard (keyboard, 0, True); | ||||
|  | ||||
|   return best_keycode; | ||||
| } | ||||
| #else /* !HAVE_XKB */ | ||||
| static guint | ||||
| compute_above_tab_keycode (Display *xdisplay) | ||||
| { | ||||
|   return XKeysymToKeycode (xdisplay, XK_grave); | ||||
| } | ||||
| #endif /* HAVE_XKB */ | ||||
|  | ||||
| guint | ||||
| meta_display_get_above_tab_keycode (MetaDisplay *display) | ||||
| { | ||||
|   if (display->above_tab_keycode == 0) /* not yet computed */ | ||||
|     display->above_tab_keycode = compute_above_tab_keycode (display->xdisplay); | ||||
|  | ||||
|   if (display->above_tab_keycode == (guint)-1) /* failed to compute */ | ||||
|     return 0; | ||||
|   else | ||||
|     return display->above_tab_keycode; | ||||
| } | ||||
| @@ -146,7 +146,7 @@ keybind (switch_to_workspace_down, handle_switch_to_workspace, | ||||
|  */ | ||||
| 
 | ||||
| keybind (switch_group,              handle_switch,        META_TAB_LIST_GROUP, | ||||
|          BINDING_REVERSES,       NULL, | ||||
|          BINDING_REVERSES,       "<Alt>Above_Tab", | ||||
|         _("Move between windows of an application, using a popup window")) | ||||
| keybind (switch_group_backward,    handle_switch,        META_TAB_LIST_GROUP, | ||||
|          REVERSES_AND_REVERSED,  NULL, | ||||
| @@ -167,7 +167,7 @@ keybind (switch_panels_backward,   handle_switch,        META_TAB_LIST_DOCKS, | ||||
|           "using a popup window")) | ||||
| 
 | ||||
| keybind (cycle_group,               handle_cycle,         META_TAB_LIST_GROUP, | ||||
|         BINDING_REVERSES,        "<Alt>grave", | ||||
|         BINDING_REVERSES,        "<Alt>F6", | ||||
|         _("Move between windows of an application immediately")) | ||||
| keybind (cycle_group_backward,     handle_cycle,         META_TAB_LIST_GROUP, | ||||
|         REVERSES_AND_REVERSED,   NULL, | ||||
| @@ -51,7 +51,7 @@ | ||||
| #include <config.h> | ||||
| #include "bell.h" | ||||
| #include "screen-private.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/prefs.h> | ||||
| #ifdef HAVE_LIBCANBERRA | ||||
| #include <canberra-gtk.h> | ||||
| #endif | ||||
| @@ -159,14 +159,22 @@ bell_flash_fullscreen (MetaDisplay *display, | ||||
|     { | ||||
|       screen = meta_display_screen_for_xwindow (display, xkb_bell_ev->window); | ||||
|       if (screen) | ||||
|         { | ||||
|           if (display->compositor) | ||||
|             meta_compositor_flash_screen (display->compositor, screen); | ||||
|           else | ||||
|             bell_flash_screen (display, screen); | ||||
|         } | ||||
|     } | ||||
|   else  | ||||
|     { | ||||
|       GSList *screen_list = display->screens; | ||||
|       while (screen_list)  | ||||
| 	{ | ||||
| 	  screen = (MetaScreen *) screen_list->data; | ||||
|           if (display->compositor) | ||||
|             meta_compositor_flash_screen (display->compositor, screen); | ||||
|           else | ||||
|             bell_flash_screen (display, screen); | ||||
| 	  screen_list = screen_list->next; | ||||
| 	} | ||||
|   | ||||
| @@ -36,7 +36,7 @@ | ||||
| #include <X11/XKBlib.h> | ||||
| #endif | ||||
| #include "display-private.h" | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
|  | ||||
| #ifdef HAVE_XKB | ||||
| /** | ||||
|   | ||||
| @@ -25,8 +25,8 @@ | ||||
| #define META_BOXES_PRIVATE_H | ||||
|  | ||||
| #include <glib-object.h> | ||||
| #include "common.h" | ||||
| #include "boxes.h" | ||||
| #include <meta/common.h> | ||||
| #include <meta/boxes.h> | ||||
|  | ||||
| #define BOX_LEFT(box)    ((box).x)                /* Leftmost pixel of rect */ | ||||
| #define BOX_RIGHT(box)   ((box).x + (box).width)  /* One pixel past right   */ | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
|  */ | ||||
|  | ||||
| #include "boxes-private.h" | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
| #include <X11/Xutil.h>  /* Just for the definition of the various gravities */ | ||||
|  | ||||
| /* It would make sense to use GSlice here, but until we clean up the | ||||
| @@ -179,6 +179,16 @@ meta_rectangle_area (const MetaRectangle *rect) | ||||
|   return rect->width * rect->height; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_rectangle_intersect: | ||||
|  * @src1: a #MetaRectangle | ||||
|  * @src2: another #MetaRectangle | ||||
|  * @dest: (out caller-allocates): an empty #MetaRectangle, to be filled | ||||
|  *   with the coordinates of the intersection. | ||||
|  * | ||||
|  * Returns: TRUE is some intersection exists and is not degenerate, FALSE | ||||
|  *   otherwise. | ||||
|  */ | ||||
| gboolean | ||||
| meta_rectangle_intersect (const MetaRectangle *src1, | ||||
| 			  const MetaRectangle *src2, | ||||
| @@ -226,6 +236,13 @@ meta_rectangle_equal (const MetaRectangle *src1, | ||||
|           (src1->height == src2->height)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_rectangle_union: | ||||
|  * @rect1: a #MetaRectangle | ||||
|  * @rect2: another #MetaRectangle | ||||
|  * @dest: (out caller-allocates): an empty #MetaRectangle, to be filled | ||||
|  *   with the coordinates of the bounding box. | ||||
|  */ | ||||
| void | ||||
| meta_rectangle_union (const MetaRectangle *rect1, | ||||
|                       const MetaRectangle *rect2, | ||||
| @@ -340,7 +357,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, | ||||
|    */ | ||||
|  | ||||
|   /* First, the x direction */ | ||||
|   int adjust = 0; | ||||
|   switch (gravity) | ||||
|     { | ||||
|     case NorthWestGravity: | ||||
| @@ -373,7 +389,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect, | ||||
|   rect->width = new_width; | ||||
|    | ||||
|   /* Next, the y direction */ | ||||
|   adjust = 0; | ||||
|   switch (gravity) | ||||
|     { | ||||
|     case NorthWestGravity: | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
| #include "constraints.h" | ||||
| #include "workspace-private.h" | ||||
| #include "place.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/prefs.h> | ||||
|  | ||||
| #include <stdlib.h> | ||||
| #include <math.h> | ||||
| @@ -142,6 +142,11 @@ typedef struct | ||||
|   GList  *usable_screen_region; | ||||
|   GList  *usable_monitor_region; | ||||
| } ConstraintInfo; | ||||
|  | ||||
| static gboolean do_screen_and_monitor_relative_constraints (MetaWindow     *window, | ||||
|                                                             GList          *region_spanning_rectangles, | ||||
|                                                             ConstraintInfo *info, | ||||
|                                                             gboolean        check_only); | ||||
| static gboolean constrain_modal_dialog       (MetaWindow         *window, | ||||
|                                               ConstraintInfo     *info, | ||||
|                                               ConstraintPriority  priority, | ||||
| @@ -776,7 +781,12 @@ constrain_modal_dialog (MetaWindow         *window, | ||||
|  | ||||
|   info->current.y = y; | ||||
|   info->current.x = x; | ||||
|   return TRUE; | ||||
|   /* The calculated position above may need adjustment to make sure the | ||||
|    * dialog does not end up partially off-screen */ | ||||
|   return do_screen_and_monitor_relative_constraints (window, | ||||
|                                                      info->usable_screen_region, | ||||
|                                                      info, | ||||
|                                                      check_only); | ||||
| } | ||||
|  | ||||
| static gboolean | ||||
| @@ -796,7 +806,7 @@ constrain_maximization (MetaWindow         *window, | ||||
|  | ||||
|   /* Determine whether constraint applies; exit if it doesn't */ | ||||
|   if ((!window->maximized_horizontally && !window->maximized_vertically) || | ||||
|       META_WINDOW_TILED (window)) | ||||
|       META_WINDOW_TILED_SIDE_BY_SIDE (window)) | ||||
|     return TRUE; | ||||
|  | ||||
|   /* Calculate target_size = maximized size of (window + frame) */ | ||||
| @@ -880,7 +890,7 @@ constrain_tiling (MetaWindow         *window, | ||||
|     return TRUE; | ||||
|  | ||||
|   /* Determine whether constraint applies; exit if it doesn't */ | ||||
|   if (!META_WINDOW_TILED (window)) | ||||
|   if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) | ||||
|     return TRUE; | ||||
|  | ||||
|   /* Calculate target_size - as the tile previews need this as well, we | ||||
| @@ -968,7 +978,8 @@ constrain_size_increments (MetaWindow         *window, | ||||
|  | ||||
|   /* Determine whether constraint applies; exit if it doesn't */ | ||||
|   if (META_WINDOW_MAXIMIZED (window) || window->fullscreen ||  | ||||
|       META_WINDOW_TILED (window) || info->action_type == ACTION_MOVE) | ||||
|       META_WINDOW_TILED_SIDE_BY_SIDE (window) || | ||||
|       info->action_type == ACTION_MOVE) | ||||
|     return TRUE; | ||||
|  | ||||
|   /* Determine whether constraint is already satisfied; exit if it is */ | ||||
| @@ -1099,7 +1110,8 @@ constrain_aspect_ratio (MetaWindow         *window, | ||||
|   constraints_are_inconsistent = minr > maxr; | ||||
|   if (constraints_are_inconsistent || | ||||
|       META_WINDOW_MAXIMIZED (window) || window->fullscreen ||  | ||||
|       META_WINDOW_TILED (window) || info->action_type == ACTION_MOVE) | ||||
|       META_WINDOW_TILED_SIDE_BY_SIDE (window) || | ||||
|       info->action_type == ACTION_MOVE) | ||||
|     return TRUE; | ||||
|  | ||||
|   /* Determine whether constraint is already satisfied; exit if it is.  We | ||||
|   | ||||
| @@ -25,9 +25,9 @@ | ||||
| #ifndef META_CONSTRAINTS_H | ||||
| #define META_CONSTRAINTS_H | ||||
|  | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
| #include "window-private.h" | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
|  | ||||
| typedef enum | ||||
| { | ||||
|   | ||||
| @@ -25,10 +25,10 @@ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "core.h" | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
| #include "workspace-private.h" | ||||
| #include "prefs.h" | ||||
| #include "errors.h" | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/errors.h> | ||||
|  | ||||
| /* Looks up the MetaWindow representing the frame of the given X window. | ||||
|  * Used as a helper function by a bunch of the functions below. | ||||
|   | ||||
| @@ -27,7 +27,7 @@ | ||||
| 
 | ||||
| /* Don't include core headers here */ | ||||
| #include <gdk/gdkx.h> | ||||
| #include "common.h" | ||||
| #include <meta/common.h> | ||||
| 
 | ||||
| typedef enum | ||||
| { | ||||
| @@ -25,10 +25,10 @@ | ||||
| #define _XOPEN_SOURCE /* for kill() */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
| #include "window-private.h" | ||||
| #include "errors.h" | ||||
| #include "workspace.h" | ||||
| #include <meta/errors.h> | ||||
| #include <meta/workspace.h> | ||||
|  | ||||
| #include <sys/types.h> | ||||
| #include <sys/wait.h> | ||||
| @@ -103,8 +103,8 @@ delete_ping_timeout_func (MetaDisplay *display, | ||||
|  | ||||
|   dialog_pid = | ||||
|     meta_show_dialog ("--question", | ||||
|                       window_content, 0, | ||||
|                       window->screen->number, | ||||
|                       window_content, NULL, | ||||
|                       window->screen->screen_name, | ||||
|                       _("_Wait"), _("_Force Quit"), window->xwindow, | ||||
|                       NULL, NULL); | ||||
|  | ||||
|   | ||||
| @@ -34,11 +34,11 @@ | ||||
| #include <glib.h> | ||||
| #include <X11/Xlib.h> | ||||
| #include "eventqueue.h" | ||||
| #include "common.h" | ||||
| #include "boxes.h" | ||||
| #include "display.h" | ||||
| #include <meta/common.h> | ||||
| #include <meta/boxes.h> | ||||
| #include <meta/display.h> | ||||
| #include "keybindings-private.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/prefs.h> | ||||
|  | ||||
| #ifdef HAVE_STARTUP_NOTIFICATION | ||||
| #include <libsn/sn.h> | ||||
| @@ -77,6 +77,13 @@ typedef enum { | ||||
|  */ | ||||
| #define N_IGNORED_SERIALS           4 | ||||
|  | ||||
| typedef enum { | ||||
|   META_TILE_NONE, | ||||
|   META_TILE_LEFT, | ||||
|   META_TILE_RIGHT, | ||||
|   META_TILE_MAXIMIZED | ||||
| } MetaTileMode; | ||||
|  | ||||
| struct _MetaDisplay | ||||
| { | ||||
|   GObject parent_instance; | ||||
| @@ -92,7 +99,7 @@ struct _MetaDisplay | ||||
|    * class is constructed. | ||||
|    */ | ||||
| #define item(x)  Atom atom_##x; | ||||
| #include "atomnames.h" | ||||
| #include <meta/atomnames.h> | ||||
| #undef item | ||||
|  | ||||
|   /* This is the actual window from focus events, | ||||
| @@ -179,6 +186,7 @@ struct _MetaDisplay | ||||
|   int         grab_anchor_root_x; | ||||
|   int         grab_anchor_root_y; | ||||
|   MetaRectangle grab_anchor_window_pos; | ||||
|   MetaTileMode  grab_tile_mode; | ||||
|   int         grab_latest_motion_x; | ||||
|   int         grab_latest_motion_y; | ||||
|   gulong      grab_mask; | ||||
| @@ -221,6 +229,7 @@ struct _MetaDisplay | ||||
|   KeySym *keymap; | ||||
|   int keysyms_per_keycode; | ||||
|   XModifierKeymap *modmap; | ||||
|   unsigned int above_tab_keycode; | ||||
|   unsigned int ignored_modifier_mask; | ||||
|   unsigned int num_lock_mask; | ||||
|   unsigned int scroll_lock_mask; | ||||
| @@ -433,4 +442,7 @@ void meta_display_remove_autoraise_callback (MetaDisplay *display); | ||||
|  | ||||
| void meta_display_overlay_key_activate (MetaDisplay *display); | ||||
|  | ||||
| /* In above-tab-keycode.c */ | ||||
| guint meta_display_get_above_tab_keycode (MetaDisplay *display); | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -34,21 +34,21 @@ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "display-private.h" | ||||
| #include "util.h" | ||||
| #include "main.h" | ||||
| #include <meta/util.h> | ||||
| #include <meta/main.h> | ||||
| #include "screen-private.h" | ||||
| #include "window-private.h" | ||||
| #include "window-props.h" | ||||
| #include "group-props.h" | ||||
| #include "frame-private.h" | ||||
| #include "errors.h" | ||||
| #include "frame.h" | ||||
| #include <meta/errors.h> | ||||
| #include "keybindings-private.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/prefs.h> | ||||
| #include "resizepopup.h" | ||||
| #include "xprops.h" | ||||
| #include "workspace-private.h" | ||||
| #include "bell.h" | ||||
| #include "compositor.h" | ||||
| #include <meta/compositor.h> | ||||
| #include <X11/Xatom.h> | ||||
| #include <X11/cursorfont.h> | ||||
| #ifdef HAVE_SOLARIS_XINERAMA | ||||
| @@ -387,26 +387,6 @@ enable_compositor (MetaDisplay *display, | ||||
|     } | ||||
| } | ||||
|  | ||||
| static void | ||||
| disable_compositor (MetaDisplay *display) | ||||
| { | ||||
|   GSList *list; | ||||
|    | ||||
|   if (!display->compositor) | ||||
|     return; | ||||
|    | ||||
|   for (list = display->screens; list != NULL; list = list->next) | ||||
|     { | ||||
|       MetaScreen *screen = list->data; | ||||
|        | ||||
|       meta_compositor_unmanage_screen (screen->display->compositor, | ||||
| 				       screen); | ||||
|     } | ||||
|    | ||||
|   meta_compositor_destroy (display->compositor); | ||||
|   display->compositor = NULL; | ||||
| } | ||||
|  | ||||
| static void | ||||
| meta_display_init (MetaDisplay *disp) | ||||
| { | ||||
| @@ -437,7 +417,7 @@ meta_display_open (void) | ||||
|   /* A list of all atom names, so that we can intern them in one go. */ | ||||
|   char *atom_names[] = { | ||||
| #define item(x) #x, | ||||
| #include "atomnames.h" | ||||
| #include <meta/atomnames.h> | ||||
| #undef item | ||||
|   }; | ||||
|   Atom atoms[G_N_ELEMENTS(atom_names)]; | ||||
| @@ -510,7 +490,7 @@ meta_display_open (void) | ||||
|   { | ||||
|     int i = 0;     | ||||
| #define item(x) the_display->atom_##x = atoms[i++]; | ||||
| #include "atomnames.h" | ||||
| #include <meta/atomnames.h> | ||||
| #undef item | ||||
|   } | ||||
|  | ||||
| @@ -573,6 +553,7 @@ meta_display_open (void) | ||||
|   the_display->grab_window = NULL; | ||||
|   the_display->grab_screen = NULL; | ||||
|   the_display->grab_resize_popup = NULL; | ||||
|   the_display->grab_tile_mode = META_TILE_NONE; | ||||
|  | ||||
|   the_display->grab_edge_resistance_data = NULL; | ||||
|  | ||||
| @@ -839,7 +820,6 @@ meta_display_open (void) | ||||
|   /* We don't composite the windows here because they will be composited  | ||||
|      faster with the call to meta_screen_manage_all_windows further down  | ||||
|      the code */ | ||||
|   if (1) /* meta_prefs_get_compositing_manager ()) FIXME */ | ||||
|   enable_compositor (the_display, FALSE); | ||||
|     | ||||
|   meta_display_grab (the_display); | ||||
| @@ -1766,9 +1746,10 @@ event_callback (XEvent   *event, | ||||
|        * we can get into a confused state. So if a keybinding is | ||||
|        * handled (because it's one of our hot-keys, or because we are | ||||
|        * in a keyboard-grabbed mode like moving a window, we don't | ||||
|        * want to pass the key event to the compositor at all. | ||||
|        * want to pass the key event to the compositor or GTK+ at all. | ||||
|        */ | ||||
|       bypass_compositor = meta_display_process_key_event (display, window, event); | ||||
|       if (meta_display_process_key_event (display, window, event)) | ||||
|         filter_out_event = bypass_compositor = TRUE; | ||||
|       break; | ||||
|     case ButtonPress: | ||||
|       if (display->grab_op == META_GRAB_OP_COMPOSITOR) | ||||
| @@ -2543,12 +2524,6 @@ event_callback (XEvent   *event, | ||||
|                       meta_workspace_focus_default_window (screen->active_workspace, NULL, timestamp); | ||||
|                     } | ||||
|                 } | ||||
|               else if (event->xclient.message_type == | ||||
|                        display->atom__MUTTER_RESTART_MESSAGE) | ||||
|                 { | ||||
|                   meta_verbose ("Received restart request\n"); | ||||
|                   meta_restart (); | ||||
|                 } | ||||
|               else if (event->xclient.message_type == | ||||
|                        display->atom__MUTTER_RELOAD_THEME_MESSAGE) | ||||
|                 { | ||||
| @@ -3519,6 +3494,7 @@ meta_display_begin_grab_op (MetaDisplay *display, | ||||
|                             int          root_x, | ||||
|                             int          root_y) | ||||
| { | ||||
|   MetaWindow *grab_window = NULL; | ||||
|   Window grab_xwindow; | ||||
|    | ||||
|   meta_topic (META_DEBUG_WINDOW_OPS, | ||||
| @@ -3548,14 +3524,25 @@ meta_display_begin_grab_op (MetaDisplay *display, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   /* If window is a modal dialog attached to its parent, | ||||
|    * grab the parent instead for moving. | ||||
|    */ | ||||
|   if (meta_prefs_get_attach_modal_dialogs () && | ||||
|       window && window->type == META_WINDOW_MODAL_DIALOG && | ||||
|       meta_grab_op_is_moving (op)) | ||||
|     grab_window = meta_window_get_transient_for (window); | ||||
|  | ||||
|   if (grab_window == NULL) | ||||
|     grab_window = window; | ||||
|  | ||||
|   /* FIXME: | ||||
|    *   If we have no MetaWindow we do our best | ||||
|    *   and try to do the grab on the RootWindow. | ||||
|    *   This will fail if anyone else has any | ||||
|    *   key grab on the RootWindow. | ||||
|    */ | ||||
|   if (window) | ||||
|     grab_xwindow = window->frame ? window->frame->xwindow : window->xwindow; | ||||
|   if (grab_window) | ||||
|     grab_xwindow = grab_window->frame ? grab_window->frame->xwindow : grab_window->xwindow; | ||||
|   else | ||||
|     grab_xwindow = screen->xroot; | ||||
|  | ||||
| @@ -3577,9 +3564,9 @@ meta_display_begin_grab_op (MetaDisplay *display, | ||||
|   /* Grab keys for keyboard ops and mouse move/resizes; see #126497 */ | ||||
|   if (grab_op_is_keyboard (op) || grab_op_is_mouse_only (op)) | ||||
|     { | ||||
|       if (window) | ||||
|       if (grab_window) | ||||
|         display->grab_have_keyboard = | ||||
|                      meta_window_grab_all_keys (window, timestamp); | ||||
|                      meta_window_grab_all_keys (grab_window, timestamp); | ||||
|  | ||||
|       else | ||||
|         display->grab_have_keyboard = | ||||
| @@ -3596,11 +3583,15 @@ meta_display_begin_grab_op (MetaDisplay *display, | ||||
|     } | ||||
|    | ||||
|   display->grab_op = op; | ||||
|   display->grab_window = window; | ||||
|   display->grab_window = grab_window; | ||||
|   display->grab_screen = screen; | ||||
|   display->grab_xwindow = grab_xwindow; | ||||
|   display->grab_button = button; | ||||
|   display->grab_mask = modmask; | ||||
|   if (window) | ||||
|     display->grab_tile_mode = window->tile_mode; | ||||
|   else | ||||
|     display->grab_tile_mode = META_TILE_NONE; | ||||
|   display->grab_anchor_root_x = root_x; | ||||
|   display->grab_anchor_root_y = root_y; | ||||
|   display->grab_latest_motion_x = root_x; | ||||
| @@ -3797,6 +3788,7 @@ meta_display_end_grab_op (MetaDisplay *display, | ||||
|   display->grab_window = NULL; | ||||
|   display->grab_screen = NULL; | ||||
|   display->grab_xwindow = None; | ||||
|   display->grab_tile_mode = META_TILE_NONE; | ||||
|   display->grab_op = META_GRAB_OP_NONE; | ||||
|  | ||||
|   if (display->grab_resize_popup) | ||||
| @@ -5188,15 +5180,6 @@ prefs_changed_callback (MetaPreference pref, | ||||
|     { | ||||
|       meta_bell_set_audible (display, meta_prefs_bell_is_audible ()); | ||||
|     } | ||||
|   else if (pref == META_PREF_COMPOSITING_MANAGER) | ||||
|     { | ||||
|       gboolean cm = meta_prefs_get_compositing_manager (); | ||||
|  | ||||
|       if (cm) | ||||
|         enable_compositor (display, TRUE); | ||||
|       else | ||||
| 	disable_compositor (display); | ||||
|     } | ||||
|   else if (pref == META_PREF_ATTACH_MODAL_DIALOGS) | ||||
|     { | ||||
|       MetaDisplay *display = data; | ||||
|   | ||||
| @@ -23,7 +23,7 @@ | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "display-private.h" | ||||
| #include <errno.h> | ||||
| #include <stdlib.h> | ||||
|   | ||||
| @@ -24,9 +24,9 @@ | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
| #include "bell.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "keybindings-private.h" | ||||
|  | ||||
| #include <X11/extensions/Xrender.h> | ||||
| @@ -282,7 +282,7 @@ meta_frame_get_flags (MetaFrame *frame) | ||||
|   if (frame->window->shaded) | ||||
|     flags |= META_FRAME_SHADED; | ||||
|  | ||||
|   if (frame->window->on_all_workspaces) | ||||
|   if (frame->window->on_all_workspaces_requested) | ||||
|     flags |= META_FRAME_STUCK; | ||||
|  | ||||
|   /* FIXME: Should we have some kind of UI for windows that are just vertically | ||||
| @@ -291,6 +291,12 @@ meta_frame_get_flags (MetaFrame *frame) | ||||
|   if (META_WINDOW_MAXIMIZED (frame->window)) | ||||
|     flags |= META_FRAME_MAXIMIZED; | ||||
|  | ||||
|   if (META_WINDOW_TILED_LEFT (frame->window)) | ||||
|     flags |= META_FRAME_TILED_LEFT; | ||||
|  | ||||
|   if (META_WINDOW_TILED_RIGHT (frame->window)) | ||||
|     flags |= META_FRAME_TILED_RIGHT; | ||||
|  | ||||
|   if (frame->window->fullscreen) | ||||
|     flags |= META_FRAME_FULLSCREEN; | ||||
|  | ||||
|   | ||||
| @@ -24,7 +24,6 @@ | ||||
| #ifndef META_FRAME_PRIVATE_H | ||||
| #define META_FRAME_PRIVATE_H | ||||
| 
 | ||||
| #include "frame.h" | ||||
| #include "window-private.h" | ||||
| 
 | ||||
| typedef struct _MetaFrameGeometry MetaFrameGeometry; | ||||
| @@ -69,6 +68,7 @@ void     meta_window_destroy_frame          (MetaWindow *window); | ||||
| void     meta_frame_queue_draw              (MetaFrame  *frame); | ||||
| 
 | ||||
| MetaFrameFlags meta_frame_get_flags   (MetaFrame *frame); | ||||
| Window         meta_frame_get_xwindow (MetaFrame *frame); | ||||
| 
 | ||||
| /* These should ONLY be called from meta_window_move_resize_internal */ | ||||
| void meta_frame_calc_geometry      (MetaFrame         *frame, | ||||
| @@ -24,7 +24,7 @@ | ||||
| #ifndef META_GROUP_PRIVATE_H | ||||
| #define META_GROUP_PRIVATE_H | ||||
|  | ||||
| #include "group.h" | ||||
| #include <meta/group.h> | ||||
|  | ||||
| struct _MetaGroup | ||||
| { | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
| #ifndef META_GROUP_PROPS_H | ||||
| #define META_GROUP_PROPS_H | ||||
|  | ||||
| #include "group.h" | ||||
| #include <meta/group.h> | ||||
| #include "window-private.h" | ||||
|  | ||||
| void meta_group_reload_property         (MetaGroup   *group, | ||||
|   | ||||
| @@ -23,11 +23,11 @@ | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
| #include "group-private.h" | ||||
| #include "group-props.h" | ||||
| #include "window-private.h" | ||||
| #include "window.h" | ||||
| #include <meta/window.h> | ||||
|  | ||||
| static MetaGroup* | ||||
| meta_group_new (MetaDisplay *display, | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
| #include <config.h> | ||||
| #include "iconcache.h" | ||||
| #include "ui.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
|  | ||||
| #include <X11/Xatom.h> | ||||
|  | ||||
| @@ -323,6 +323,40 @@ get_pixmap_geometry (MetaDisplay *display, | ||||
|     *d = depth; | ||||
| } | ||||
|  | ||||
| static void | ||||
| apply_foreground_background (GdkPixbuf *pixbuf) | ||||
| { | ||||
|   int w, h; | ||||
|   int i, j; | ||||
|   guchar *pixels; | ||||
|   int stride; | ||||
|  | ||||
|   w = gdk_pixbuf_get_width (pixbuf); | ||||
|   h = gdk_pixbuf_get_height (pixbuf); | ||||
|   pixels = gdk_pixbuf_get_pixels (pixbuf); | ||||
|   stride = gdk_pixbuf_get_rowstride (pixbuf); | ||||
|  | ||||
|   i = 0; | ||||
|   while (i < h) | ||||
|     { | ||||
|       j = 0; | ||||
|       while (j < w) | ||||
|         { | ||||
|           guchar *p = pixels + i * stride + j * 4; | ||||
|           if (p[3] == 0) | ||||
|             p[0] = p[1] = p[2] =  0xff; /* white background */ | ||||
|           else | ||||
|             p[0] = p[1] = p[2] = 0x00; /* black foreground */ | ||||
|  | ||||
|           p[3] = 0xff; | ||||
|  | ||||
|           ++j; | ||||
|         } | ||||
|  | ||||
|       ++i; | ||||
|     } | ||||
| } | ||||
|  | ||||
| static GdkPixbuf* | ||||
| apply_mask (GdkPixbuf *pixbuf, | ||||
|             GdkPixbuf *mask) | ||||
| @@ -352,16 +386,10 @@ apply_mask (GdkPixbuf *pixbuf, | ||||
|       j = 0; | ||||
|       while (j < w) | ||||
|         { | ||||
|           guchar *s = src + i * src_stride + j * 3; | ||||
|           guchar *s = src + i * src_stride + j * 4; | ||||
|           guchar *d = dest + i * dest_stride + j * 4; | ||||
|  | ||||
|           /* s[0] == s[1] == s[2], they are 255 if the bit was set, 0 | ||||
|            * otherwise | ||||
|            */ | ||||
|           if (s[0] == 0) | ||||
|             d[3] = 0;   /* transparent */ | ||||
|           else | ||||
|             d[3] = 255; /* opaque */ | ||||
|           d[3] = s[3]; | ||||
|  | ||||
|           ++j; | ||||
|         } | ||||
| @@ -385,22 +413,29 @@ try_pixmap_and_mask (MetaDisplay *display, | ||||
| { | ||||
|   GdkPixbuf *unscaled = NULL; | ||||
|   GdkPixbuf *mask = NULL; | ||||
|   int w, h; | ||||
|   int w, h, d; | ||||
|  | ||||
|   if (src_pixmap == None) | ||||
|     return FALSE; | ||||
|  | ||||
|   meta_error_trap_push (display); | ||||
|  | ||||
|   get_pixmap_geometry (display, src_pixmap, &w, &h, NULL); | ||||
|   get_pixmap_geometry (display, src_pixmap, &w, &h, &d); | ||||
|  | ||||
|   unscaled = meta_gdk_pixbuf_get_from_pixmap (src_pixmap, | ||||
|                                               0, 0, | ||||
|                                               w, h); | ||||
|  | ||||
|   /* A depth 1 pixmap has 0 background, and 1 foreground, but | ||||
|    * cairo and meta_gdk_pixbuf_get_from_pixmap consider it | ||||
|    * to be 0 transparent, 1 opaque */ | ||||
|   if (d == 1) | ||||
|     apply_foreground_background (unscaled); | ||||
|  | ||||
|   if (unscaled && src_mask != None) | ||||
|     { | ||||
|       get_pixmap_geometry (display, src_mask, &w, &h, NULL); | ||||
|       get_pixmap_geometry (display, src_mask, &w, &h, &d); | ||||
|       if (d == 1) | ||||
|         mask = meta_gdk_pixbuf_get_from_pixmap (src_mask, | ||||
|                                                 0, 0, | ||||
|                                                 w, h); | ||||
|   | ||||
| @@ -29,7 +29,7 @@ | ||||
| #ifndef META_KEYBINDINGS_PRIVATE_H | ||||
| #define META_KEYBINDINGS_PRIVATE_H | ||||
|  | ||||
| #include "keybindings.h" | ||||
| #include <meta/keybindings.h> | ||||
|  | ||||
| void     meta_display_init_keys             (MetaDisplay *display); | ||||
| void     meta_display_shutdown_keys         (MetaDisplay *display); | ||||
|   | ||||
| @@ -29,13 +29,13 @@ | ||||
| #include <config.h> | ||||
| #include "keybindings-private.h" | ||||
| #include "workspace-private.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "edge-resistance.h" | ||||
| #include "ui.h" | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
| #include "place.h" | ||||
| #include "prefs.h" | ||||
| #include "util.h" | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/util.h> | ||||
|  | ||||
| #include <X11/keysym.h> | ||||
| #include <string.h> | ||||
| @@ -117,6 +117,10 @@ reload_keymap (MetaDisplay *display) | ||||
|   if (display->keymap) | ||||
|     meta_XFree (display->keymap); | ||||
|  | ||||
|   /* This is expensive to compute, so we'll lazily load if and when we first | ||||
|    * need it */ | ||||
|   display->above_tab_keycode = 0; | ||||
|  | ||||
|   display->keymap = XGetKeyboardMapping (display->xdisplay, | ||||
|                                          display->min_keycode, | ||||
|                                          display->max_keycode - | ||||
| @@ -228,6 +232,16 @@ reload_modmap (MetaDisplay *display) | ||||
|               display->meta_mask); | ||||
| } | ||||
|  | ||||
| static guint | ||||
| keysym_to_keycode (MetaDisplay *display, | ||||
|                    guint        keysym) | ||||
| { | ||||
|   if (keysym == META_KEY_ABOVE_TAB) | ||||
|     return meta_display_get_above_tab_keycode (display); | ||||
|   else | ||||
|     return XKeysymToKeycode (display->xdisplay, keysym); | ||||
| } | ||||
|  | ||||
| static void | ||||
| reload_keycodes (MetaDisplay *display) | ||||
| { | ||||
| @@ -236,8 +250,8 @@ reload_keycodes (MetaDisplay *display) | ||||
|  | ||||
|   if (display->overlay_key_combo.keysym != 0) | ||||
|     { | ||||
|       display->overlay_key_combo.keycode = XKeysymToKeycode ( | ||||
|           display->xdisplay, display->overlay_key_combo.keysym); | ||||
|       display->overlay_key_combo.keycode = | ||||
|         keysym_to_keycode (display, display->overlay_key_combo.keysym); | ||||
|     } | ||||
|    | ||||
|   if (display->key_bindings) | ||||
| @@ -249,8 +263,8 @@ reload_keycodes (MetaDisplay *display) | ||||
|         { | ||||
|           if (display->key_bindings[i].keysym != 0) | ||||
|             { | ||||
|               display->key_bindings[i].keycode = XKeysymToKeycode ( | ||||
|                       display->xdisplay, display->key_bindings[i].keysym); | ||||
|               display->key_bindings[i].keycode = | ||||
|                 keysym_to_keycode (display, display->key_bindings[i].keysym); | ||||
|             } | ||||
|            | ||||
|           ++i; | ||||
| @@ -521,6 +535,9 @@ meta_display_get_keybinding_action (MetaDisplay  *display, | ||||
|   mask = mask & 0xff & ~display->ignored_modifier_mask; | ||||
|   binding = display_get_keybinding (display, keysym, keycode, mask); | ||||
|  | ||||
|   if (!binding && keycode == meta_display_get_above_tab_keycode (display)) | ||||
|     binding = display_get_keybinding (display, META_KEY_ABOVE_TAB, keycode, mask); | ||||
|  | ||||
|   if (binding) | ||||
|     return meta_prefs_get_keybinding_action (binding->name); | ||||
|   else | ||||
| @@ -1534,15 +1551,24 @@ process_mouse_move_resize_grab (MetaDisplay *display, | ||||
|  | ||||
|   if (keysym == XK_Escape) | ||||
|     { | ||||
|       /* Hide the tiling preview if necessary */ | ||||
|       if (window->tile_mode != META_TILE_NONE) | ||||
|         meta_screen_tile_preview_hide (screen); | ||||
|  | ||||
|       /* Restore the original tile mode */ | ||||
|       window->tile_mode = display->grab_tile_mode; | ||||
|  | ||||
|       /* End move or resize and restore to original state.  If the | ||||
|        * window was a maximized window that had been "shaken loose" we | ||||
|        * need to remaximize it.  In normal cases, we need to do a | ||||
|        * moveresize now to get the position back to the original. | ||||
|        */ | ||||
|       if (window->shaken_loose) | ||||
|       if (window->shaken_loose || window->tile_mode == META_TILE_MAXIMIZED) | ||||
|         meta_window_maximize (window, | ||||
|                               META_MAXIMIZE_HORIZONTAL | | ||||
|                               META_MAXIMIZE_VERTICAL); | ||||
|       else if (window->tile_mode != META_TILE_NONE) | ||||
|         meta_window_tile (window); | ||||
|       else | ||||
|         meta_window_move_resize (display->grab_window, | ||||
|                                  TRUE, | ||||
| @@ -2418,7 +2444,7 @@ static void | ||||
| error_on_command (int         command_index, | ||||
|                   const char *command, | ||||
|                   const char *message, | ||||
|                   int         screen_number, | ||||
|                   MetaScreen *screen, | ||||
|                   guint32     timestamp) | ||||
| { | ||||
|   if (command_index < 0) | ||||
| @@ -2447,7 +2473,7 @@ error_on_command (int         command_index, | ||||
|       meta_show_dialog ("--error", | ||||
|                         text, | ||||
|                         NULL, | ||||
|                         screen_number, | ||||
|                         screen->screen_name, | ||||
|                         NULL, NULL, 0, | ||||
|                         NULL, NULL); | ||||
|  | ||||
| @@ -2459,7 +2485,7 @@ error_on_command (int         command_index, | ||||
|       meta_show_dialog ("--error", | ||||
|                         message, | ||||
|                         NULL, | ||||
|                         screen_number, | ||||
|                         screen->screen_name, | ||||
|                         NULL, NULL, 0, | ||||
|                         NULL, NULL); | ||||
|     } | ||||
| @@ -2531,7 +2557,7 @@ handle_run_command (MetaDisplay    *display, | ||||
|        | ||||
|       s = g_strdup_printf (_("No command %d has been defined.\n"), | ||||
|                            which + 1); | ||||
|       error_on_command (which, NULL, s, screen->number, event->xkey.time); | ||||
|       error_on_command (which, NULL, s, screen, event->xkey.time); | ||||
|       g_free (s); | ||||
|        | ||||
|       return; | ||||
| @@ -2540,7 +2566,7 @@ handle_run_command (MetaDisplay    *display, | ||||
|   err = NULL; | ||||
|   if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) | ||||
|     { | ||||
|       error_on_command (which, command, err->message, screen->number, event->xkey.time); | ||||
|       error_on_command (which, command, err->message, screen, event->xkey.time); | ||||
|        | ||||
|       g_error_free (err); | ||||
|     } | ||||
| @@ -3315,7 +3341,7 @@ handle_toggle_on_all_workspaces (MetaDisplay    *display, | ||||
|                            MetaKeyBinding *binding, | ||||
|                            gpointer        dummy) | ||||
| { | ||||
|   if (window->on_all_workspaces) | ||||
|   if (window->on_all_workspaces_requested) | ||||
|     meta_window_unstick (window); | ||||
|   else | ||||
|     meta_window_stick (window); | ||||
| @@ -3542,7 +3568,7 @@ handle_run_terminal (MetaDisplay    *display, | ||||
| 		  "keybinding press\n"); | ||||
|        | ||||
|       s = g_strdup_printf (_("No terminal command has been defined.\n")); | ||||
|       error_on_command (-1, NULL, s, screen->number, event->xkey.time); | ||||
|       error_on_command (-1, NULL, s, screen, event->xkey.time); | ||||
|       g_free (s); | ||||
|        | ||||
|       return; | ||||
| @@ -3551,7 +3577,7 @@ handle_run_terminal (MetaDisplay    *display, | ||||
|   err = NULL; | ||||
|   if (!meta_spawn_command_line_async_on_screen (command, screen, &err)) | ||||
|     { | ||||
|       error_on_command (-1, command, err->message, screen->number, | ||||
|       error_on_command (-1, command, err->message, screen, | ||||
|                         event->xkey.time); | ||||
|        | ||||
|       g_error_free (err); | ||||
|   | ||||
							
								
								
									
										349
									
								
								src/core/main.c
									
									
									
									
									
								
							
							
						
						
									
										349
									
								
								src/core/main.c
									
									
									
									
									
								
							| @@ -45,14 +45,14 @@ | ||||
| #define _SVID_SOURCE /* for putenv() and some signal-related functions */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "main.h" | ||||
| #include "util.h" | ||||
| #include <meta/main.h> | ||||
| #include <meta/util.h> | ||||
| #include "display-private.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "ui.h" | ||||
| #include "session.h" | ||||
| #include "prefs.h" | ||||
| #include "compositor.h" | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/compositor.h> | ||||
|  | ||||
| #include <glib-object.h> | ||||
| #include <gdk/gdkx.h> | ||||
| @@ -75,7 +75,6 @@ | ||||
|  | ||||
| #ifdef HAVE_INTROSPECTION | ||||
| #include <girepository.h> | ||||
| #include "compositor/meta-plugin-manager.h" | ||||
| #endif | ||||
|  | ||||
| /** | ||||
| @@ -89,12 +88,6 @@ static MetaExitCode meta_exit_code = META_EXIT_SUCCESS; | ||||
|  */ | ||||
| static GMainLoop *meta_main_loop = NULL; | ||||
|  | ||||
| /** | ||||
|  * If set, Mutter will spawn an identical copy of itself immediately | ||||
|  * before quitting. | ||||
|  */ | ||||
| static gboolean meta_restart_after_quit = FALSE; | ||||
|  | ||||
| static void prefs_changed_callback (MetaPreference pref, | ||||
|                                     gpointer       data); | ||||
|  | ||||
| @@ -118,23 +111,6 @@ log_handler (const gchar   *log_domain, | ||||
|   meta_print_backtrace (); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Prints the version notice. This is shown when Mutter is called | ||||
|  * with the --version switch. | ||||
|  */ | ||||
| static void | ||||
| version (void) | ||||
| { | ||||
|   const int latest_year = 2010; | ||||
|  | ||||
|   g_print (_("mutter %s\n" | ||||
|              "Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n" | ||||
|              "This is free software; see the source for copying conditions.\n" | ||||
|              "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"), | ||||
|            VERSION, latest_year); | ||||
|   exit (0); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Prints a list of which configure script options were used to | ||||
|  * build this copy of Mutter. This is actually always called | ||||
| @@ -214,143 +190,72 @@ meta_print_self_identity (void) | ||||
|  | ||||
| /** | ||||
|  * The set of possible options that can be set on Mutter's | ||||
|  * command line. This type exists so that meta_parse_options() can | ||||
|  * write to an instance of it. | ||||
|  * command line. | ||||
|  */ | ||||
| typedef struct | ||||
| { | ||||
|   gchar *save_file; | ||||
|   gchar *display_name; | ||||
|   gchar *client_id; | ||||
|   gchar *mutter_plugins; | ||||
|   gboolean replace_wm; | ||||
|   gboolean disable_sm; | ||||
|   gboolean print_version; | ||||
|   gboolean sync; | ||||
|   gboolean composite; | ||||
|   gboolean no_composite; | ||||
|   gboolean no_force_fullscreen; | ||||
|   gboolean no_tab_popup; | ||||
|   gchar *introspect; | ||||
| } MetaArguments; | ||||
| static gchar    *opt_save_file; | ||||
| static gchar    *opt_display_name; | ||||
| static gchar    *opt_client_id; | ||||
| static gboolean  opt_replace_wm; | ||||
| static gboolean  opt_disable_sm; | ||||
| static gboolean  opt_sync; | ||||
|  | ||||
| #define COMPOSITE_OPTS_FLAGS 0 | ||||
|  | ||||
| /** | ||||
|  * Parses argc and argv and returns the | ||||
|  * arguments that Mutter understands in meta_args. | ||||
|  * | ||||
|  * The strange call signature has to be written like it is so | ||||
|  * that g_option_context_parse() gets a chance to modify argc and | ||||
|  * argv. | ||||
|  * | ||||
|  * \param argc  Pointer to the number of arguments Mutter was given | ||||
|  * \param argv  Pointer to the array of arguments Mutter was given | ||||
|  * \param meta_args  The result of parsing the arguments. | ||||
|  **/ | ||||
| static GOptionContext * | ||||
| meta_parse_options (int *argc, char ***argv, | ||||
|                     MetaArguments *meta_args) | ||||
| { | ||||
|   MetaArguments my_args = {NULL, NULL, NULL, NULL, | ||||
|                            FALSE, FALSE, FALSE, FALSE, FALSE}; | ||||
|   GOptionEntry options[] = { | ||||
| static GOptionEntry meta_options[] = { | ||||
|   { | ||||
|     "sm-disable", 0, 0, G_OPTION_ARG_NONE, | ||||
|       &my_args.disable_sm, | ||||
|     &opt_disable_sm, | ||||
|     N_("Disable connection to session manager"), | ||||
|     NULL | ||||
|   }, | ||||
|   { | ||||
|     "replace", 0, 0, G_OPTION_ARG_NONE, | ||||
|       &my_args.replace_wm, | ||||
|       N_("Replace the running window manager with Mutter"), | ||||
|     &opt_replace_wm, | ||||
|     N_("Replace the running window manager"), | ||||
|     NULL | ||||
|   }, | ||||
|   { | ||||
|     "sm-client-id", 0, 0, G_OPTION_ARG_STRING, | ||||
|       &my_args.client_id, | ||||
|     &opt_client_id, | ||||
|     N_("Specify session management ID"), | ||||
|     "ID" | ||||
|   }, | ||||
|   { | ||||
|     "display", 'd', 0, G_OPTION_ARG_STRING, | ||||
|       &my_args.display_name, N_("X Display to use"), | ||||
|     &opt_display_name, N_("X Display to use"), | ||||
|     "DISPLAY" | ||||
|   }, | ||||
|   { | ||||
|     "sm-save-file", 0, 0, G_OPTION_ARG_FILENAME, | ||||
|       &my_args.save_file, | ||||
|     &opt_save_file, | ||||
|     N_("Initialize session from savefile"), | ||||
|     "FILE" | ||||
|   }, | ||||
|     { | ||||
|       "version", 0, 0, G_OPTION_ARG_NONE, | ||||
|       &my_args.print_version, | ||||
|       N_("Print version"), | ||||
|       NULL | ||||
|     }, | ||||
|   { | ||||
|     "sync", 0, 0, G_OPTION_ARG_NONE, | ||||
|       &my_args.sync, | ||||
|     &opt_sync, | ||||
|     N_("Make X calls synchronous"), | ||||
|     NULL | ||||
|   }, | ||||
|     { | ||||
|       "composite", 'c', COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, | ||||
|       &my_args.composite, | ||||
|       N_("Turn compositing on"), | ||||
|       NULL | ||||
|     }, | ||||
|     { | ||||
|       "no-composite", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, | ||||
|       &my_args.no_composite, | ||||
|       N_("Turn compositing off"), | ||||
|       NULL | ||||
|     }, | ||||
|     { | ||||
|       "no-force-fullscreen", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, | ||||
|       &my_args.no_force_fullscreen, | ||||
|       N_("Don't make fullscreen windows that are maximized and have no decorations"), | ||||
|       NULL | ||||
|     }, | ||||
|     { | ||||
|       "mutter-plugins", 0, 0, G_OPTION_ARG_STRING, | ||||
|       &my_args.mutter_plugins, | ||||
|       N_("Comma-separated list of compositor plugins"), | ||||
|       "PLUGINS" | ||||
|     }, | ||||
|     { | ||||
|       "no-tab-popup", 0, 0, G_OPTION_ARG_NONE, | ||||
|       &my_args.no_tab_popup, | ||||
|       N_("Whether window popup/frame should be shown when cycling windows."), | ||||
|       NULL | ||||
|     }, | ||||
| #ifdef HAVE_INTROSPECTION | ||||
|     { | ||||
|       "introspect-dump", 0, 0, G_OPTION_ARG_STRING, | ||||
|       &my_args.introspect, | ||||
|       N_("Internal argument for GObject introspection"), "INTROSPECT" | ||||
|     }, | ||||
| #endif | ||||
|   {NULL} | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * meta_get_option_context: (skip) | ||||
|  * | ||||
|  * Returns a #GOptionContext initialized with mutter-related options. | ||||
|  * Parse the command-line args with this before calling meta_init(). | ||||
|  * | ||||
|  * Return value: the #GOptionContext | ||||
|  */ | ||||
| GOptionContext * | ||||
| meta_get_option_context (void) | ||||
| { | ||||
|   GOptionContext *ctx; | ||||
|   GError *error = NULL; | ||||
|  | ||||
|   ctx = g_option_context_new (NULL); | ||||
|   g_option_context_add_main_entries (ctx, options, "mutter"); | ||||
|   g_option_context_add_main_entries (ctx, meta_options, GETTEXT_PACKAGE); | ||||
|   g_option_context_add_group (ctx, clutter_get_option_group_without_init ()); | ||||
|   g_option_context_add_group (ctx, cogl_get_option_group ()); | ||||
|  | ||||
|   if (!g_option_context_parse (ctx, argc, argv, &error)) | ||||
|     { | ||||
|       g_print ("mutter: %s\n", error->message); | ||||
|       exit(1); | ||||
|     } | ||||
|  | ||||
|   /* Return the parsed options through the meta_args param. */ | ||||
|   *meta_args = my_args; | ||||
|   return ctx; | ||||
| } | ||||
|  | ||||
| @@ -399,12 +304,12 @@ static GSourceFuncs event_funcs = { | ||||
| }; | ||||
|  | ||||
| static void | ||||
| meta_clutter_init (GOptionContext *ctx, int *argc, char ***argv) | ||||
| meta_clutter_init (void) | ||||
| { | ||||
|   clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); | ||||
|   clutter_x11_disable_event_retrieval (); | ||||
|    | ||||
|   if (CLUTTER_INIT_SUCCESS == clutter_init (argc, argv)) | ||||
|   if (CLUTTER_INIT_SUCCESS == clutter_init (NULL, NULL)) | ||||
|     { | ||||
|       GSource *source = g_source_new (&event_funcs, sizeof (GSource)); | ||||
|       g_source_attach (source, NULL); | ||||
| @@ -443,8 +348,6 @@ meta_finalize (void) | ||||
|   if (display) | ||||
|     meta_display_close (display, | ||||
|                         CurrentTime); /* I doubt correct timestamps matter here */ | ||||
|  | ||||
|   meta_session_shutdown (); | ||||
| } | ||||
|  | ||||
| static int sigterm_pipe_fds[2] = { -1, -1 }; | ||||
| @@ -454,7 +357,7 @@ sigterm_handler (int signum) | ||||
| { | ||||
|   if (sigterm_pipe_fds[1] >= 0) | ||||
|     { | ||||
|       int dummy; | ||||
|       int G_GNUC_UNUSED dummy; | ||||
|  | ||||
|       dummy = write (sigterm_pipe_fds[1], "", 1); | ||||
|       close (sigterm_pipe_fds[1]); | ||||
| @@ -470,32 +373,17 @@ on_sigterm (void) | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * This is where the story begins. It parses commandline options and | ||||
|  * environment variables, sets up the screen, hands control off to | ||||
|  * GTK, and cleans up afterwards. | ||||
|  * meta_init: (skip) | ||||
|  * | ||||
|  * \param argc Number of arguments (as usual) | ||||
|  * \param argv Array of arguments (as usual) | ||||
|  * | ||||
|  * \bug It's a bit long. It would be good to split it out into separate | ||||
|  * functions. | ||||
|  * Initialize mutter. Call this after meta_get_option_context() and | ||||
|  * meta_plugin_type_register(), and before meta_run(). | ||||
|  */ | ||||
| int | ||||
| main (int argc, char **argv) | ||||
| void | ||||
| meta_init (void) | ||||
| { | ||||
|   struct sigaction act; | ||||
|   sigset_t empty_mask; | ||||
|   MetaArguments meta_args; | ||||
|   const gchar *log_domains[] = { | ||||
|     NULL, G_LOG_DOMAIN, "Gtk", "Gdk", "GLib", | ||||
|     "Pango", "GLib-GObject", "GThread" | ||||
|   }; | ||||
|   guint i; | ||||
|   GIOChannel *channel; | ||||
|   GOptionContext *ctx; | ||||
|  | ||||
|   if (!g_thread_supported ()) | ||||
|     g_thread_init (NULL); | ||||
|  | ||||
|   if (setlocale (LC_ALL, "") == NULL) | ||||
|     meta_warning ("Locale not understood by C library, internationalization will not work\n"); | ||||
| @@ -540,103 +428,61 @@ main (int argc, char **argv) | ||||
|       meta_warning ("Could not change to home directory %s.\n", | ||||
|                     g_get_home_dir ()); | ||||
|  | ||||
|   g_type_init (); | ||||
|  | ||||
|   meta_print_self_identity (); | ||||
|    | ||||
|   bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR); | ||||
|   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); | ||||
|   textdomain (GETTEXT_PACKAGE); | ||||
|  | ||||
|   /* Parse command line arguments.*/ | ||||
|   ctx = meta_parse_options (&argc, &argv, &meta_args); | ||||
|  | ||||
|   /* This must come before the introspect below, so we load all the plugins | ||||
|    * in order to get their get_type functions. | ||||
|    */ | ||||
|   if (meta_args.mutter_plugins) | ||||
|     { | ||||
|       char **plugins = g_strsplit (meta_args.mutter_plugins, ",", -1); | ||||
|       char **plugin; | ||||
|       GSList *plugins_list = NULL; | ||||
|  | ||||
|       for (plugin = plugins; *plugin; plugin++) | ||||
|         { | ||||
|           g_strstrip (*plugin); | ||||
|           plugins_list = g_slist_prepend (plugins_list, *plugin); | ||||
|         } | ||||
|  | ||||
|       plugins_list = g_slist_reverse (plugins_list); | ||||
|       meta_prefs_override_clutter_plugins (plugins_list); | ||||
|  | ||||
|       g_slist_free(plugins_list); | ||||
|       g_strfreev (plugins); | ||||
|     } | ||||
|  | ||||
| #ifdef HAVE_INTROSPECTION | ||||
|   g_irepository_prepend_search_path (MUTTER_PKGLIBDIR); | ||||
|   if (meta_args.introspect) | ||||
|     { | ||||
|       GError *error = NULL; | ||||
|       if (meta_args.mutter_plugins) | ||||
|         { | ||||
|           /* We need to load all plugins so that we can call their | ||||
|            * get_type functions.  We do not call | ||||
|            * mutter_plugin_manager_initialize because almost nothing else | ||||
|            * is initialized at this point, and we don't plan to run any real | ||||
|            * plugin code. | ||||
|            */ | ||||
|           MetaPluginManager *mgr = meta_plugin_manager_get_default (); | ||||
|           if (!meta_plugin_manager_load (mgr)) | ||||
|             g_critical ("failed to load plugins"); | ||||
|         } | ||||
|       if (!g_irepository_dump (meta_args.introspect, &error)) | ||||
|         { | ||||
|           g_printerr ("failed to dump: %s\n", error->message); | ||||
|           return 1; | ||||
|         } | ||||
|       return 0; | ||||
|     } | ||||
| #endif | ||||
|  | ||||
|   meta_set_syncing (meta_args.sync || (g_getenv ("MUTTER_SYNC") != NULL)); | ||||
|   meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL)); | ||||
|  | ||||
|   if (meta_args.print_version) | ||||
|     version (); | ||||
|   meta_select_display (opt_display_name); | ||||
|    | ||||
|   meta_select_display (meta_args.display_name); | ||||
|    | ||||
|   if (meta_args.replace_wm) | ||||
|   if (opt_replace_wm) | ||||
|     meta_set_replace_current_wm (TRUE); | ||||
|  | ||||
|   if (meta_args.save_file && meta_args.client_id) | ||||
|   if (opt_save_file && opt_client_id) | ||||
|     meta_fatal ("Can't specify both SM save file and SM client id\n"); | ||||
|    | ||||
|   meta_main_loop = g_main_loop_new (NULL, FALSE); | ||||
|    | ||||
|   meta_ui_init (&argc, &argv);   | ||||
|   meta_ui_init (); | ||||
|  | ||||
|   /* | ||||
|    * Clutter can only be initialized after the UI. | ||||
|    */ | ||||
|   meta_clutter_init (ctx, &argc, &argv); | ||||
|   meta_clutter_init (); | ||||
| } | ||||
|  | ||||
|   g_option_context_free (ctx); | ||||
| /** | ||||
|  * meta_run: (skip) | ||||
|  * | ||||
|  * Runs mutter. Call this after completing your own initialization. | ||||
|  * | ||||
|  * Return value: mutter's exit status | ||||
|  */ | ||||
| int | ||||
| meta_run (void) | ||||
| { | ||||
|   const gchar *log_domains[] = { | ||||
|     NULL, G_LOG_DOMAIN, "Gtk", "Gdk", "GLib", | ||||
|     "Pango", "GLib-GObject", "GThread" | ||||
|   }; | ||||
|   guint i; | ||||
|  | ||||
|   /* Load prefs */ | ||||
|   meta_prefs_init (); | ||||
|   meta_prefs_add_listener (prefs_changed_callback, NULL); | ||||
|  | ||||
|  | ||||
| #if 1 | ||||
|  | ||||
|   for (i=0; i<G_N_ELEMENTS(log_domains); i++) | ||||
|     g_log_set_handler (log_domains[i], | ||||
|                        G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, | ||||
|                        log_handler, NULL); | ||||
|  | ||||
| #endif | ||||
|  | ||||
|   if (g_getenv ("MUTTER_G_FATAL_WARNINGS") != NULL) | ||||
|     g_log_set_always_fatal (G_LOG_LEVEL_MASK); | ||||
|    | ||||
| @@ -680,41 +526,30 @@ main (int argc, char **argv) | ||||
|    * or we might try to manage a window before we have the session | ||||
|    * info | ||||
|    */ | ||||
|   if (!meta_args.disable_sm) | ||||
|   if (!opt_disable_sm) | ||||
|     { | ||||
|       if (meta_args.client_id == NULL) | ||||
|       if (opt_client_id == NULL) | ||||
|         { | ||||
|           const gchar *desktop_autostart_id; | ||||
|    | ||||
|           desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); | ||||
|   | ||||
|           if (desktop_autostart_id != NULL) | ||||
|             meta_args.client_id = g_strdup (desktop_autostart_id); | ||||
|             opt_client_id = g_strdup (desktop_autostart_id); | ||||
|         } | ||||
|  | ||||
|       /* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to | ||||
|        * use the same client id. */ | ||||
|       g_unsetenv ("DESKTOP_AUTOSTART_ID"); | ||||
|  | ||||
|       meta_session_init (meta_args.client_id, meta_args.save_file); | ||||
|       meta_session_init (opt_client_id, opt_save_file); | ||||
|     } | ||||
|   /* Free memory possibly allocated by the argument parsing which are | ||||
|    * no longer needed. | ||||
|    */ | ||||
|   g_free (meta_args.save_file); | ||||
|   g_free (meta_args.display_name); | ||||
|   g_free (meta_args.client_id); | ||||
|  | ||||
|   if (meta_args.composite || meta_args.no_composite) | ||||
|     meta_prefs_set_compositing_manager (meta_args.composite); | ||||
|  | ||||
|   if (meta_args.no_force_fullscreen) | ||||
|     meta_prefs_set_force_fullscreen (FALSE); | ||||
|  | ||||
|   if (meta_args.no_tab_popup) | ||||
|     { | ||||
|       meta_prefs_override_no_tab_popup (TRUE); | ||||
|     } | ||||
|   g_free (opt_save_file); | ||||
|   g_free (opt_display_name); | ||||
|   g_free (opt_client_id); | ||||
|  | ||||
|   if (!meta_display_open ()) | ||||
|     meta_exit (META_EXIT_ERROR); | ||||
| @@ -723,36 +558,15 @@ main (int argc, char **argv) | ||||
|  | ||||
|   meta_finalize (); | ||||
|  | ||||
|   if (meta_restart_after_quit) | ||||
|     { | ||||
|       GError *err; | ||||
|  | ||||
|       err = NULL; | ||||
|       if (!g_spawn_async (NULL, | ||||
|                           argv, | ||||
|                           NULL, | ||||
|                           G_SPAWN_SEARCH_PATH, | ||||
|                           NULL, | ||||
|                           NULL, | ||||
|                           NULL, | ||||
|                           &err)) | ||||
|         { | ||||
|           meta_fatal (_("Failed to restart: %s\n"), | ||||
|                       err->message); | ||||
|           g_error_free (err); /* not reached anyhow */ | ||||
|           meta_exit_code = META_EXIT_ERROR; | ||||
|         } | ||||
|     } | ||||
|    | ||||
|   return meta_exit_code; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Stops Mutter. This tells the event loop to stop processing; it is rather | ||||
|  * dangerous to use this rather than meta_restart() because this will leave | ||||
|  * the user with no window manager. We generally do this only if, for example, | ||||
|  * the session manager asks us to; we assume the session manager knows what | ||||
|  * it's talking about. | ||||
|  * Stops Mutter. This tells the event loop to stop processing; it is | ||||
|  * rather dangerous to use this because this will leave the user with | ||||
|  * no window manager. We generally do this only if, for example, the | ||||
|  * session manager asks us to; we assume the session manager knows | ||||
|  * what it's talking about. | ||||
|  * | ||||
|  * \param code The success or failure code to return to the calling process. | ||||
|  */ | ||||
| @@ -765,19 +579,6 @@ meta_quit (MetaExitCode code) | ||||
|     g_main_loop_quit (meta_main_loop); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Restarts Mutter. In practice, this tells the event loop to stop | ||||
|  * processing, having first set the meta_restart_after_quit flag which | ||||
|  * tells Mutter to spawn an identical copy of itself before quitting. | ||||
|  * This happens on receipt of a _MUTTER_RESTART_MESSAGE client event. | ||||
|  */ | ||||
| void | ||||
| meta_restart (void) | ||||
| { | ||||
|   meta_restart_after_quit = TRUE; | ||||
|   meta_quit (META_EXIT_SUCCESS); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Called on pref changes. (One of several functions of its kind and purpose.) | ||||
|  * | ||||
|   | ||||
							
								
								
									
										99
									
								
								src/core/mutter.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								src/core/mutter.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,99 @@ | ||||
| /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ | ||||
|  | ||||
| /* | ||||
|  * Copyright 2011 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 | ||||
|  * 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 <stdlib.h> | ||||
|  | ||||
| #include <meta/main.h> | ||||
| #include <meta/util.h> | ||||
| #ifdef HAVE_INTROSPECTION | ||||
| #include "meta-plugin-manager.h" | ||||
| #endif | ||||
|  | ||||
| #include <glib.h> | ||||
|  | ||||
| static gboolean | ||||
| print_version (const gchar    *option_name, | ||||
|                const gchar    *value, | ||||
|                gpointer        data, | ||||
|                GError        **error) | ||||
| { | ||||
|   const int latest_year = 2011; | ||||
|  | ||||
|   g_print (_("mutter %s\n" | ||||
|              "Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n" | ||||
|              "This is free software; see the source for copying conditions.\n" | ||||
|              "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"), | ||||
|            VERSION, latest_year); | ||||
|   exit (0); | ||||
| } | ||||
|  | ||||
| static gchar *mutter_plugins; | ||||
|  | ||||
| GOptionEntry mutter_options[] = { | ||||
|   { | ||||
|     "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, | ||||
|     print_version, | ||||
|     N_("Print version"), | ||||
|     NULL | ||||
|   }, | ||||
|   { | ||||
|     "mutter-plugins", 0, 0, G_OPTION_ARG_STRING, | ||||
|     &mutter_plugins, | ||||
|     N_("Comma-separated list of compositor plugins"), | ||||
|     "PLUGINS" | ||||
|   }, | ||||
|   { NULL } | ||||
| }; | ||||
|  | ||||
| int | ||||
| main (int argc, char **argv) | ||||
| { | ||||
|   GOptionContext *ctx; | ||||
|   GError *error = NULL; | ||||
|  | ||||
|   ctx = meta_get_option_context (); | ||||
|   g_option_context_add_main_entries (ctx, mutter_options, GETTEXT_PACKAGE); | ||||
|   if (!g_option_context_parse (ctx, &argc, &argv, &error)) | ||||
|     { | ||||
|       g_printerr ("mutter: %s\n", error->message); | ||||
|       exit (1); | ||||
|     } | ||||
|  | ||||
|   if (mutter_plugins) | ||||
|     { | ||||
|       MetaPluginManager *mgr; | ||||
|       char **plugins = g_strsplit (mutter_plugins, ",", -1);  | ||||
|       char **plugin; | ||||
|  | ||||
|       mgr = meta_plugin_manager_get_default (); | ||||
|       for (plugin = plugins; *plugin; plugin++) | ||||
|         { | ||||
|           g_strstrip (*plugin); | ||||
|           meta_plugin_manager_load (mgr, *plugin); | ||||
|         } | ||||
|       g_strfreev (plugins); | ||||
|     } | ||||
|  | ||||
|   meta_init (); | ||||
|   return meta_run (); | ||||
| } | ||||
| @@ -28,8 +28,8 @@ | ||||
|  | ||||
| #include "boxes-private.h" | ||||
| #include "place.h" | ||||
| #include "workspace.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/workspace.h> | ||||
| #include <meta/prefs.h> | ||||
| #include <gdk/gdk.h> | ||||
| #include <math.h> | ||||
| #include <stdlib.h> | ||||
|   | ||||
| @@ -25,7 +25,7 @@ | ||||
| #define META_PLACE_H | ||||
|  | ||||
| #include "window-private.h" | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
|  | ||||
| void meta_window_place (MetaWindow *window, | ||||
|                         MetaFrameGeometry *fgeom, | ||||
|   | ||||
							
								
								
									
										168
									
								
								src/core/prefs.c
									
									
									
									
									
								
							
							
						
						
									
										168
									
								
								src/core/prefs.c
									
									
									
									
									
								
							| @@ -24,10 +24,10 @@ | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "prefs.h" | ||||
| #include <meta/prefs.h> | ||||
| #include "ui.h" | ||||
| #include "util.h" | ||||
| #include "compositor/meta-plugin-manager.h" | ||||
| #include <meta/util.h> | ||||
| #include "meta-plugin-manager.h" | ||||
| #ifdef HAVE_GCONF | ||||
| #include <gconf/gconf-client.h> | ||||
| #endif | ||||
| @@ -50,7 +50,6 @@ | ||||
|  */ | ||||
| #define KEY_TITLEBAR_FONT "/apps/metacity/general/titlebar_font" | ||||
| #define KEY_NUM_WORKSPACES "/apps/metacity/general/num_workspaces" | ||||
| #define KEY_COMPOSITOR "/apps/metacity/general/compositing_manager" | ||||
| #define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility" | ||||
|  | ||||
| #define KEY_COMMAND_DIRECTORY "/apps/metacity/keybinding_commands" | ||||
| @@ -67,9 +66,8 @@ | ||||
| #define KEY_WORKSPACE_NAME_DIRECTORY "/apps/metacity/workspace_names" | ||||
| #define KEY_WORKSPACE_NAME_PREFIX "/apps/metacity/workspace_names/name_" | ||||
|  | ||||
| #define KEY_CLUTTER_PLUGINS  "/apps/mutter/general/clutter_plugins" | ||||
|  | ||||
| #define KEY_LIVE_HIDDEN_WINDOWS "/apps/mutter/general/live_hidden_windows" | ||||
| #define KEY_WORKSPACES_ONLY_ON_PRIMARY "/apps/mutter/general/workspaces_only_on_primary" | ||||
|  | ||||
| #define KEY_NO_TAB_POPUP "/apps/metacity/general/no_tab_popup" | ||||
|  | ||||
| @@ -102,9 +100,8 @@ static gboolean gnome_accessibility = FALSE; | ||||
| static gboolean gnome_animations = TRUE; | ||||
| static char *cursor_theme = NULL; | ||||
| static int   cursor_size = 24; | ||||
| static gboolean compositing_manager = FALSE; | ||||
| static gboolean resize_with_right_button = FALSE; | ||||
| static gboolean side_by_side_tiling = FALSE; | ||||
| static gboolean edge_tiling = FALSE; | ||||
| static gboolean force_fullscreen = TRUE; | ||||
|  | ||||
| static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH; | ||||
| @@ -117,10 +114,8 @@ static char *terminal_command = NULL; | ||||
|  | ||||
| static char *workspace_names[MAX_REASONABLE_WORKSPACES] = { NULL, }; | ||||
|  | ||||
| static gboolean clutter_plugins_overridden = FALSE; | ||||
| static GSList *clutter_plugins = NULL; | ||||
|  | ||||
| static gboolean live_hidden_windows = FALSE; | ||||
| static gboolean workspaces_only_on_primary = FALSE; | ||||
|  | ||||
| static gboolean no_tab_popup = FALSE; | ||||
|  | ||||
| @@ -413,19 +408,14 @@ static MetaBoolPreference preferences_bool[] = | ||||
|       &gnome_animations, | ||||
|       TRUE, | ||||
|     }, | ||||
|     { "/apps/metacity/general/compositing_manager", | ||||
|       META_PREF_COMPOSITING_MANAGER, | ||||
|       &compositing_manager, | ||||
|       FALSE, | ||||
|     }, | ||||
|     { "/apps/metacity/general/resize_with_right_button", | ||||
|       META_PREF_RESIZE_WITH_RIGHT_BUTTON, | ||||
|       &resize_with_right_button, | ||||
|       FALSE, | ||||
|     }, | ||||
|     { "/apps/metacity/general/side_by_side_tiling", | ||||
|       META_PREF_SIDE_BY_SIDE_TILING, | ||||
|       &side_by_side_tiling, | ||||
|     { "/apps/metacity/general/edge_tiling", | ||||
|       META_PREF_EDGE_TILING, | ||||
|       &edge_tiling, | ||||
|       FALSE, | ||||
|     }, | ||||
|     { "/apps/mutter/general/live_hidden_windows", | ||||
| @@ -433,6 +423,11 @@ static MetaBoolPreference preferences_bool[] = | ||||
|       &live_hidden_windows, | ||||
|       FALSE, | ||||
|     }, | ||||
|     { "/apps/mutter/general/workspaces_only_on_primary", | ||||
|       META_PREF_WORKSPACES_ONLY_ON_PRIMARY, | ||||
|       &workspaces_only_on_primary, | ||||
|       FALSE, | ||||
|     }, | ||||
|     { "/apps/metacity/general/no_tab_popup", | ||||
|       META_PREF_NO_TAB_POPUP, | ||||
|       &no_tab_popup, | ||||
| @@ -1058,7 +1053,6 @@ meta_prefs_init (void) | ||||
| #ifdef HAVE_GCONF | ||||
|   GError *err = NULL; | ||||
|   gchar **gconf_dir_cursor; | ||||
|   MetaPluginManager *plugin_manager; | ||||
|    | ||||
|   if (default_client != NULL) | ||||
|     return; | ||||
| @@ -1077,19 +1071,6 @@ meta_prefs_init (void) | ||||
|       cleanup_error (&err); | ||||
|     } | ||||
|  | ||||
|   /* The plugin list is special and needs to be handled first */ | ||||
|  | ||||
|   if (!clutter_plugins_overridden) | ||||
|     clutter_plugins = gconf_client_get_list (default_client, KEY_CLUTTER_PLUGINS, | ||||
|                                              GCONF_VALUE_STRING, &err); | ||||
|  | ||||
|   cleanup_error (&err); | ||||
|  | ||||
|   /* We now initialize plugins so that they can override any preference locations */ | ||||
|  | ||||
|   plugin_manager = meta_plugin_manager_get_default (); | ||||
|   meta_plugin_manager_load (plugin_manager); | ||||
|  | ||||
|   /* Pick up initial values. */ | ||||
|  | ||||
|   handle_preference_init_enum (); | ||||
| @@ -1403,23 +1384,6 @@ change_notify (GConfClient    *client, | ||||
|     { | ||||
|       queue_changed (META_PREF_KEYBINDINGS); | ||||
|     } | ||||
|   else if (g_str_equal (key, KEY_CLUTTER_PLUGINS) && !clutter_plugins_overridden) | ||||
|     { | ||||
|       GError *err = NULL; | ||||
|       GSList *l; | ||||
|  | ||||
|       l = gconf_client_get_list (default_client, KEY_CLUTTER_PLUGINS, | ||||
|                                  GCONF_VALUE_STRING, &err); | ||||
|  | ||||
|       if (!l) | ||||
|         { | ||||
|           cleanup_error (&err); | ||||
|           goto out; | ||||
|         } | ||||
|  | ||||
|       clutter_plugins = l; | ||||
|       queue_changed (META_PREF_CLUTTER_PLUGINS); | ||||
|     } | ||||
|   else | ||||
|     { | ||||
|       meta_topic (META_DEBUG_PREFS, "Key %s doesn't mean anything to Mutter\n", | ||||
| @@ -2004,24 +1968,21 @@ meta_preference_to_string (MetaPreference pref) | ||||
|     case META_PREF_CURSOR_SIZE: | ||||
|       return "CURSOR_SIZE"; | ||||
|  | ||||
|     case META_PREF_COMPOSITING_MANAGER: | ||||
|       return "COMPOSITING_MANAGER"; | ||||
|  | ||||
|     case META_PREF_RESIZE_WITH_RIGHT_BUTTON: | ||||
|       return "RESIZE_WITH_RIGHT_BUTTON"; | ||||
|  | ||||
|     case META_PREF_SIDE_BY_SIDE_TILING: | ||||
|       return "SIDE_BY_SIDE_TILING"; | ||||
|     case META_PREF_EDGE_TILING: | ||||
|       return "EDGE_TILING"; | ||||
|  | ||||
|     case META_PREF_FORCE_FULLSCREEN: | ||||
|       return "FORCE_FULLSCREEN"; | ||||
|  | ||||
|     case META_PREF_CLUTTER_PLUGINS: | ||||
|       return "CLUTTER_PLUGINS"; | ||||
|  | ||||
|     case META_PREF_LIVE_HIDDEN_WINDOWS: | ||||
|       return "LIVE_HIDDEN_WINDOWS"; | ||||
|  | ||||
|     case META_PREF_WORKSPACES_ONLY_ON_PRIMARY: | ||||
|       return "WORKSPACES_ONLY_ON_PRIMARY"; | ||||
|  | ||||
|     case META_PREF_NO_TAB_POPUP: | ||||
|       return "NO_TAB_POPUP"; | ||||
|     } | ||||
| @@ -2926,9 +2887,9 @@ meta_prefs_get_gnome_animations () | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| meta_prefs_get_side_by_side_tiling () | ||||
| meta_prefs_get_edge_tiling () | ||||
| { | ||||
|   return side_by_side_tiling; | ||||
|   return edge_tiling; | ||||
| } | ||||
|  | ||||
| MetaKeyBindingAction | ||||
| @@ -2992,12 +2953,6 @@ meta_prefs_get_window_binding (const char          *name, | ||||
|   g_assert_not_reached (); | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| meta_prefs_get_compositing_manager (void) | ||||
| { | ||||
|   return compositing_manager; | ||||
| } | ||||
|  | ||||
| guint | ||||
| meta_prefs_get_mouse_button_resize (void) | ||||
| { | ||||
| @@ -3016,74 +2971,6 @@ meta_prefs_get_force_fullscreen (void) | ||||
|   return force_fullscreen; | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_prefs_set_compositing_manager (gboolean whether) | ||||
| { | ||||
| #ifdef HAVE_GCONF | ||||
|   GError *err = NULL; | ||||
|  | ||||
|   gconf_client_set_bool (default_client, | ||||
|                          KEY_COMPOSITOR, | ||||
|                          whether, | ||||
|                          &err); | ||||
|  | ||||
|   if (err) | ||||
|     { | ||||
|       meta_warning (_("Error setting compositor status: %s\n"), | ||||
|                     err->message); | ||||
|       g_error_free (err); | ||||
|     } | ||||
| #else | ||||
|   compositing_manager = whether; | ||||
| #endif | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_prefs_get_clutter_plugins: | ||||
|  * | ||||
|  * Returns: (transfer none) (element-type utf8): Plugin names to load | ||||
|  */ | ||||
| GSList * | ||||
| meta_prefs_get_clutter_plugins (void) | ||||
| { | ||||
|   return clutter_plugins; | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_prefs_set_clutter_plugins (GSList *list) | ||||
| { | ||||
| #ifdef HAVE_GCONF | ||||
|   GError *err = NULL; | ||||
|  | ||||
|   gconf_client_set_list (default_client, | ||||
|                          KEY_CLUTTER_PLUGINS, | ||||
|                          GCONF_VALUE_STRING, | ||||
|                          list, | ||||
|                          &err); | ||||
|  | ||||
|   if (err) | ||||
|     { | ||||
|       meta_warning (_("Error setting clutter plugin list: %s\n"), | ||||
|                     err->message); | ||||
|       g_error_free (err); | ||||
|     } | ||||
| #endif | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_prefs_override_clutter_plugins (GSList *list) | ||||
| { | ||||
|   GSList *l; | ||||
|  | ||||
|   clutter_plugins_overridden = TRUE; | ||||
|   clutter_plugins = NULL; | ||||
|  | ||||
|   for (l = list; l; l = l->next) | ||||
|     clutter_plugins = g_slist_prepend (clutter_plugins, g_strdup(l->data)); | ||||
|  | ||||
|   clutter_plugins = g_slist_reverse (clutter_plugins); | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| meta_prefs_get_live_hidden_windows (void) | ||||
| { | ||||
| @@ -3116,6 +3003,13 @@ meta_prefs_set_live_hidden_windows (gboolean whether) | ||||
| #endif | ||||
| } | ||||
|  | ||||
| gboolean | ||||
| meta_prefs_get_workspaces_only_on_primary (void) | ||||
| { | ||||
|   return workspaces_only_on_primary; | ||||
| } | ||||
|  | ||||
|  | ||||
| gboolean | ||||
| meta_prefs_get_no_tab_popup (void) | ||||
| { | ||||
| @@ -3144,12 +3038,6 @@ meta_prefs_set_no_tab_popup (gboolean whether) | ||||
| #endif | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_prefs_override_no_tab_popup (gboolean whether) | ||||
| { | ||||
|   no_tab_popup = whether; | ||||
| } | ||||
|  | ||||
| #ifndef HAVE_GCONF | ||||
| static void | ||||
| init_button_layout(void) | ||||
|   | ||||
| @@ -34,7 +34,7 @@ | ||||
| #define META_SCREEN_PRIVATE_H | ||||
|  | ||||
| #include "display-private.h" | ||||
| #include "screen.h" | ||||
| #include <meta/screen.h> | ||||
| #include <X11/Xutil.h> | ||||
| #include "stack-tracker.h" | ||||
| #include "ui.h" | ||||
| @@ -50,14 +50,6 @@ struct _MetaMonitorInfo | ||||
| typedef void (* MetaScreenWindowFunc) (MetaScreen *screen, MetaWindow *window, | ||||
|                                        gpointer user_data); | ||||
|  | ||||
| typedef enum | ||||
| { | ||||
|   META_SCREEN_TOPLEFT, | ||||
|   META_SCREEN_TOPRIGHT, | ||||
|   META_SCREEN_BOTTOMLEFT, | ||||
|   META_SCREEN_BOTTOMRIGHT | ||||
| } MetaScreenCorner; | ||||
|  | ||||
| typedef enum | ||||
| { | ||||
|   META_SCREEN_UP, | ||||
| @@ -107,6 +99,7 @@ struct _MetaScreen | ||||
|   guint32 wm_sn_timestamp; | ||||
|    | ||||
|   MetaMonitorInfo *monitor_infos; | ||||
|   int primary_monitor_index; | ||||
|   int n_monitor_infos; | ||||
|  | ||||
|   /* Cache the current monitor */ | ||||
| @@ -127,6 +120,7 @@ struct _MetaScreen | ||||
|   int columns_of_workspaces; | ||||
|   MetaScreenCorner starting_corner; | ||||
|   guint vertical_workspaces : 1; | ||||
|   guint workspace_layout_overridden : 1; | ||||
|    | ||||
|   guint keys_grabbed : 1; | ||||
|   guint all_keys_grabbed : 1; | ||||
| @@ -148,6 +142,7 @@ struct _MetaScreenClass | ||||
|  | ||||
|   void (*restacked)         (MetaScreen *); | ||||
|   void (*workareas_changed) (MetaScreen *); | ||||
|   void (*monitors_changed)  (MetaScreen *); | ||||
| }; | ||||
|  | ||||
| MetaScreen*   meta_screen_new                 (MetaDisplay                *display, | ||||
| @@ -184,6 +179,7 @@ void          meta_screen_workspace_popup_destroy      (MetaScreen    *screen); | ||||
|  | ||||
| void          meta_screen_tile_preview_update          (MetaScreen    *screen, | ||||
|                                                         gboolean       delay); | ||||
| void          meta_screen_tile_preview_hide            (MetaScreen    *screen); | ||||
|  | ||||
| MetaWindow*   meta_screen_get_mouse_window     (MetaScreen                 *screen, | ||||
|                                                 MetaWindow                 *not_this_one); | ||||
| @@ -254,4 +250,6 @@ void     meta_screen_workspace_switched (MetaScreen         *screen, | ||||
|                                          int                 to, | ||||
|                                          MetaMotionDirection direction); | ||||
|  | ||||
| void meta_screen_set_active_workspace_hint (MetaScreen *screen); | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -28,16 +28,17 @@ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "screen-private.h" | ||||
| #include "util.h" | ||||
| #include "errors.h" | ||||
| #include <meta/main.h> | ||||
| #include <meta/util.h> | ||||
| #include <meta/errors.h> | ||||
| #include "window-private.h" | ||||
| #include "frame-private.h" | ||||
| #include "prefs.h" | ||||
| #include "frame.h" | ||||
| #include <meta/prefs.h> | ||||
| #include "workspace-private.h" | ||||
| #include "keybindings-private.h" | ||||
| #include "stack.h" | ||||
| #include "xprops.h" | ||||
| #include "compositor.h" | ||||
| #include <meta/compositor.h> | ||||
| #include "mutter-marshal.h" | ||||
| #include "mutter-enum-types.h" | ||||
|  | ||||
| @@ -84,8 +85,11 @@ enum | ||||
|   WORKSPACE_ADDED, | ||||
|   WORKSPACE_REMOVED, | ||||
|   WORKSPACE_SWITCHED, | ||||
|   WINDOW_ENTERED_MONITOR, | ||||
|   WINDOW_LEFT_MONITOR, | ||||
|   STARTUP_SEQUENCE_CHANGED, | ||||
|   WORKAREAS_CHANGED, | ||||
|   MONITORS_CHANGED, | ||||
|  | ||||
|   LAST_SIGNAL | ||||
| }; | ||||
| @@ -200,6 +204,28 @@ meta_screen_class_init (MetaScreenClass *klass) | ||||
|                   G_TYPE_INT, | ||||
|                   MUTTER_TYPE_MOTION_DIRECTION); | ||||
|  | ||||
|   screen_signals[WINDOW_ENTERED_MONITOR] = | ||||
|     g_signal_new ("window-entered-monitor", | ||||
|                   G_TYPE_FROM_CLASS (klass), | ||||
|                   G_SIGNAL_RUN_LAST, | ||||
|                   0, | ||||
|                   NULL, NULL, | ||||
|                   _mutter_marshal_VOID__INT_OBJECT, | ||||
|                   G_TYPE_NONE, 2, | ||||
|                   G_TYPE_INT, | ||||
|                   META_TYPE_WINDOW); | ||||
|  | ||||
|   screen_signals[WINDOW_LEFT_MONITOR] = | ||||
|     g_signal_new ("window-left-monitor", | ||||
|                   G_TYPE_FROM_CLASS (klass), | ||||
|                   G_SIGNAL_RUN_LAST, | ||||
|                   0, | ||||
|                   NULL, NULL, | ||||
|                   _mutter_marshal_VOID__INT_OBJECT, | ||||
|                   G_TYPE_NONE, 2, | ||||
|                   G_TYPE_INT, | ||||
|                   META_TYPE_WINDOW); | ||||
|  | ||||
|   screen_signals[STARTUP_SEQUENCE_CHANGED] = | ||||
|     g_signal_new ("startup-sequence-changed", | ||||
|                   G_TYPE_FROM_CLASS (klass), | ||||
| @@ -227,6 +253,15 @@ meta_screen_class_init (MetaScreenClass *klass) | ||||
|                   g_cclosure_marshal_VOID__VOID, | ||||
|                   G_TYPE_NONE, 0); | ||||
|  | ||||
|   screen_signals[MONITORS_CHANGED] = | ||||
|     g_signal_new ("monitors-changed", | ||||
| 		  G_TYPE_FROM_CLASS (object_class), | ||||
| 		  G_SIGNAL_RUN_LAST, | ||||
| 		  G_STRUCT_OFFSET (MetaScreenClass, monitors_changed), | ||||
| 		  NULL, NULL, | ||||
| 		  g_cclosure_marshal_VOID__VOID, | ||||
| 		  G_TYPE_NONE, 0); | ||||
|  | ||||
|   g_object_class_install_property (object_class, | ||||
|                                    PROP_N_WORKSPACES, | ||||
|                                    pspec); | ||||
| @@ -277,7 +312,7 @@ set_supported_hint (MetaScreen *screen) | ||||
|   Atom atoms[] = { | ||||
| #define EWMH_ATOMS_ONLY | ||||
| #define item(x)  screen->display->atom_##x, | ||||
| #include "atomnames.h" | ||||
| #include <meta/atomnames.h> | ||||
| #undef item | ||||
| #undef EWMH_ATOMS_ONLY | ||||
|   }; | ||||
| @@ -342,6 +377,18 @@ reload_monitor_infos (MetaScreen *screen) | ||||
|   screen->n_monitor_infos = 0; | ||||
|   screen->last_monitor_index = 0; | ||||
|  | ||||
|   /* Xinerama doesn't have a concept of primary monitor, however XRandR | ||||
|    * does. However, the XRandR xinerama compat code always sorts the | ||||
|    * primary output first, so we rely on that here. We could use the | ||||
|    * native XRandR calls instead of xinerama, but that would be | ||||
|    * slightly problematic for _NET_WM_FULLSCREEN_MONITORS support, as | ||||
|    * that is defined in terms of xinerama monitor indexes. | ||||
|    * So, since we don't need anything in xrandr except the primary | ||||
|    * we can keep using xinerama and use the first monitor as the | ||||
|    * primary. | ||||
|    */ | ||||
|   screen->primary_monitor_index = 0; | ||||
|  | ||||
|   screen->display->monitor_cache_invalidated = TRUE; | ||||
|  | ||||
|   if (g_getenv ("MUTTER_DEBUG_XINERAMA")) | ||||
| @@ -951,9 +998,8 @@ meta_screen_manage_all_windows (MetaScreen *screen) | ||||
|   for (list = windows; list != NULL; list = list->next) | ||||
|     { | ||||
|       WindowInfo *info = list->data; | ||||
|       MetaWindow *window; | ||||
|  | ||||
|       window = meta_window_new_with_attrs (screen->display, info->xwindow, TRUE, | ||||
|       meta_window_new_with_attrs (screen->display, info->xwindow, TRUE, | ||||
|                                   META_COMP_EFFECT_NONE, | ||||
|                                   &info->attrs); | ||||
|     } | ||||
| @@ -978,7 +1024,15 @@ meta_screen_composite_all_windows (MetaScreen *screen) | ||||
|   windows = meta_display_list_windows (display, | ||||
|                                        META_LIST_INCLUDE_OVERRIDE_REDIRECT); | ||||
|   for (tmp = windows; tmp != NULL; tmp = tmp->next) | ||||
|     meta_compositor_add_window (display->compositor, tmp->data); | ||||
|     { | ||||
|       MetaWindow *window = tmp->data; | ||||
|  | ||||
|       meta_compositor_add_window (display->compositor, window); | ||||
|       if (window->visible_to_compositor) | ||||
|         meta_compositor_show_window (display->compositor, window, | ||||
|                                      META_COMP_EFFECT_NONE); | ||||
|     } | ||||
|  | ||||
|   g_slist_free (windows); | ||||
|    | ||||
|   /* initialize the compositor's view of the stacking order */ | ||||
| @@ -1276,6 +1330,7 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace, | ||||
|   MetaWorkspace *neighbour = NULL; | ||||
|   GList         *next = NULL; | ||||
|   int            index; | ||||
|   gboolean       active_index_changed; | ||||
|   int            new_num; | ||||
|  | ||||
|   l = screen->workspaces; | ||||
| @@ -1314,6 +1369,7 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace, | ||||
|  | ||||
|   /* To emit the signal after removing the workspace */ | ||||
|   index = meta_workspace_index (workspace); | ||||
|   active_index_changed = index < meta_screen_get_active_workspace_index (screen); | ||||
|  | ||||
|   /* This also removes the workspace from the screens list */ | ||||
|   meta_workspace_remove (workspace); | ||||
| @@ -1323,6 +1379,11 @@ meta_screen_remove_workspace (MetaScreen *screen, MetaWorkspace *workspace, | ||||
|   set_number_of_spaces_hint (screen, new_num); | ||||
|   meta_prefs_set_num_workspaces (new_num); | ||||
|  | ||||
|   /* If deleting a workspace before the current workspace, the active | ||||
|    * workspace index changes, so we need to update that hint */ | ||||
|   if (active_index_changed) | ||||
|       meta_screen_set_active_workspace_hint (workspace->screen); | ||||
|  | ||||
|   l = next; | ||||
|   while (l) | ||||
|     { | ||||
| @@ -1758,6 +1819,7 @@ meta_screen_tile_preview_update_timeout (gpointer data) | ||||
|   MetaScreen *screen = data; | ||||
|   MetaWindow *window = screen->display->grab_window; | ||||
|   gboolean composited = screen->display->compositor != NULL; | ||||
|   gboolean needs_preview = FALSE; | ||||
|  | ||||
|   screen->tile_preview_timeout_id = 0; | ||||
|  | ||||
| @@ -1775,9 +1837,28 @@ meta_screen_tile_preview_update_timeout (gpointer data) | ||||
|                                      create_serial); | ||||
|     } | ||||
|  | ||||
|   if (window | ||||
|       && !META_WINDOW_TILED (window) | ||||
|       && window->tile_mode != META_TILE_NONE) | ||||
|   if (window) | ||||
|     { | ||||
|       switch (window->tile_mode) | ||||
|         { | ||||
|           case META_TILE_LEFT: | ||||
|           case META_TILE_RIGHT: | ||||
|               if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) | ||||
|                 needs_preview = TRUE; | ||||
|               break; | ||||
|  | ||||
|           case META_TILE_MAXIMIZED: | ||||
|               if (!META_WINDOW_MAXIMIZED (window)) | ||||
|                 needs_preview = TRUE; | ||||
|               break; | ||||
|  | ||||
|           default: | ||||
|               needs_preview = FALSE; | ||||
|               break; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   if (needs_preview) | ||||
|     { | ||||
|       MetaRectangle tile_rect; | ||||
|  | ||||
| @@ -1815,6 +1896,16 @@ meta_screen_tile_preview_update (MetaScreen *screen, | ||||
|     } | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_screen_tile_preview_hide (MetaScreen *screen) | ||||
| { | ||||
|   if (screen->tile_preview_timeout_id > 0) | ||||
|     g_source_remove (screen->tile_preview_timeout_id); | ||||
|  | ||||
|   if (screen->tile_preview) | ||||
|     meta_tile_preview_hide (screen->tile_preview); | ||||
| } | ||||
|  | ||||
| MetaWindow* | ||||
| meta_screen_get_mouse_window (MetaScreen  *screen, | ||||
|                               MetaWindow  *not_this_one) | ||||
| @@ -2086,6 +2177,22 @@ meta_screen_get_n_monitors (MetaScreen *screen) | ||||
|   return screen->n_monitor_infos; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_screen_get_primary_monitor: | ||||
|  * @screen: a #MetaScreen | ||||
|  * | ||||
|  * Gets the index of the primary monitor on this @screen. | ||||
|  * | ||||
|  * Return value: a monitor index | ||||
|  */ | ||||
| int | ||||
| meta_screen_get_primary_monitor (MetaScreen *screen) | ||||
| { | ||||
|   g_return_val_if_fail (META_IS_SCREEN (screen), 0); | ||||
|  | ||||
|   return screen->primary_monitor_index; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_screen_get_monitor_geometry: | ||||
|  * @screen: a #MetaScreen | ||||
| @@ -2120,6 +2227,9 @@ meta_screen_update_workspace_layout (MetaScreen *screen) | ||||
|   gulong *list; | ||||
|   int n_items; | ||||
|  | ||||
|   if (screen->workspace_layout_overridden) | ||||
|     return; | ||||
|    | ||||
|   list = NULL; | ||||
|   n_items = 0; | ||||
|  | ||||
| @@ -2205,6 +2315,43 @@ meta_screen_update_workspace_layout (MetaScreen *screen) | ||||
|                 screen->starting_corner); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * meta_screen_override_workspace_layout: | ||||
|  * @screen: a #MetaScreen | ||||
|  * @starting_corner: the corner at which the first workspace is found | ||||
|  * @vertical_layout: if %TRUE the workspaces are laid out in columns rather than rows | ||||
|  * @n_rows: number of rows of workspaces, or -1 to determine the number of rows from | ||||
|  *   @n_columns and the total number of workspaces | ||||
|  * @n_columns: number of columns of workspaces, or -1 to determine the number of columns from | ||||
|  *   @n_rows and the total number of workspaces | ||||
|  * | ||||
|  * Explicitly set the layout of workspaces. Once this has been called, the contents of the | ||||
|  * _NET_DESKTOP_LAYOUT property on the root window are completely ignored. | ||||
|  */ | ||||
| void | ||||
| meta_screen_override_workspace_layout (MetaScreen      *screen, | ||||
|                                        MetaScreenCorner starting_corner, | ||||
|                                        gboolean         vertical_layout, | ||||
|                                        int              n_rows, | ||||
|                                        int              n_columns) | ||||
| { | ||||
|   g_return_if_fail (META_IS_SCREEN (screen)); | ||||
|   g_return_if_fail (n_rows > 0 || n_columns > 0); | ||||
|   g_return_if_fail (n_rows != 0 && n_columns != 0); | ||||
|  | ||||
|   screen->workspace_layout_overridden = TRUE; | ||||
|   screen->vertical_workspaces = vertical_layout != FALSE; | ||||
|   screen->starting_corner = starting_corner; | ||||
|   screen->rows_of_workspaces = n_rows; | ||||
|   screen->columns_of_workspaces = n_columns; | ||||
|  | ||||
|   /* In theory we should remove _NET_DESKTOP_LAYOUT from _NET_SUPPORTED at this | ||||
|    * point, but it's unlikely that anybody checks that, and it's unlikely that | ||||
|    * anybody who checks that handles changes, so we'd probably just create | ||||
|    * a race condition. And it's hard to implement with the code in set_supported_hint() | ||||
|    */ | ||||
| } | ||||
|  | ||||
| static void | ||||
| set_workspace_names (MetaScreen *screen) | ||||
| { | ||||
| @@ -2695,9 +2842,26 @@ meta_screen_resize (MetaScreen *screen, | ||||
|                     int         width, | ||||
|                     int         height) | ||||
| { | ||||
|   GSList *windows, *tmp; | ||||
|  | ||||
|   screen->rect.width = width; | ||||
|   screen->rect.height = height; | ||||
|  | ||||
|   /* Clear monitor for all windows on this screen, as it will become | ||||
|    * invalid. */ | ||||
|   windows = meta_display_list_windows (screen->display, | ||||
|                                        META_LIST_INCLUDE_OVERRIDE_REDIRECT); | ||||
|   for (tmp = windows; tmp != NULL; tmp = tmp->next) | ||||
|     { | ||||
|       MetaWindow *window = tmp->data; | ||||
|  | ||||
|       if (window->screen == screen) | ||||
|         { | ||||
|           g_signal_emit_by_name (screen, "window-left-monitor", window->monitor->number, window); | ||||
|           window->monitor = NULL; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   reload_monitor_infos (screen); | ||||
|   set_desktop_geometry_hint (screen); | ||||
|    | ||||
| @@ -2707,6 +2871,21 @@ meta_screen_resize (MetaScreen *screen, | ||||
|  | ||||
|   /* Queue a resize on all the windows */ | ||||
|   meta_screen_foreach_window (screen, meta_screen_resize_func, 0); | ||||
|  | ||||
|   /* Fix up monitor for all windows on this screen */ | ||||
|   windows = meta_display_list_windows (screen->display, | ||||
|                                        META_LIST_INCLUDE_OVERRIDE_REDIRECT); | ||||
|   for (tmp = windows; tmp != NULL; tmp = tmp->next) | ||||
|     { | ||||
|       MetaWindow *window = tmp->data; | ||||
|  | ||||
|       if (window->screen == screen) | ||||
|         meta_window_update_monitor (window); | ||||
|     } | ||||
|  | ||||
|   g_slist_free (windows); | ||||
|  | ||||
|   g_signal_emit (screen, screen_signals[MONITORS_CHANGED], 0, index); | ||||
| } | ||||
|  | ||||
| void | ||||
| @@ -3308,3 +3487,29 @@ meta_screen_workspace_switched (MetaScreen         *screen, | ||||
|                  from, to, direction); | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_screen_set_active_workspace_hint (MetaScreen *screen) | ||||
| { | ||||
|   unsigned long data[1]; | ||||
|  | ||||
|   /* this is because we destroy the spaces in order, | ||||
|    * so we always end up setting a current desktop of | ||||
|    * 0 when closing a screen, so lose the current desktop | ||||
|    * on restart. By doing this we keep the current | ||||
|    * desktop on restart. | ||||
|    */ | ||||
|   if (screen->closing > 0) | ||||
|     return; | ||||
|    | ||||
|   data[0] = meta_workspace_index (screen->active_workspace); | ||||
|  | ||||
|   meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]); | ||||
|    | ||||
|   meta_error_trap_push (screen->display); | ||||
|   XChangeProperty (screen->display->xdisplay, screen->xroot, | ||||
|                    screen->display->atom__NET_CURRENT_DESKTOP, | ||||
|                    XA_CARDINAL, | ||||
|                    32, PropModeReplace, (guchar*) data, 1); | ||||
|   meta_error_trap_pop (screen->display); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -39,12 +39,6 @@ meta_session_init (const char *client_id, | ||||
|   meta_topic (META_DEBUG_SM, "Compiled without session management support\n"); | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_session_shutdown (void) | ||||
| { | ||||
|   /* nothing */ | ||||
| } | ||||
|  | ||||
| const MetaWindowSessionInfo* | ||||
| meta_window_lookup_saved_state (MetaWindow *window) | ||||
| { | ||||
| @@ -69,10 +63,10 @@ meta_window_release_saved_state (const MetaWindowSessionInfo *info) | ||||
| #include <string.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| #include "main.h" | ||||
| #include "util.h" | ||||
| #include <meta/main.h> | ||||
| #include <meta/util.h> | ||||
| #include "display-private.h" | ||||
| #include "workspace.h" | ||||
| #include <meta/workspace.h> | ||||
|  | ||||
| static void ice_io_error_handler (IceConn connection); | ||||
|  | ||||
| @@ -307,7 +301,12 @@ meta_session_init (const char *previous_client_id, | ||||
|     SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6]; | ||||
|     SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; | ||||
|     char pid[32]; | ||||
|     char hint = SmRestartImmediately; | ||||
|     /* Historically, this was SmRestartImmediately, which made sense | ||||
|      * for a stateless window manager, but we don't really control | ||||
|      * what embedders do, and it's all around better if gnome-session | ||||
|      * handles this. | ||||
|      */ | ||||
|     char hint = SmRestartIfRunning; | ||||
|     char priority = 20; /* low to run before other apps */ | ||||
|      | ||||
|     prop1.name = SmProgram; | ||||
| @@ -371,31 +370,6 @@ meta_session_init (const char *previous_client_id, | ||||
|   g_free (saved_client_id); | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_session_shutdown (void) | ||||
| { | ||||
|   /* Change our restart mode to IfRunning */ | ||||
|    | ||||
|   SmProp prop1; | ||||
|   SmPropValue prop1val; | ||||
|   SmProp *props[1]; | ||||
|   char hint = SmRestartIfRunning; | ||||
|  | ||||
|   if (session_connection == NULL) | ||||
|     return; | ||||
|    | ||||
|   prop1.name = SmRestartStyleHint; | ||||
|   prop1.type = SmCARD8; | ||||
|   prop1.num_vals = 1; | ||||
|   prop1.vals = &prop1val; | ||||
|   prop1val.value = &hint; | ||||
|   prop1val.length = 1; | ||||
|      | ||||
|   props[0] = &prop1; | ||||
|    | ||||
|   SmcSetProperties (session_connection, 1, props); | ||||
| } | ||||
|  | ||||
| static void | ||||
| disconnect (void) | ||||
| { | ||||
| @@ -544,9 +518,16 @@ save_yourself_callback (SmcConn   smc_conn, | ||||
| static void | ||||
| die_callback (SmcConn smc_conn, SmPointer client_data) | ||||
| { | ||||
|   meta_topic (META_DEBUG_SM, "Exiting at request of session manager\n"); | ||||
|   meta_topic (META_DEBUG_SM, "Disconnecting from session manager"); | ||||
|   disconnect (); | ||||
|   meta_quit (META_EXIT_SUCCESS); | ||||
|   /* We don't actually exit here - we will simply go away with the X | ||||
|    * server on logout, when we lose the X connection and libx11 kills | ||||
|    * us.  It looks like *crap* on logout if the user sees their | ||||
|    * windows lose the decorations, etc. | ||||
|    * | ||||
|    * Anything that wants us to go away outside of session management | ||||
|    * can use kill(). | ||||
|    */ | ||||
| } | ||||
|  | ||||
| static void | ||||
| @@ -952,7 +933,7 @@ save_state (void) | ||||
|           g_free (title); | ||||
|                | ||||
|           /* Sticky */ | ||||
|           if (window->on_all_workspaces) | ||||
|           if (window->on_all_workspaces_requested) | ||||
|             fputs ("    <sticky/>\n", outfile); | ||||
|  | ||||
|           /* Minimized */ | ||||
| @@ -1823,7 +1804,7 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown) | ||||
|                            "and will have to be restarted manually next time " | ||||
|                            "you log in."), | ||||
|                          "240", | ||||
|                          meta_screen_get_screen_number (meta_get_display()->active_screen), | ||||
|                          meta_get_display()->active_screen->screen_name, | ||||
|                          NULL, NULL, | ||||
|                          None, | ||||
|                          columns, | ||||
|   | ||||
| @@ -23,12 +23,12 @@ | ||||
|  | ||||
| #include <string.h> | ||||
|  | ||||
| #include "frame-private.h" | ||||
| #include "frame.h" | ||||
| #include "screen-private.h" | ||||
| #include "stack-tracker.h" | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
|  | ||||
| #include "compositor.h" | ||||
| #include <meta/compositor.h> | ||||
|  | ||||
| /* The complexity here comes from resolving two competing factors: | ||||
|  * | ||||
|   | ||||
| @@ -36,7 +36,7 @@ | ||||
| #ifndef META_STACK_TRACKER_H | ||||
| #define META_STACK_TRACKER_H | ||||
|  | ||||
| #include "screen.h" | ||||
| #include <meta/screen.h> | ||||
|  | ||||
| typedef struct _MetaStackTracker MetaStackTracker; | ||||
|  | ||||
|   | ||||
| @@ -29,11 +29,11 @@ | ||||
| #include <config.h> | ||||
| #include "stack.h" | ||||
| #include "window-private.h" | ||||
| #include "errors.h" | ||||
| #include "frame-private.h" | ||||
| #include "group.h" | ||||
| #include "prefs.h" | ||||
| #include "workspace.h" | ||||
| #include <meta/errors.h> | ||||
| #include "frame.h" | ||||
| #include <meta/group.h> | ||||
| #include <meta/prefs.h> | ||||
| #include <meta/workspace.h> | ||||
|  | ||||
| #include <X11/Xatom.h> | ||||
|  | ||||
|   | ||||
| @@ -416,7 +416,6 @@ run_speed_comparison (Display *xdisplay, | ||||
|        | ||||
|       while ((task = ag_get_next_completed_task (xdisplay))) | ||||
|         { | ||||
|           int result; | ||||
|           Atom actual_type; | ||||
|           int actual_format; | ||||
|           unsigned long n_items; | ||||
| @@ -426,7 +425,7 @@ run_speed_comparison (Display *xdisplay, | ||||
|           assert (ag_task_have_reply (task)); | ||||
|            | ||||
|           data = NULL; | ||||
|           result = ag_task_get_reply_and_free (task, | ||||
|           ag_task_get_reply_and_free (task, | ||||
|                                       &actual_type, | ||||
|                                       &actual_format, | ||||
|                                       &n_items, | ||||
|   | ||||
| @@ -26,9 +26,9 @@ | ||||
| #define _POSIX_C_SOURCE 200112L /* for fdopen() */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "common.h" | ||||
| #include "util.h" | ||||
| #include "main.h" | ||||
| #include <meta/common.h> | ||||
| #include <meta/util.h> | ||||
| #include <meta/main.h> | ||||
|  | ||||
| #include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */ | ||||
|  | ||||
| @@ -588,7 +588,7 @@ GPid | ||||
| meta_show_dialog (const char *type, | ||||
|                   const char *message, | ||||
|                   const char *timeout, | ||||
|                   const gint screen_number, | ||||
|                   const char *display, | ||||
|                   const char *ok_text, | ||||
|                   const char *cancel_text, | ||||
|                   const int transient_for, | ||||
| @@ -596,7 +596,6 @@ meta_show_dialog (const char *type, | ||||
|                   GSList *entries) | ||||
| { | ||||
|   GError *error = NULL; | ||||
|   char *screen_number_text = g_strdup_printf("%d", screen_number); | ||||
|   GSList *tmp; | ||||
|   int i=0; | ||||
|   GPid child_pid; | ||||
| @@ -607,8 +606,8 @@ meta_show_dialog (const char *type, | ||||
|  | ||||
|   argvl[i++] = "zenity"; | ||||
|   argvl[i++] = type; | ||||
|   argvl[i++] = "--screen"; | ||||
|   argvl[i++] = screen_number_text; | ||||
|   argvl[i++] = "--display"; | ||||
|   argvl[i++] = display; | ||||
|   argvl[i++] = "--class"; | ||||
|   argvl[i++] = "mutter-dialog"; | ||||
|   argvl[i++] = "--title"; | ||||
| @@ -673,7 +672,6 @@ meta_show_dialog (const char *type, | ||||
|     unsetenv ("WINDOWID"); | ||||
|  | ||||
|   g_free (argvl); | ||||
|   g_free (screen_number_text); | ||||
|  | ||||
|   if (error) | ||||
|     { | ||||
|   | ||||
| @@ -35,10 +35,10 @@ | ||||
| #define META_WINDOW_PRIVATE_H | ||||
|  | ||||
| #include <config.h> | ||||
| #include "compositor.h" | ||||
| #include "window.h" | ||||
| #include <meta/compositor.h> | ||||
| #include <meta/window.h> | ||||
| #include "screen-private.h" | ||||
| #include "util.h" | ||||
| #include <meta/util.h> | ||||
| #include "stack.h" | ||||
| #include "iconcache.h" | ||||
| #include <X11/Xutil.h> | ||||
| @@ -61,18 +61,13 @@ typedef enum { | ||||
|  | ||||
| #define NUMBER_OF_QUEUES 3 | ||||
|  | ||||
| typedef enum { | ||||
|   META_TILE_NONE, | ||||
|   META_TILE_LEFT, | ||||
|   META_TILE_RIGHT | ||||
| } MetaTileMode; | ||||
|  | ||||
| struct _MetaWindow | ||||
| { | ||||
|   GObject parent_instance; | ||||
|    | ||||
|   MetaDisplay *display; | ||||
|   MetaScreen *screen; | ||||
|   const MetaMonitorInfo *monitor; | ||||
|   MetaWorkspace *workspace; | ||||
|   Window xwindow; | ||||
|   /* may be NULL! not all windows get decorated */ | ||||
| @@ -166,6 +161,11 @@ struct _MetaWindow | ||||
|    */ | ||||
|   guint on_all_workspaces : 1; | ||||
|  | ||||
|   /* This is true if the client requested sticky, and implies on_all_workspaces == TRUE, | ||||
|    * however on_all_workspaces can be set TRUE for other internal reasons too, such as | ||||
|    * being override_redirect or being on the non-primary monitor. */ | ||||
|   guint on_all_workspaces_requested : 1; | ||||
|  | ||||
|   /* Minimize is the state controlled by the minimize button */ | ||||
|   guint minimized : 1; | ||||
|   guint tab_unminimized : 1; | ||||
| @@ -253,9 +253,7 @@ struct _MetaWindow | ||||
|   /* EWHH demands attention flag */ | ||||
|   guint wm_state_demands_attention : 1; | ||||
|    | ||||
|   /* this flag tracks receipt of focus_in focus_out and | ||||
|    * determines whether we draw the focus | ||||
|    */ | ||||
|   /* this flag tracks receipt of focus_in focus_out */ | ||||
|   guint has_focus : 1; | ||||
|  | ||||
|   /* Have we placed this window? */ | ||||
| @@ -389,6 +387,9 @@ struct _MetaWindow | ||||
|   MetaGroup *group; | ||||
|  | ||||
|   GObject *compositor_private; | ||||
|  | ||||
|   /* Focused window that is (directly or indirectly) attached to this one */ | ||||
|   MetaWindow *attached_focus_window; | ||||
| }; | ||||
|  | ||||
| struct _MetaWindowClass | ||||
| @@ -409,11 +410,15 @@ struct _MetaWindowClass | ||||
|                                         (w)->maximized_vertically) | ||||
| #define META_WINDOW_MAXIMIZED_VERTICALLY(w)    ((w)->maximized_vertically) | ||||
| #define META_WINDOW_MAXIMIZED_HORIZONTALLY(w)  ((w)->maximized_horizontally) | ||||
| #define META_WINDOW_TILED(w)           ((w)->maximized_vertically && \ | ||||
| #define META_WINDOW_TILED_SIDE_BY_SIDE(w)      ((w)->maximized_vertically && \ | ||||
|                                                 !(w)->maximized_horizontally && \ | ||||
|                                                  (w)->tile_mode != META_TILE_NONE) | ||||
| #define META_WINDOW_TILED_LEFT(w)     (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \ | ||||
|                                        (w)->tile_mode == META_TILE_LEFT) | ||||
| #define META_WINDOW_TILED_RIGHT(w)    (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \ | ||||
|                                        (w)->tile_mode == META_TILE_RIGHT) | ||||
| #define META_WINDOW_ALLOWS_MOVE(w)     ((w)->has_move_func && !(w)->fullscreen) | ||||
| #define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w)   ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED(w) && !(w)->fullscreen && !(w)->shaded) | ||||
| #define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w)   ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED_SIDE_BY_SIDE(w) && !(w)->fullscreen && !(w)->shaded) | ||||
| #define META_WINDOW_ALLOWS_RESIZE(w)   (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) &&                \ | ||||
|                                         (((w)->size_hints.min_width < (w)->size_hints.max_width) ||  \ | ||||
|                                          ((w)->size_hints.min_height < (w)->size_hints.max_height))) | ||||
| @@ -433,6 +438,7 @@ void        meta_window_unmanage           (MetaWindow  *window, | ||||
| void        meta_window_calc_showing       (MetaWindow  *window); | ||||
| void        meta_window_queue              (MetaWindow  *window, | ||||
|                                             guint queuebits); | ||||
| void        meta_window_tile               (MetaWindow        *window); | ||||
| void        meta_window_maximize_internal  (MetaWindow        *window, | ||||
|                                             MetaMaximizeFlags  directions, | ||||
|                                             MetaRectangle     *saved_rect); | ||||
| @@ -626,5 +632,10 @@ void meta_window_update_icon_now (MetaWindow *window); | ||||
|  | ||||
| void meta_window_update_role (MetaWindow *window); | ||||
| void meta_window_update_net_wm_type (MetaWindow *window); | ||||
| void meta_window_update_monitor (MetaWindow *window); | ||||
| void meta_window_update_on_all_workspaces (MetaWindow *window); | ||||
|  | ||||
| void meta_window_propagate_focus_appearance (MetaWindow *window, | ||||
|                                              gboolean    focused); | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -40,10 +40,10 @@ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "window-props.h" | ||||
| #include "errors.h" | ||||
| #include <meta/errors.h> | ||||
| #include "xprops.h" | ||||
| #include "frame-private.h" | ||||
| #include "group.h" | ||||
| #include "frame.h" | ||||
| #include <meta/group.h> | ||||
| #include <X11/Xatom.h> | ||||
| #include <unistd.h> | ||||
| #include <string.h> | ||||
| @@ -684,7 +684,7 @@ reload_net_wm_state (MetaWindow    *window, | ||||
|       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_DEMANDS_ATTENTION) | ||||
|         window->wm_state_demands_attention = TRUE; | ||||
|       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_STICKY) | ||||
|         window->on_all_workspaces = TRUE; | ||||
|         window->on_all_workspaces_requested = TRUE; | ||||
|  | ||||
|       ++i; | ||||
|     } | ||||
| @@ -693,6 +693,7 @@ reload_net_wm_state (MetaWindow    *window, | ||||
|                 window->desc); | ||||
|  | ||||
|   meta_window_recalc_window_type (window); | ||||
|   meta_window_recalc_features (window); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @@ -1465,6 +1466,9 @@ reload_transient_for (MetaWindow    *window, | ||||
|                       MetaPropValue *value, | ||||
|                       gboolean       initial) | ||||
| { | ||||
|   if (window->has_focus && window->xtransient_for != None) | ||||
|     meta_window_propagate_focus_appearance (window, FALSE); | ||||
|  | ||||
|   window->xtransient_for = None; | ||||
|    | ||||
|   if (value->type != META_PROP_VALUE_INVALID) | ||||
| @@ -1508,6 +1512,9 @@ reload_transient_for (MetaWindow    *window, | ||||
|  | ||||
|   if (!window->constructing && !window->override_redirect) | ||||
|     meta_window_queue (window, META_QUEUE_MOVE_RESIZE); | ||||
|  | ||||
|   if (window->has_focus && window->xtransient_for != None) | ||||
|     meta_window_propagate_focus_appearance (window, TRUE); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -33,7 +33,7 @@ | ||||
| #ifndef META_WORKSPACE_PRIVATE_H | ||||
| #define META_WORKSPACE_PRIVATE_H | ||||
|  | ||||
| #include "workspace.h" | ||||
| #include <meta/workspace.h> | ||||
| #include "window-private.h" | ||||
|  | ||||
| struct _MetaWorkspace | ||||
|   | ||||
| @@ -24,13 +24,14 @@ | ||||
|  */ | ||||
|  | ||||
| #include <config.h> | ||||
| #include "workspace.h" | ||||
| #include "screen-private.h" | ||||
| #include <meta/workspace.h> | ||||
| #include "workspace-private.h" | ||||
| #include "boxes-private.h" | ||||
| #include "errors.h" | ||||
| #include "prefs.h" | ||||
| #include <meta/errors.h> | ||||
| #include <meta/prefs.h> | ||||
|  | ||||
| #include "compositor.h" | ||||
| #include <meta/compositor.h> | ||||
|  | ||||
| #include <X11/Xatom.h> | ||||
| #include <string.h> | ||||
| @@ -45,7 +46,6 @@ enum { | ||||
| }; | ||||
|  | ||||
| void meta_workspace_queue_calc_showing   (MetaWorkspace *workspace); | ||||
| static void set_active_space_hint        (MetaScreen *screen); | ||||
| static void focus_ancestor_or_mru_window (MetaWorkspace *workspace, | ||||
|                                           MetaWindow    *not_this_one, | ||||
|                                           guint32        timestamp); | ||||
| @@ -557,7 +557,7 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace, | ||||
|  | ||||
|   workspace->screen->active_workspace = workspace; | ||||
|  | ||||
|   set_active_space_hint (workspace->screen); | ||||
|   meta_screen_set_active_workspace_hint (workspace->screen); | ||||
|  | ||||
|   /* If the "show desktop" mode is active for either the old workspace | ||||
|    * or the new one *but not both*, then update the | ||||
| @@ -752,32 +752,6 @@ meta_workspace_list_windows (MetaWorkspace *workspace) | ||||
|   return workspace_windows; | ||||
| } | ||||
|  | ||||
| static void | ||||
| set_active_space_hint (MetaScreen *screen) | ||||
| { | ||||
|   unsigned long data[1]; | ||||
|  | ||||
|   /* this is because we destroy the spaces in order, | ||||
|    * so we always end up setting a current desktop of | ||||
|    * 0 when closing a screen, so lose the current desktop | ||||
|    * on restart. By doing this we keep the current | ||||
|    * desktop on restart. | ||||
|    */ | ||||
|   if (screen->closing > 0) | ||||
|     return; | ||||
|    | ||||
|   data[0] = meta_workspace_index (screen->active_workspace); | ||||
|  | ||||
|   meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]); | ||||
|    | ||||
|   meta_error_trap_push (screen->display); | ||||
|   XChangeProperty (screen->display->xdisplay, screen->xroot, | ||||
|                    screen->display->atom__NET_CURRENT_DESKTOP, | ||||
|                    XA_CARDINAL, | ||||
|                    32, PropModeReplace, (guchar*) data, 1); | ||||
|   meta_error_trap_pop (screen->display); | ||||
| } | ||||
|  | ||||
| void | ||||
| meta_workspace_invalidate_work_area (MetaWorkspace *workspace) | ||||
| { | ||||
|   | ||||
| @@ -82,8 +82,8 @@ from The Open Group. | ||||
|  | ||||
| #include <config.h> | ||||
| #include "xprops.h" | ||||
| #include "errors.h" | ||||
| #include "util.h" | ||||
| #include <meta/errors.h> | ||||
| #include <meta/util.h> | ||||
| #include "async-getprop.h" | ||||
| #include "ui.h" | ||||
| #include "mutter-Xatomtype.h" | ||||
|   | ||||
| @@ -26,7 +26,7 @@ | ||||
| 
 | ||||
| #include <config.h> | ||||
| 
 | ||||
| #include "display.h" | ||||
| #include <meta/display.h> | ||||
| #include <X11/Xutil.h> | ||||
| 
 | ||||
| #ifdef HAVE_XSYNC | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user