Browse Source

Imported Upstream version 2.6.0

upstream upstream/2.6.0
Maximiliano Curia 8 years ago
parent
commit
95872cb5f1
  1. 4
      Makefile.am
  2. 35
      configure.ac
  3. 3
      data/Makefile.am
  4. 1723
      data/theme/metacity-theme-3.xml
  5. 2
      doc/Makefile.am
  6. 165
      doc/reference/Makefile.am
  7. 55
      doc/reference/muffin-docs.sgml.in
  8. 15
      doc/reference/muffin-overview.xml
  9. 100
      doc/reference/running-muffin.xml
  10. 6
      src/Makefile.am
  11. 135
      src/compositor/cogl-utils.c
  12. 21
      src/compositor/cogl-utils.h
  13. 148
      src/compositor/compositor.c
  14. 6
      src/compositor/meta-background-actor.c
  15. 500
      src/compositor/meta-plugin-manager.c
  16. 24
      src/compositor/meta-plugin-manager.h
  17. 126
      src/compositor/meta-plugin.c
  18. 25
      src/compositor/meta-shadow-factory.c
  19. 19
      src/compositor/meta-shaped-texture.c
  20. 7
      src/compositor/meta-texture-tower.c
  21. 54
      src/compositor/meta-window-actor.c
  22. 1
      src/compositor/meta-window-group.c
  23. 36
      src/compositor/plugins/default.c
  24. 7
      src/core/boxes.c
  25. 52
      src/core/constraints.c
  26. 3
      src/core/display-private.h
  27. 80
      src/core/display.c
  28. 5
      src/core/edge-resistance.c
  29. 6
      src/core/errors.c
  30. 13
      src/core/frame.c
  31. 10
      src/core/group.c
  32. 1276
      src/core/keybindings.c
  33. 36
      src/core/main.c
  34. 26
      src/core/muffin.c
  35. 35
      src/core/place.c
  36. 129
      src/core/prefs.c
  37. 24
      src/core/screen-private.h
  38. 575
      src/core/screen.c
  39. 2
      src/core/session.c
  40. 6
      src/core/util.c
  41. 11
      src/core/window-private.h
  42. 137
      src/core/window.c
  43. 41
      src/core/workspace.c
  44. 9
      src/meta/common.h
  45. 21
      src/meta/compositor.h
  46. 6
      src/meta/keybindings.h
  47. 25
      src/meta/meta-plugin.h
  48. 14
      src/meta/prefs.h
  49. 1
      src/meta/workspace.h
  50. 17
      src/org.cinnamon.muffin.gschema.xml.in
  51. 102
      src/ui/frames.c
  52. 7
      src/ui/frames.h
  53. 965
      src/ui/tabpopup.c
  54. 67
      src/ui/tabpopup.h
  55. 13
      src/ui/theme-parser.c
  56. 32
      src/ui/theme-viewer.c
  57. 29
      src/ui/theme.c
  58. 516
      src/ui/tile-hud.c
  59. 52
      src/ui/tile-hud.h
  60. 243
      src/ui/tile-preview.c
  61. 40
      src/ui/tile-preview.h
  62. 40
      src/ui/ui.c
  63. 10
      src/ui/ui.h

4
Makefile.am

@ -1,8 +1,10 @@
SUBDIRS=src po doc
SUBDIRS=src po doc data
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
EXTRA_DIST = HACKING MAINTAINERS rationales.txt
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
DISTCLEANFILES = intltool-extract intltool-merge intltool-update po/stamp-it po/.intltool-merge-cache

35
configure.ac

@ -1,8 +1,8 @@
AC_PREREQ(2.50)
m4_define([muffin_major_version], [2])
m4_define([muffin_minor_version], [4])
m4_define([muffin_micro_version], [5])
m4_define([muffin_minor_version], [6])
m4_define([muffin_micro_version], [0])
m4_define([muffin_version],
[muffin_major_version.muffin_minor_version.muffin_micro_version])
@ -10,11 +10,12 @@ m4_define([muffin_version],
m4_define([muffin_plugin_api_version], [3])
AC_INIT([muffin], [muffin_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=muffin])
[https://github.com/linuxmint/muffin/issues])
AC_CONFIG_SRCDIR(src/core/display.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AM_MAINTAINER_MODE([enable])
@ -78,13 +79,13 @@ CANBERRA_GTK_VERSION=0.26
CLUTTER_PACKAGE=clutter-1.0
MUFFIN_PC_MODULES="
gtk+-3.0 >= 3.3.7
gtk+-3.0 >= 3.9.12
gio-2.0 >= 2.25.10
pango >= 1.2.0
pango >= 1.14.0
cairo >= 1.10.0
cinnamon-desktop >= 2.3.0
xcomposite >= 0.2 xfixes xrender xdamage
$CLUTTER_PACKAGE >= 1.9.10
cinnamon-desktop >= 2.4.0
xcomposite >= 0.3 xfixes xrender xdamage
$CLUTTER_PACKAGE >= 1.10.0
cogl-1.0 >= 1.9.6
gl
"
@ -100,6 +101,11 @@ if test x$enable_verbose_mode = xyes; then
AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
fi
AC_ARG_ENABLE([gtk-doc],
AC_HELP_STRING([--enable-gtk-doc],
[use gtk-doc to build documentation [[default=yes]]]),,
enable_gtk_doc=yes)
AC_ARG_ENABLE(sm,
AC_HELP_STRING([--disable-sm],
[disable muffin's session management support, for embedded/size-sensitive custom non-GNOME builds]),,
@ -131,9 +137,7 @@ AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
AM_GLIB_GNU_GETTEXT
## here we get the flags we'll actually use
# GRegex requires Glib-2.14.0
PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0)
# gtk_window_set_icon_name requires gtk2+-2.6.0
PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.37.3)
PKG_CHECK_MODULES(MUFFIN_MESSAGE, gtk+-3.0)
PKG_CHECK_MODULES(MUFFIN_WINDOW_DEMO, gtk+-3.0)
@ -185,7 +189,7 @@ else
fi
fi
INTROSPECTION_VERSION=0.9.5
INTROSPECTION_VERSION=0.9.2
GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_VERSION])
if test x$found_introspection != xno; then
@ -415,13 +419,15 @@ AM_PATH_PYTHON([2.5])
# Use gnome-doc-utils:
GNOME_DOC_INIT([0.8.0])
GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
#### Warnings (last since -Werror can disturb other tests)
# Stay command-line compatible with the gnome-common configure option. Here
# minimum/yes/maximum are the same, however.
AC_ARG_ENABLE(compile_warnings,
AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],[Turn on compiler warnings]),,
enable_compile_warnings=error)
enable_compile_warnings=yes)
changequote(,)dnl
if test "$enable_compile_warnings" != no ; then
@ -478,8 +484,11 @@ changequote([,])dnl
AC_CONFIG_FILES([
Makefile
data/Makefile
doc/Makefile
doc/man/Makefile
doc/reference/Makefile
doc/reference/muffin-docs.sgml
src/Makefile
src/wm-tester/Makefile
src/libmuffin.pc

3
data/Makefile.am

@ -0,0 +1,3 @@
themedir = $(pkgdatadir)/theme
dist_theme_DATA = \
theme/metacity-theme-3.xml

1723
data/theme/metacity-theme-3.xml

File diff suppressed because it is too large

2
doc/Makefile.am

@ -1,4 +1,4 @@
SUBDIRS = man
SUBDIRS = man reference
EXTRA_DIST=theme-format.txt dialogs.txt code-overview.txt \
how-to-get-focus-right.txt

165
doc/reference/Makefile.am

@ -0,0 +1,165 @@
## Process this file with automake to produce Makefile.in
# We require automake 1.6 at least.
AUTOMAKE_OPTIONS = 1.6
# This is a blank Makefile.am for using gtk-doc.
# Copy this to your project's API docs directory and modify the variables to
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
# The name of the module, e.g. 'glib'.
DOC_MODULE=muffin
# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
#DOC_MODULE_VERSION=2
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
# Directories containing the source code, relative to $(srcdir).
# gtk-doc will search all .c and .h files beneath these paths
# for inline comments documenting functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk
DOC_SOURCE_DIR=../../src
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=--rebuild-types --rebuild-sections
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
MKDB_OPTIONS=--xml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=
# Extra options to supply to gtkdoc-mkhtml
MKHTML_OPTIONS=
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(top_srcdir)/src/*/*.h
CFILE_GLOB=$(top_srcdir)/src/*/*.c
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
EXTRA_HFILES=
# Header files or dirs to ignore when scanning. Use base file/dir names
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
IGNORE_HFILES= \
async-getprop.h \
atoms.h \
bell.h \
boxes-private.h \
clutter-utils.h \
cogl-utils.h \
compositor-private.h \
constraints.h \
core.h \
display-private.h \
draw-workspace.h \
edge-resistance.h \
eventqueue.h \
frame.h \
frames.h \
group-private.h \
group-props.h \
iconcache.h \
inlinepixbufs.h \
keybindings-private.h \
meta-background-actor-private.h \
meta-background-group-private.h \
meta-dbus-login1.h \
meta-module.h \
meta-plugin-manager.h \
meta-shadow-factory-private.h \
meta-texture-rectangle.h \
meta-texture-tower.h \
meta-window-actor-private.h \
meta-window-group.h \
meta-window-shape.h \
muffin-enum-types.h \
muffin-Xatomtype.h \
place.h \
preview-widget.h \
region-utils.h \
resizepopup.h \
screen-private.h \
session.h \
stack.h \
stack-tracker.h \
stamp-muffin-enum-types.h \
tabpopup.h \
theme.h \
theme-private.h \
tile-preview.h \
ui.h \
window-private.h \
window-props.h \
workspace-private.h \
xprops.h \
$(NULL)
MKDB_OPTIONS+=--ignore-files="$(IGNORE_HFILES)"
# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files= \
muffin-overview.xml \
running-muffin.xml \
$(NULL)
# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files= \
muffin-overview.xml \
running-muffin.xml \
$(NULL)
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_CFLAGS=$(MUFFIN_CFLAGS)
GTKDOC_LIBS=$(MUFFIN_LIBS) $(top_builddir)/src/libmuffin.la
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
EXTRA_DIST +=
# Files not to distribute
# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
DISTCLEANFILES = $(DOC_MODULES).types $(DOC_MODULES)-sections.txt
# Comment this out if you want 'make check' to test you doc status
# and run some sanity checks
if ENABLE_GTK_DOC
TESTS_ENVIRONMENT = cd $(srcdir) && \
DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
#TESTS = $(GTKDOC_CHECK)
endif
-include $(top_srcdir)/git.mk

55
doc/reference/muffin-docs.sgml.in

@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version "@VERSION@">
]>
<book id="index">
<bookinfo>
<title>Muffin Reference Manual</title>
<releaseinfo>
This document is for Muffin &version;.
</releaseinfo>
</bookinfo>
<xi:include href="xml/muffin-overview.xml"/>
<xi:include href="xml/running-muffin.xml"/>
<part id="core-reference">
<title>Muffin Core Reference</title>
<xi:include href="xml/main.xml"/>
<xi:include href="xml/common.xml"/>
<xi:include href="xml/prefs.xml"/>
<xi:include href="xml/util.xml"/>
<xi:include href="xml/errors.xml"/>
<xi:include href="xml/meta-plugin.xml"/>
<xi:include href="xml/boxes.xml"/>
<xi:include href="xml/compositor.xml"/>
<xi:include href="xml/display.xml"/>
<xi:include href="xml/group.xml"/>
<xi:include href="xml/keybindings.xml"/>
<xi:include href="xml/meta-background-actor.xml"/>
<xi:include href="xml/meta-shadow-factory.xml"/>
<xi:include href="xml/meta-shaped-texture.xml"/>
<xi:include href="xml/meta-window-actor.xml"/>
<xi:include href="xml/screen.xml"/>
<xi:include href="xml/window.xml"/>
<xi:include href="xml/workspace.xml"/>
</part>
<chapter id="object-tree">
<title>Object Hierarchy</title>
<xi:include href="xml/tree_index.sgml"/>
</chapter>
<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>
<index id="deprecated-api-index" role="deprecated">
<title>Index of deprecated API</title>
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
</index>
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</book>

15
doc/reference/muffin-overview.xml

@ -0,0 +1,15 @@
<part id="muffin-overview">
<title>Overview</title>
<partintro>
<para>Muffin is a GObject-based library for creating compositing window managers.</para>
<para>Compositors that wish to use Mutter must implement a subclass of #MetaPlugin and register it with meta_plugin_manager_set_plugin_type() before calling meta_init() but after g_type_init().</para>
<para>#MetaPlugin provides virtual functions that allow to override default behavior in the window management code, such as the effect to perform when a window is created or when switching workspaces.</para>
</partintro>
</part>

100
doc/reference/running-muffin.xml

@ -0,0 +1,100 @@
<part id="running-muffin">
<title>Running Muffin</title>
<partintro>
<section id="environment-variables">
<title>Environment Variables</title>
<para>
Muffin automatically checks environment variables during
its initialization. These environment variables are meant
as debug tools or overrides for default behaviours:
</para>
<variablelist>
<varlistentry>
<term>MUFFIN_VERBOSE</term>
<listitem>
<para>Enable verbose mode, in which more information is printed to the console. Muffin needs to be built with the --enable-verbose-mode option (enabled by default). For more fine-grained control of the output, see meta_add_verbose_topic().</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DEBUG</term>
<listitem>
<para>Traps and prints X errors to the console.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_G_FATAL_WARNINGS</term>
<listitem>
<para>Causes any logging from the domains Muffin, Gtk, Gdk, Pango or GLib to terminate the process (only when using the log functions in GLib).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_USE_LOGFILE</term>
<listitem>
<para>Log all messages to a temporary file.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DEBUG_XINERAMA</term>
<listitem>
<para>Log extra information about support of the XINERAMA extension.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DEBUG_SM</term>
<listitem>
<para>Log extra information about session management.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DEBUG_BUTTON_GRABS</term>
<listitem>
<para>Log extra information about button grabs.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_SYNC</term>
<listitem>
<para>Call XSync after each X call.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DISPLAY</term>
<listitem>
<para>Name of the X11 display to use.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>META_DISABLE_MIPMAPS</term>
<listitem>
<para>Disable use of mipmaps for the textures that back window pixmaps.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_USE_STATIC_GRAVITY</term>
<listitem>
<para>Enable support for clients with static bit-gravity.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_WM_CLASS_FILTER</term>
<listitem>
<para>Comma-separated list of WM_CLASS names to which to restrict Muffin to.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>MUFFIN_DISABLE_FALLBACK_COLOR</term>
<listitem>
<para>Disable fallback for themed colors, for easier detection of typographical errors.</para>
</listitem>
</varlistentry>
</variablelist>
</section>
</partintro>
</part>

6
src/Makefile.am

@ -132,18 +132,12 @@ libmuffin_la_SOURCES = \
inlinepixbufs.h \
ui/frames.c \
ui/frames.h \
ui/tile-hud.c \
ui/tile-hud.h \
ui/menu.c \
ui/menu.h \
ui/metaaccellabel.c \
ui/metaaccellabel.h \
ui/resizepopup.c \
ui/resizepopup.h \
ui/tabpopup.c \
ui/tabpopup.h \
ui/tile-preview.c \
ui/tile-preview.h \
ui/theme-parser.c \
ui/theme.c \
meta/theme.h \

135
src/compositor/cogl-utils.c

@ -111,3 +111,138 @@ meta_create_texture_material (CoglHandle src_texture)
return material;
}
/********************************************************************************************/
/********************************* CoglTexture2d wrapper ************************************/
static CoglContext *cogl_context = NULL;
static gboolean supports_npot = FALSE;
inline static gboolean
hardware_supports_npot_sizes (void)
{
if (cogl_context != NULL)
return supports_npot;
ClutterBackend *backend = clutter_get_default_backend ();
cogl_context = clutter_backend_get_cogl_context (backend);
supports_npot = cogl_has_feature (cogl_context, COGL_FEATURE_ID_TEXTURE_NPOT);
return supports_npot;
}
/**
* meta_cogl_texture_new_from_data_wrapper: (skip)
*
* Decides whether to use the newer (apparently safer)
* cogl_texture_2d_new_from_data or the older cogl_texture_new_from_data
* depending on if the GPU supports it.
*/
CoglTexture *
meta_cogl_texture_new_from_data_wrapper (int width,
int height,
CoglTextureFlags flags,
CoglPixelFormat format,
CoglPixelFormat internal_format,
int rowstride,
const uint8_t *data)
{
CoglTexture *texture = NULL;
if (hardware_supports_npot_sizes ())
{
texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (cogl_context, width, height,
format,
#if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0)
COGL_PIXEL_FORMAT_ANY,
#endif
rowstride,
data,
NULL));
}
else
{
texture = cogl_texture_new_from_data (width,
height,
flags,
format,
internal_format,
rowstride,
data);
}
return texture;
}
/**
* meta_cogl_texture_new_from_file_wrapper: (skip)
*
* Decides whether to use the newer (apparently safer)
* cogl_texture_2d_new_from_file or the older cogl_texture_new_from_file
* depending on if the GPU supports it.
*/
CoglTexture *
meta_cogl_texture_new_from_file_wrapper (const char *filename,
CoglTextureFlags flags,
CoglPixelFormat internal_format)
{
CoglTexture *texture = NULL;
if (hardware_supports_npot_sizes ())
{
texture = COGL_TEXTURE (cogl_texture_2d_new_from_file (cogl_context,
filename,
#if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0)
COGL_PIXEL_FORMAT_ANY,
#endif
NULL));
}
else
{
texture = cogl_texture_new_from_file (filename,
flags,
internal_format,
NULL);
}
return texture;
}
/**
* meta_cogl_texture_new_with_size_wrapper: (skip)
*
* Decides whether to use the newer (apparently safer)
* cogl_texture_2d_new_with_size or the older cogl_texture_new_with_size
* depending on if the GPU supports it.
*/
CoglTexture *
meta_cogl_texture_new_with_size_wrapper (int width,
int height,
CoglTextureFlags flags,
CoglPixelFormat internal_format)
{
CoglTexture *texture = NULL;
if (hardware_supports_npot_sizes ())
{
texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (cogl_context,
width,
height
#if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0)
,CLUTTER_CAIRO_FORMAT_ARGB32
#endif
));
}
else
{
texture = cogl_texture_new_with_size (width, height,
flags,
internal_format);
}
return texture;
}

21
src/compositor/cogl-utils.h

@ -23,7 +23,11 @@
#ifndef __META_COGL_UTILS_H__
#define __META_COGL_UTILS_H__
#define COGL_ENABLE_EXPERIMENTAL_API
#define CLUTTER_ENABLE_EXPERIMENTAL_API
#include <cogl/cogl.h>
#include <clutter/clutter.h>
CoglHandle meta_create_color_texture_4ub (guint8 red,
guint8 green,
@ -32,4 +36,21 @@ CoglHandle meta_create_color_texture_4ub (guint8 red,
CoglTextureFlags flags);
CoglHandle meta_create_texture_material (CoglHandle src_texture);
CoglTexture * meta_cogl_texture_new_from_data_wrapper (int width,
int height,
CoglTextureFlags flags,
CoglPixelFormat format,
CoglPixelFormat internal_format,
int rowstride,
const uint8_t *data);
CoglTexture * meta_cogl_texture_new_from_file_wrapper (const char *filename,
CoglTextureFlags flags,
CoglPixelFormat internal_format);
CoglTexture * meta_cogl_texture_new_with_size_wrapper (int width,
int height,
CoglTextureFlags flags,
CoglPixelFormat internal_format);
#endif /* __META_COGL_UTILS_H__ */

148
src/compositor/compositor.c

@ -1,5 +1,61 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/**
* SECTION:compositor
* @title: MetaCompositor
* @short_Description: Compositor API
*
* At a high-level, a window is not-visible or visible. When a
* window is added (with meta_compositor_add_window()) it is not visible.
* meta_compositor_show_window() indicates a transition from not-visible to
* visible. Some of the reasons for this:
*
* - Window newly created
* - Window is unminimized
* - Window is moved to the current desktop
* - Window was made sticky
*
* meta_compositor_hide_window() indicates that the window has transitioned from
* visible to not-visible. Some reasons include:
*
* - Window was destroyed
* - Window is minimized
* - Window is moved to a different desktop
* - Window no longer sticky.
*
* Note that combinations are possible - a window might have first
* been minimized and then moved to a different desktop. The 'effect' parameter
* to meta_compositor_show_window() and meta_compositor_hide_window() is a hint
* as to the appropriate effect to show the user and should not
* be considered to be indicative of a state change.
*
* When the active workspace is changed, meta_compositor_switch_workspace() is
* called first, then meta_compositor_show_window() and
* meta_compositor_hide_window() are called individually for each window
* affected, with an effect of META_COMP_EFFECT_NONE.
* If hiding windows will affect the switch workspace animation, the
* compositor needs to delay hiding the windows until the switch
* workspace animation completes.
*
* meta_compositor_maximize_window() and meta_compositor_unmaximize_window()
* are transitions within the visible state. The window is resized __before__
* the call, so it may be necessary to readjust the display based on the
* old_rect to start the animation.
*
* # Containers #
*
* There's two containers in the stage that are used to place window actors, here
* are listed in the order in which they are painted:
*
* - window group, accessible with meta_get_window_group_for_screen()
* - top window group, accessible with meta_get_top_window_group_for_screen()
*
* Muffin will place actors representing windows in the window group, except for
* override-redirect windows (ie. popups and menus) which will be placed in the
* top window group.
*/
#include <config.h>
#include <clutter/x11/clutter-x11.h>
@ -385,7 +441,6 @@ meta_begin_modal_for_plugin (MetaScreen *screen,
Display *xdpy = meta_display_get_xdisplay (display);
MetaCompositor *compositor = display->compositor;
gboolean pointer_grabbed = FALSE;
gboolean keyboard_grabbed = FALSE;
int result;
if (compositor->modal_plugin != NULL || display->grab_op != META_GRAB_OP_NONE)
@ -416,8 +471,6 @@ meta_begin_modal_for_plugin (MetaScreen *screen,
if (result != Success)
goto fail;
keyboard_grabbed = TRUE;
}
display->grab_op = META_GRAB_OP_COMPOSITOR;
@ -433,8 +486,6 @@ meta_begin_modal_for_plugin (MetaScreen *screen,
fail:
if (pointer_grabbed)
XUngrabPointer (xdpy, timestamp);
if (keyboard_grabbed)
XUngrabKeyboard (xdpy, timestamp);
return FALSE;
}
@ -594,9 +645,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
clutter_actor_hide (info->hidden_group);
info->plugin_mgr =
meta_plugin_manager_get (screen);
meta_plugin_manager_initialize (info->plugin_mgr);
info->plugin_mgr = meta_plugin_manager_new (screen);
/*
* Delay the creation of the overlay window as long as we can, to avoid
@ -908,29 +957,6 @@ meta_compositor_unmaximize_window (MetaCompositor *compositor,
meta_window_actor_unmaximize (window_actor, old_rect, new_rect);
}
void
meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
MetaWorkspace *workspace)
{
#if 0
/* FIXME -- should do away with this function in favour of MetaWorkspace
* signal.
*/
MetaScreen *screen = meta_workspace_get_screen (workspace);
MetaCompScreen *info;
MetaPluginManager *mgr;
DEBUG_TRACE ("meta_compositor_update_workspace_geometry\n");
info = meta_screen_get_compositor_data (screen);
mgr = info->plugin_mgr;
if (!mgr || !workspace)
return;
meta_plugin_manager_update_workspace (mgr, workspace);
#endif
}
void
meta_compositor_switch_workspace (MetaCompositor *compositor,
MetaScreen *screen,
@ -1425,3 +1451,63 @@ meta_compositor_flash_screen (MetaCompositor *compositor,
"signal-after::completed", flash_in_completed, flash,
NULL);
}
void
meta_compositor_show_tile_preview (MetaCompositor *compositor,
MetaScreen *screen,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number,
guint snap_queued)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_show_tile_preview (info->plugin_mgr,
window, tile_rect, tile_monitor_number,
snap_queued);
}
void
meta_compositor_hide_tile_preview (MetaCompositor *compositor,
MetaScreen *screen)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_hide_tile_preview (info->plugin_mgr);
}
void
meta_compositor_show_hud_preview (MetaCompositor *compositor,
MetaScreen *screen,
guint current_proximity_zone,
MetaRectangle *work_area,
guint snap_queued)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_show_hud_preview (info->plugin_mgr,
current_proximity_zone,
work_area,
snap_queued);
}
void
meta_compositor_hide_hud_preview (MetaCompositor *compositor,
MetaScreen *screen)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_hide_hud_preview (info->plugin_mgr);
}

6
src/compositor/meta-background-actor.c

@ -23,6 +23,12 @@
* Portions adapted from gnome-shell/src/shell-global.c
*/
/**
* SECTION:meta-background-actor
* @title: MetaBackgroundActor
* @short_description: Actor for painting the root window background
*/
#include <config.h>
#define COGL_ENABLE_EXPERIMENTAL_API

500
src/compositor/meta-plugin-manager.c

@ -35,34 +35,32 @@
#include <clutter/x11/clutter-x11.h>
static GSList *plugin_types;
/*
* We have one "default plugin manager" that acts for the first screen,
* but also can be used before we open any screens, and additional
* 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 GType plugin_type = G_TYPE_NONE;
struct MetaPluginManager
{
MetaScreen *screen;
GList /* MetaPlugin */ *plugins; /* TODO -- maybe use hash table */
MetaPlugin *plugin;
};
void
meta_plugin_manager_set_plugin_type (GType gtype)
{
if (plugin_type != G_TYPE_NONE)
meta_fatal ("Muffin plugin already set: %s", g_type_name (plugin_type));
plugin_type = gtype;
}
/*
* Loads the given plugin.
*/
void
meta_plugin_manager_load (MetaPluginManager *plugin_mgr,
const gchar *plugin_name)
meta_plugin_manager_load (const gchar *plugin_name)
{
const gchar *dpath = MUFFIN_PLUGIN_DIR "/";
gchar *path;
MetaModule *module;
GType plugin_type;
if (g_path_is_absolute (plugin_name))
path = g_strdup (plugin_name);
@ -81,162 +79,47 @@ meta_plugin_manager_load (MetaPluginManager *plugin_mgr,
exit (1);
}
plugin_type = meta_module_get_plugin_type (module);
meta_plugin_manager_register (plugin_mgr, plugin_type);
meta_plugin_manager_set_plugin_type (meta_module_get_plugin_type (module));
g_type_module_unuse (G_TYPE_MODULE (module));
g_free (path);
}
/*
* Registers the given plugin type
*/
LOCAL_SYMBOL void
meta_plugin_manager_register (MetaPluginManager *plugin_mgr,
GType plugin_type)
{
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);
}
LOCAL_SYMBOL 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;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
g_object_set (plugin,
"screen", plugin_mgr->screen,
NULL);
if (klass->start)
klass->start (plugin);
}
}
static MetaPluginManager *
MetaPluginManager *
meta_plugin_manager_new (MetaScreen *screen)
{
MetaPluginManager *plugin_mgr;
MetaPluginClass *klass;
MetaPlugin *plugin;
plugin_mgr = g_new0 (MetaPluginManager, 1);
plugin_mgr->screen = screen;
plugin_mgr->plugin = plugin = g_object_new (plugin_type, "screen", screen, NULL);
if (screen)
g_object_set_data (G_OBJECT (screen), "meta-plugin-manager", plugin_mgr);
klass = META_PLUGIN_GET_CLASS (plugin);
return plugin_mgr;
}
if (klass->start)
klass->start(plugin);
MetaPluginManager *
meta_plugin_manager_get_default (void)
{
if (!default_plugin_manager)
{
default_plugin_manager = meta_plugin_manager_new (NULL);
}
return default_plugin_manager;
}
LOCAL_SYMBOL MetaPluginManager *
meta_plugin_manager_get (MetaScreen *screen)
{
MetaPluginManager *plugin_mgr;
plugin_mgr = g_object_get_data (G_OBJECT (screen), "meta-plugin-manager");
if (plugin_mgr)
return plugin_mgr;
if (!default_plugin_manager)
meta_plugin_manager_get_default ();
if (!default_plugin_manager->screen)
{
/* The default plugin manager is so far unused, we can recycle it */
default_plugin_manager->screen = screen;
g_object_set_data (G_OBJECT (screen), "meta-plugin-manager", default_plugin_manager);
return default_plugin_manager;
}
else
{
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;
}
return plugin_mgr;
}
static void
meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr,
MetaWindowActor *actor)
{
GList *l = plugin_mgr->plugins;
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
while (l)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
if (!meta_plugin_disabled (plugin)
&& klass->kill_window_effects)
if (klass->kill_window_effects)
klass->kill_window_effects (plugin, actor);
l = l->next;
}
}
static void
meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr)
{
GList *l = plugin_mgr->plugins;
while (l)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
if (!meta_plugin_disabled (plugin)
&& (meta_plugin_features (plugin) & META_PLUGIN_SWITCH_WORKSPACE)
&& klass->kill_switch_workspace)
klass->kill_switch_workspace (plugin);
l = l->next;
}
}
/*
* Public method that the compositor hooks into for events that require
* no additional parameters.
*
* Returns TRUE if at least one of the plugins handled the event type (i.e.,
* Returns TRUE if the plugin handled the event type (i.e.,
* if the return value is FALSE, there will be no subsequent call to the
* manager completed() callback, and the compositor must ensure that any
* appropriate post-effect cleanup is carried out.
@ -246,70 +129,56 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
MetaWindowActor *actor,
unsigned long event)
{
GList *l = plugin_mgr->plugins;
gboolean retval = FALSE;
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
gboolean retval = FALSE;
if (display->display_opening)
return FALSE;
if (display->display_opening)
return FALSE;
while (l)
switch (event)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
case META_PLUGIN_MINIMIZE:
if (klass->minimize)
{
retval = TRUE;
meta_plugin_manager_kill_window_effects (plugin_mgr, actor);
if (!meta_plugin_disabled (plugin) &&
(meta_plugin_features (plugin) & event))
{
retval = TRUE;
_meta_plugin_effect_started (plugin);
klass->minimize (plugin, actor);
}
break;
case META_PLUGIN_MAP:
if (klass->map)
{
retval = TRUE;
meta_plugin_manager_kill_window_effects (plugin_mgr, actor);
switch (event)
_meta_plugin_effect_started (plugin);
klass->map (plugin, actor);
}
break;
case META_PLUGIN_DESTROY:
if (klass->destroy)
{
case META_PLUGIN_MINIMIZE:
if (klass->minimize)
{
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->minimize (plugin, actor);
}
break;
case META_PLUGIN_MAP:
if (klass->map)
{
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->map (plugin, actor);
}
break;
case META_PLUGIN_DESTROY:
if (klass->destroy)
{
_meta_plugin_effect_started (plugin);
klass->destroy (plugin, actor);
}
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
retval = TRUE;
_meta_plugin_effect_started (plugin);
klass->destroy (plugin, actor);
}
}
l = l->next;
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
}
return retval;
return retval;
}
/*
* The public method that the compositor hooks into for maximize and unmaximize
* events.
*
* Returns TRUE if at least one of the plugins handled the event type (i.e.,
* Returns TRUE if the plugin handled the event type (i.e.,
* if the return value is FALSE, there will be no subsequent call to the
* manager completed() callback, and the compositor must ensure that any
* appropriate post-effect cleanup is carried out.
@ -323,77 +192,67 @@ meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr,
gint target_width,
gint target_height)
{
GList *l = plugin_mgr->plugins;
gboolean retval = FALSE;
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
gboolean retval = FALSE;
if (display->display_opening)
return FALSE;
if (display->display_opening)
return FALSE;
while (l)
switch (event)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
if (!meta_plugin_disabled (plugin) &&
(meta_plugin_features (plugin) & event))
{
retval = TRUE;
switch (event)
case META_PLUGIN_MAXIMIZE:
if (klass->maximize)
{
case META_PLUGIN_MAXIMIZE:
if (klass->maximize)
{
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->maximize (plugin, actor,
target_x, target_y,
target_width, target_height);
}
break;
case META_PLUGIN_UNMAXIMIZE:
if (klass->unmaximize)
{
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->unmaximize (plugin, actor,
target_x, target_y,
target_width, target_height);
}
break;
case META_PLUGIN_TILE:
if (klass->tile)
{
meta_plugin_manager_kill_window_effects (plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->tile (plugin, actor,
retval = TRUE;
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->maximize (plugin, actor,
target_x, target_y,
target_width, target_height);
}
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
}
}
break;
case META_PLUGIN_UNMAXIMIZE:
if (klass->unmaximize)
{
retval = TRUE;
meta_plugin_manager_kill_window_effects (
plugin_mgr,
actor);
l = l->next;
_meta_plugin_effect_started (plugin);
klass->unmaximize (plugin, actor,
target_x, target_y,
target_width, target_height);
}
break;
case META_PLUGIN_TILE:
if (klass->tile)
{
retval = TRUE;
meta_plugin_manager_kill_window_effects (plugin_mgr,
actor);
_meta_plugin_effect_started (plugin);
klass->tile (plugin, actor,
target_x, target_y,
target_width, target_height);
}
break;
default:
g_warning ("Incorrect handler called for event %lu", event);
}
return retval;
return retval;
}
/*
* The public method that the compositor hooks into for desktop switching.
*
* Returns TRUE if at least one of the plugins handled the event type (i.e.,
* Returns TRUE if the plugin handled the event type (i.e.,
* if the return value is FALSE, there will be no subsequent call to the
* manager completed() callback, and the compositor must ensure that any
* appropriate post-effect cleanup is carried out.
@ -404,41 +263,29 @@ meta_plugin_manager_switch_workspace (MetaPluginManager *plugin_mgr,
gint to,
MetaMotionDirection direction)
{
GList *l = plugin_mgr->plugins;
gboolean retval = FALSE;
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
gboolean retval = FALSE;
if (display->display_opening)
return FALSE;
if (display->display_opening)
return FALSE;
while (l)
if (klass->switch_workspace)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
if (!meta_plugin_disabled (plugin) &&
(meta_plugin_features (plugin) & META_PLUGIN_SWITCH_WORKSPACE))
{
if (klass->switch_workspace)
{
retval = TRUE;
meta_plugin_manager_kill_switch_workspace (plugin_mgr);
retval = TRUE;
_meta_plugin_effect_started (plugin);
klass->switch_workspace (plugin, from, to, direction);
}
}
l = l->next;
_meta_plugin_effect_started (plugin);
klass->switch_workspace (plugin, from, to, direction);
}
return retval;
return retval;
}
/*
* The public method that the compositor hooks into for desktop switching.
*
* Returns TRUE if at least one of the plugins handled the event type (i.e.,
* Returns TRUE if the plugin handled the event type (i.e.,
* if the return value is FALSE, there will be no subsequent call to the
* manager completed() callback, and the compositor must ensure that any
* appropriate post-effect cleanup is carried out.
@ -447,49 +294,104 @@ LOCAL_SYMBOL gboolean
meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
XEvent *xev)
{
GList *l;
gboolean have_plugin_xevent_func;
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
if (!plugin_mgr)
return FALSE;
l = plugin_mgr->plugins;
/* We need to make sure that clutter gets certain events, like
* ConfigureNotify on the stage window. If there is a plugin that
* provides an xevent_filter function, then it's the responsibility
* of that plugin to pass events to Clutter. Otherwise, we send the
* event directly to Clutter ourselves.
*
* What happens if there are two plugins with xevent_filter functions
* is undefined; in general, multiple competing plugins are something
* we don't support well or care much about.
*
* FIXME: Really, we should just always handle sending the event to
* clutter if a plugin doesn't report the event as handled by
* returning TRUE, but it doesn't seem worth breaking compatibility
* of the plugin interface right now to achieve this; the way it is
* now works fine in practice.
*/
have_plugin_xevent_func = FALSE;
if (klass->xevent_filter)
return klass->xevent_filter (plugin, xev);
else
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
}
gboolean
meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number,
guint snap_queued)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
while (l)
if (klass->show_tile_preview)
{
MetaPlugin *plugin = l->data;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
klass->show_tile_preview (plugin, window, tile_rect, tile_monitor_number, snap_queued);
return TRUE;
}
if (klass->xevent_filter)
{
have_plugin_xevent_func = TRUE;
if (klass->xevent_filter (plugin, xev) == TRUE)
return TRUE;
}
return FALSE;
}
l = l->next;
gboolean
meta_plugin_manager_hide_tile_preview (MetaPluginManager *plugin_mgr)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
if (klass->hide_tile_preview)
{
klass->hide_tile_preview (plugin);
return TRUE;
}
if (!have_plugin_xevent_func)
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
return FALSE;
}
gboolean
meta_plugin_manager_show_hud_preview (MetaPluginManager *plugin_mgr,
guint current_proximity_zone,
MetaRectangle *work_area,
guint snap_queued)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
if (klass->show_hud_preview)
{
klass->show_hud_preview (plugin, current_proximity_zone,
work_area, snap_queued);
return TRUE;
}
return FALSE;
}
return FALSE;
gboolean
meta_plugin_manager_hide_hud_preview (MetaPluginManager *plugin_mgr)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
if (klass->hide_hud_preview)
{
klass->hide_hud_preview (plugin);
return TRUE;
}
return FALSE;
}

24
src/compositor/meta-plugin-manager.h

@ -47,14 +47,9 @@
*/
typedef struct MetaPluginManager MetaPluginManager;
MetaPluginManager * meta_plugin_manager_get (MetaScreen *screen);
MetaPluginManager * meta_plugin_manager_get_default (void);
MetaPluginManager * meta_plugin_manager_new (MetaScreen *screen);
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);
void meta_plugin_manager_load (const gchar *plugin_name);
gboolean meta_plugin_manager_event_simple (MetaPluginManager *mgr,
MetaWindowActor *actor,
@ -80,4 +75,19 @@ gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr,
gboolean meta_plugin_manager_xevent_filter (MetaPluginManager *mgr,
XEvent *xev);
gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number,
guint snap_queued);
gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *plugin_mgr);
gboolean meta_plugin_manager_show_hud_preview (MetaPluginManager *plugin_mgr,
guint current_proximity_zone,
MetaRectangle *work_area,
guint snap_queued);
gboolean meta_plugin_manager_hide_hud_preview (MetaPluginManager *plugin_mgr);
#endif

126
src/compositor/meta-plugin.c

@ -21,6 +21,12 @@
* 02110-1335, USA.
*/
/**
* SECTION:meta-plugin