Browse Source

Imported Upstream version 3.2.0

tags/upstream/3.2.0^0
Margarita Manterola 4 years ago
parent
commit
56dbd9acaa
31 changed files with 578 additions and 401 deletions
  1. +0
    -2
      Makefile.am
  2. +33
    -15
      autogen.sh
  3. +14
    -63
      configure.ac
  4. +1
    -1
      doc/reference/Makefile.am
  5. +7
    -4
      src/Makefile.am
  6. +19
    -3
      src/compositor/cogl-utils.c
  7. +34
    -38
      src/compositor/compositor.c
  8. +2
    -0
      src/compositor/meta-background-actor-private.h
  9. +86
    -106
      src/compositor/meta-background-actor.c
  10. +245
    -0
      src/compositor/meta-background.c
  11. +44
    -0
      src/compositor/meta-background.h
  12. +27
    -14
      src/compositor/meta-window-actor.c
  13. +4
    -4
      src/compositor/meta-window-group.c
  14. +3
    -3
      src/compositor/plugins/Makefile.am
  15. +2
    -2
      src/core/constraints.c
  16. +0
    -2
      src/core/muffin.c
  17. +10
    -0
      src/core/screen.c
  18. +7
    -2
      src/core/window-private.h
  19. +10
    -37
      src/core/window-props.c
  20. +7
    -2
      src/core/window.c
  21. +0
    -1
      src/meta/atomnames.h
  22. +2
    -2
      src/meta/meta-window-actor.h
  23. +1
    -1
      src/tools/Makefile.am
  24. +0
    -2
      src/tools/muffin-grayscale.c
  25. +0
    -57
      src/ui/frames.c
  26. +0
    -7
      src/ui/frames.h
  27. +0
    -12
      src/ui/ui.c
  28. +0
    -7
      src/ui/ui.h
  29. +1
    -1
      src/wm-tester/Makefile.am
  30. +18
    -12
      src/wm-tester/main.c
  31. +1
    -1
      src/wm-tester/test-attached.c

+ 0
- 2
Makefile.am View File

@@ -1,8 +1,6 @@

SUBDIRS=src po doc data

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

EXTRA_DIST = HACKING MAINTAINERS rationales.txt

DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc


+ 33
- 15
autogen.sh View File

@@ -1,22 +1,40 @@
#!/bin/bash
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
test -n "$srcdir" || srcdir=$(dirname "$0")
test -n "$srcdir" || srcdir=.

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
olddir=$(pwd)

PKG_NAME="muffin"
REQUIRED_AUTOMAKE_VERSION=1.10
cd $srcdir

(test -f $srcdir/configure.ac \
&& test -d $srcdir/src) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level muffin directory"
(test -f configure.ac) || {
echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
exit 1
}

which gnome-autogen.sh || {
echo "You need to install gnome-common from GNOME Subversion (or from"
echo "your distribution's package manager)."
exit 1
}
USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
# shellcheck disable=SC2016
PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)

if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
echo "*** If you wish to pass any to it, please specify them on the" >&2
echo "*** '$0' command line." >&2
echo "" >&2
fi

aclocal --install || exit 1
glib-gettextize --force --copy || exit 1
gtkdocize --copy || exit 1
intltoolize --force --copy --automake || exit 1
autoreconf --verbose --force --install || exit 1

cd "$olddir"
if [ "$NOCONFIGURE" = "" ]; then
$srcdir/configure "$@" || exit 1

if [ "$1" = "--help" ]; then exit 0 else
echo "Now type 'make' to compile $PKG_NAME" || exit 1
fi
else
echo "Skipping configure process."
fi

+ 14
- 63
configure.ac View File

@@ -1,8 +1,8 @@
AC_PREREQ(2.50)

m4_define([muffin_major_version], [3])
m4_define([muffin_minor_version], [0])
m4_define([muffin_micro_version], [5])
m4_define([muffin_minor_version], [2])
m4_define([muffin_micro_version], [0])

m4_define([muffin_version],
[muffin_major_version.muffin_minor_version.muffin_micro_version])
@@ -12,6 +12,8 @@ m4_define([muffin_plugin_api_version], [3])
AC_INIT([muffin], [muffin_version],
[https://github.com/linuxmint/muffin/issues])

m4_ifdef([AX_IS_RELEASE], [AX_IS_RELEASE([always])])

AC_CONFIG_SRCDIR(src/core/display.c)
AC_CONFIG_HEADERS(config.h)

@@ -33,7 +35,7 @@ MUFFIN_PLUGIN_DIR="$libdir/$PACKAGE/plugins"
AC_SUBST(MUFFIN_PLUGIN_DIR)

# Honor aclocal flags
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"])

GETTEXT_PACKAGE=muffin
AC_SUBST(GETTEXT_PACKAGE)
@@ -96,6 +98,7 @@ AC_ARG_ENABLE(verbose-mode,
AC_HELP_STRING([--disable-verbose-mode],
[disable muffin's ability to do verbose logging, for embedded/size-sensitive custom builds]),,
enable_verbose_mode=yes)
dnl '

if test x$enable_verbose_mode = xyes; then
AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
@@ -110,11 +113,14 @@ AC_ARG_ENABLE(sm,
AC_HELP_STRING([--disable-sm],
[disable muffin's session management support, for embedded/size-sensitive custom non-GNOME builds]),,
enable_sm=auto)
dnl '


AC_ARG_ENABLE(startup-notification,
AC_HELP_STRING([--disable-startup-notification],
[disable muffin's startup notification support, for embedded/size-sensitive custom non-GNOME builds]),,
enable_startup_notification=auto)
dnl '

AC_ARG_WITH(libcanberra,
AC_HELP_STRING([--without-libcanberra],
@@ -125,11 +131,13 @@ AC_ARG_ENABLE(xsync,
AC_HELP_STRING([--disable-xsync],
[disable muffin's use of the XSync extension]),,
enable_xsync=auto)
dnl '

AC_ARG_ENABLE(shape,
AC_HELP_STRING([--disable-shape],
[disable muffin's use of the shaped window extension]),,
enable_shape=auto)
dnl '

## try definining HAVE_BACKTRACE
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
@@ -240,6 +248,7 @@ AC_ARG_ENABLE(xinerama,
AC_HELP_STRING([--disable-xinerama],
[disable muffin's use of the Xinerama extension]),
try_xinerama=$enable_xinerama,try_xinerama=yes)
dnl '

use_solaris_xinerama=no
use_xfree_xinerama=no
@@ -423,66 +432,8 @@ AC_CHECK_DECL([GL_EXT_x11_sync_object],
[AC_MSG_ERROR([GL_EXT_x11_sync_object definition not found, please update your GL headers])],
[#include <GL/glx.h>])

#### 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=yes)

changequote(,)dnl
if test "$enable_compile_warnings" != no ; then
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac

# case " $CFLAGS " in
# *[\ \ ]-Wshadow[\ \ ]*) ;;
# *) CFLAGS="$CFLAGS -Wshadow" ;;
# esac

case " $CFLAGS " in
*[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
esac

case " $CFLAGS " in
*[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
esac

case " $CFLAGS " in
*[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
esac

case " $CFLAGS " in
*[\ \ ]-Wnested-externs[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wnested-externs" ;;
esac

case " $CFLAGS " in
*[\ \ ]-Wpointer-arith[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wpointer-arith" ;;
esac

case " $CFLAGS " in
*[\ \ ]-Wsign-compare[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wsign-compare" ;;
esac

if test "$enable_compile_warnings" = error; then
case " $CFLAGS " in
*[\ \ ]-Werror[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
esac
fi
fi
fi
changequote([,])dnl
m4_ifdef([AX_COMPILER_FLAGS],
[AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS])])

AC_CONFIG_FILES([
Makefile


+ 1
- 1
doc/reference/Makefile.am View File

@@ -138,7 +138,7 @@ expand_content_files= \
# 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_CFLAGS=$(WARN_CFLAGS) $(MUFFIN_CFLAGS)
GTKDOC_LIBS=$(MUFFIN_LIBS) $(top_builddir)/src/libmuffin.la

# This includes the standard gtk-doc make rules, copied by gtkdocize.


+ 7
- 4
src/Makefile.am View File

@@ -8,6 +8,7 @@ SUBDIRS=wm-tester tools compositor/plugins
AM_CPPFLAGS= \
-DCLUTTER_ENABLE_EXPERIMENTAL_API \
-DCOGL_ENABLE_EXPERIMENTAL_API \
$(WARN_CFLAGS) \
$(MUFFIN_CFLAGS) \
-I$(srcdir) \
-I$(srcdir)/core \
@@ -44,6 +45,8 @@ libmuffin_la_SOURCES = \
compositor/cogl-utils.h \
compositor/compositor.c \
compositor/compositor-private.h \
compositor/meta-background.c \
compositor/meta-background.h \
compositor/meta-background-actor.c \
compositor/meta-background-actor-private.h \
compositor/meta-module.c \
@@ -151,7 +154,7 @@ libmuffin_la_SOURCES = \
ui/preview-widget.c \
$(muffin_built_sources)

libmuffin_la_LDFLAGS = -no-undefined
libmuffin_la_LDFLAGS = $(WARN_LDFLAGS) -no-undefined
libmuffin_la_LIBADD = $(MUFFIN_LIBS) -lclutter-glx-1.0

# Headers installed for plugins; introspected information will
@@ -233,7 +236,7 @@ Meta-$(api_version).gir: libmuffin.la
muffin-enum-types.h \
$(libmuffininclude_base_headers) \
$(filter %.c,$(libmuffin_la_SOURCES))
@META_GIR@_SCANNERFLAGS = --warn-all --warn-error
@META_GIR@_SCANNERFLAGS = $(WARN_SCANNERFLAGS) --warn-all --warn-error

endif

@@ -245,8 +248,8 @@ testasyncgetprop_SOURCES = core/testasyncgetprop.c core/async-getprop.c

# NO-OP: work around the fact that source code tested by the programs are
# compiled for library
testasyncgetprop_CFLAGS = $(AM_CFLAGS)
testboxes_CFLAGS = $(AM_CFLAGS)
testasyncgetprop_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS)
testboxes_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS)

noinst_PROGRAMS=testboxes testgradient testasyncgetprop



+ 19
- 3
src/compositor/cogl-utils.c View File

@@ -25,6 +25,8 @@
#include <config.h>
#endif
#include "cogl-utils.h"
#include <meta/errors.h>

#include <gdk/gdk.h>

/**
@@ -174,6 +176,8 @@ meta_cogl_texture_new_from_data_wrapper (int width,

if (hardware_supports_npot_sizes ())
{
CoglError *error = NULL;

texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (cogl_context, width, height,
format,
#if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0)
@@ -181,7 +185,12 @@ meta_cogl_texture_new_from_data_wrapper (int width,
#endif
rowstride,
data,
NULL));
&error));
if (error)
{
meta_verbose ("cogl_texture_2d_new_from_data failed: %s\n", error->message);
cogl_error_free (error);
}
}
else
{
@@ -211,6 +220,7 @@ meta_cogl_texture_new_from_file_wrapper (const char *filename,
CoglPixelFormat internal_format)
{
CoglTexture *texture = NULL;
CoglError *error = NULL;

if (hardware_supports_npot_sizes ())
{
@@ -219,14 +229,20 @@ meta_cogl_texture_new_from_file_wrapper (const char *filename,
#if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0)
COGL_PIXEL_FORMAT_ANY,
#endif
NULL));
&error));
}
else
{
texture = cogl_texture_new_from_file (filename,
flags,
internal_format,
NULL);
&error);
}

if (error)
{
meta_verbose ("cogl_texture_(2d)_new_from_file failed: %s\n", error->message);
cogl_error_free (error);
}

return texture;


+ 34
- 38
src/compositor/compositor.c View File

@@ -658,21 +658,16 @@ meta_compositor_manage_screen (MetaCompositor *compositor,

info->window_group = meta_window_group_new (screen);
info->background_actor = meta_background_actor_new_for_screen (screen);
info->bottom_window_group = clutter_group_new();
info->overlay_group = clutter_group_new ();
info->bottom_window_group = clutter_actor_new();
info->overlay_group = clutter_actor_new ();
info->top_window_group = meta_window_group_new (screen);
info->hidden_group = clutter_group_new ();
info->hidden_group = clutter_actor_new ();

clutter_container_add (CLUTTER_CONTAINER (info->window_group),
info->background_actor,
NULL);

clutter_container_add (CLUTTER_CONTAINER (info->stage),
info->window_group,
info->top_window_group,
info->overlay_group,
info->hidden_group,
NULL);
clutter_actor_add_child (info->window_group, info->background_actor);
clutter_actor_add_child (info->stage, info->window_group);
clutter_actor_add_child (info->stage, info->top_window_group);
clutter_actor_add_child (info->stage, info->overlay_group);
clutter_actor_add_child (info->stage, info->hidden_group);

clutter_actor_hide (info->hidden_group);

@@ -1082,7 +1077,7 @@ sync_actor_stacking (MetaCompScreen *info)
* little effort to make sure we actually need to restack before
* we go ahead and do it */

children = clutter_container_get_children (CLUTTER_CONTAINER (info->window_group));
children = clutter_actor_get_children (info->window_group);
reordered = FALSE;

old = children;
@@ -1130,12 +1125,14 @@ sync_actor_stacking (MetaCompScreen *info)

for (tmp = g_list_last (info->windows); tmp != NULL; tmp = tmp->prev)
{
MetaWindowActor *window_actor = tmp->data;
ClutterActor *actor = tmp->data;

clutter_actor_lower_bottom (CLUTTER_ACTOR (window_actor));
if (clutter_actor_get_parent (actor) == info->window_group)
clutter_actor_set_child_below_sibling (info->window_group, actor, NULL);
}

clutter_actor_lower_bottom (info->background_actor);
if (clutter_actor_get_parent (info->background_actor) == info->window_group)
clutter_actor_set_child_below_sibling (info->window_group, info->background_actor, NULL);
}

void
@@ -1535,45 +1532,44 @@ meta_enable_unredirect_for_screen (MetaScreen *screen)
#define FLASH_TIME_MS 50

static void
flash_out_completed (ClutterAnimation *animation,
ClutterActor *flash)
flash_out_completed (ClutterTimeline *timeline,
gpointer user_data)
{
ClutterActor *flash = CLUTTER_ACTOR (user_data);
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 };
ClutterTransition *transition;
gfloat width, height;

stage = meta_get_stage_for_screen (screen);
clutter_actor_get_size (stage, &width, &height);

flash = clutter_rectangle_new_with_color (&black);
flash = clutter_actor_new ();
clutter_actor_set_background_color (flash, CLUTTER_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_add_child (stage, flash);

clutter_actor_save_easing_state (flash);
clutter_actor_set_easing_mode (flash, CLUTTER_EASE_IN_QUAD);
clutter_actor_set_easing_duration (flash, FLASH_TIME_MS);
clutter_actor_set_opacity (flash, 192);

transition = clutter_actor_get_transition (flash, "opacity");
clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), 2);

g_signal_connect (transition, "finished",
G_CALLBACK (flash_out_completed), flash);

clutter_actor_animate (flash, CLUTTER_EASE_OUT_QUAD,
FLASH_TIME_MS,
"opacity", 192,
"signal-after::completed", flash_in_completed, flash,
NULL);
clutter_actor_restore_easing_state (flash);
}

void


+ 2
- 0
src/compositor/meta-background-actor-private.h View File

@@ -5,6 +5,7 @@

#include <meta/screen.h>
#include <meta/meta-background-actor.h>
#include "meta-background.h"

void meta_background_actor_set_visible_region (MetaBackgroundActor *self,
cairo_region_t *visible_region);
@@ -12,4 +13,5 @@ void meta_background_actor_set_visible_region (MetaBackgroundActor *self,
void meta_background_actor_update (MetaScreen *screen);
void meta_background_actor_screen_size_changed (MetaScreen *screen);


#endif /* META_BACKGROUND_ACTOR_PRIVATE_H */

+ 86
- 106
src/compositor/meta-background-actor.c View File

@@ -42,6 +42,8 @@
#include <meta/errors.h>
#include "meta-background-actor-private.h"

#define FADE_DURATION 1500

/* We allow creating multiple MetaBackgroundActors for the same MetaScreen to
* allow different rendering options to be set for different copies.
* But we want to share the same underlying CoglTexture for efficiency and
@@ -67,9 +69,11 @@ struct _MetaScreenBackground
struct _MetaBackgroundActorPrivate
{
MetaScreenBackground *background;
CoglHandle material;
ClutterActor *top_actor;
ClutterActor *bottom_actor;
cairo_region_t *visible_region;
float dim_factor;
gboolean transition_running;
};

enum
@@ -144,7 +148,8 @@ update_wrap_mode_of_actor (MetaBackgroundActor *self)
{
MetaBackgroundActorPrivate *priv = self->priv;

cogl_material_set_layer_wrap_mode (priv->material, 0, priv->background->wrap_mode);
meta_background_set_layer_wrap_mode (META_BACKGROUND (priv->top_actor), priv->background->wrap_mode);
meta_background_set_layer_wrap_mode (META_BACKGROUND (priv->bottom_actor), priv->background->wrap_mode);
}

static void
@@ -168,18 +173,62 @@ update_wrap_mode (MetaScreenBackground *background)
update_wrap_mode_of_actor (l->data);
}

static void
cancel_transitions (MetaBackgroundActor *self)
{
MetaBackgroundActorPrivate *priv = self->priv;

clutter_actor_remove_all_transitions (priv->top_actor);
clutter_actor_set_opacity (priv->top_actor, 255);
meta_background_set_layer (META_BACKGROUND (priv->bottom_actor), priv->background->texture);
priv->transition_running = FALSE;
}

static void
on_trasition_complete (ClutterActor *actor,
gpointer user_data)
{
MetaBackgroundActor *self = (MetaBackgroundActor *)user_data;
MetaBackgroundActorPrivate *priv = self->priv;

meta_background_set_layer (META_BACKGROUND (priv->bottom_actor), priv->background->texture);
priv->transition_running = FALSE;
}

static void
set_texture_on_actors (MetaBackgroundActor *self)
{
MetaBackgroundActorPrivate *priv = self->priv;

meta_background_set_layer (META_BACKGROUND (priv->bottom_actor), priv->background->texture);
meta_background_set_layer (META_BACKGROUND (priv->top_actor), priv->background->texture);

clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}

static void
set_texture_on_actor (MetaBackgroundActor *self)
{
MetaBackgroundActorPrivate *priv = self->priv;
MetaDisplay *display = meta_screen_get_display (priv->background->screen);

/* This may trigger destruction of an old texture pixmap, which, if
* the underlying X pixmap is already gone has the tendency to trigger
* X errors inside DRI. For safety, trap errors */
meta_error_trap_push (display);
cogl_material_set_layer (priv->material, 0, priv->background->texture);
meta_error_trap_pop (display);
if (priv->transition_running)
cancel_transitions (self);

clutter_actor_set_opacity (CLUTTER_ACTOR (priv->top_actor), 0);
meta_background_set_layer (META_BACKGROUND (priv->top_actor), priv->background->texture);

priv->transition_running = TRUE;

clutter_actor_save_easing_state (priv->top_actor);
clutter_actor_set_easing_duration (priv->top_actor, FADE_DURATION);
clutter_actor_set_opacity (priv->top_actor, 255);
clutter_actor_restore_easing_state (priv->top_actor);

g_signal_connect (priv->top_actor,
"transitions-completed",
G_CALLBACK (on_trasition_complete),
self);

clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}
@@ -228,7 +277,7 @@ set_texture_to_stage_color (MetaScreenBackground *background)
ClutterColor color;
CoglHandle texture;

clutter_stage_get_color (CLUTTER_STAGE (stage), &color);
clutter_actor_get_background_color (stage, &color);

/* Slicing will prevent COGL from using hardware texturing for
* the tiled 1x1 pixmap, and will cause it to draw the window
@@ -254,12 +303,6 @@ meta_background_actor_dispose (GObject *object)
priv->background = NULL;
}

if (priv->material != COGL_INVALID_HANDLE)
{
cogl_handle_unref (priv->material);
priv->material = COGL_INVALID_HANDLE;
}

G_OBJECT_CLASS (meta_background_actor_parent_class)->dispose (object);
}

@@ -300,55 +343,6 @@ meta_background_actor_get_preferred_height (ClutterActor *actor,
*natural_height_p = height;
}

static void
meta_background_actor_paint (ClutterActor *actor)
{
MetaBackgroundActor *self = META_BACKGROUND_ACTOR (actor);
MetaBackgroundActorPrivate *priv = self->priv;
guint8 opacity = clutter_actor_get_paint_opacity (actor);
guint8 color_component;
int width, height;

meta_screen_get_size (priv->background->screen, &width, &height);

color_component = (int)(0.5 + opacity * priv->dim_factor);

cogl_material_set_color4ub (priv->material,
color_component,
color_component,
color_component,
opacity);

cogl_set_source (priv->material);

if (priv->visible_region)
{
int n_rectangles = cairo_region_num_rectangles (priv->visible_region);
int i;

for (i = 0; i < n_rectangles; i++)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (priv->visible_region, i, &rect);

cogl_rectangle_with_texture_coords (rect.x, rect.y,
rect.x + rect.width, rect.y + rect.height,
rect.x / priv->background->texture_width,
rect.y / priv->background->texture_height,
(rect.x + rect.width) / priv->background->texture_width,
(rect.y + rect.height) / priv->background->texture_height);
}
}
else
{
cogl_rectangle_with_texture_coords (0.0f, 0.0f,
width, height,
0.0f, 0.0f,
width / priv->background->texture_width,
height / priv->background->texture_height);
}
}

static gboolean
meta_background_actor_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
@@ -382,10 +376,10 @@ meta_background_actor_set_dim_factor (MetaBackgroundActor *self,
}

static void
meta_background_actor_get_property(GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
meta_background_actor_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaBackgroundActor *self = META_BACKGROUND_ACTOR (object);
MetaBackgroundActorPrivate *priv = self->priv;
@@ -402,10 +396,10 @@ meta_background_actor_get_property(GObject *object,
}

static void
meta_background_actor_set_property(GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
meta_background_actor_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaBackgroundActor *self = META_BACKGROUND_ACTOR (object);

@@ -435,7 +429,6 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)

actor_class->get_preferred_width = meta_background_actor_get_preferred_width;
actor_class->get_preferred_height = meta_background_actor_get_preferred_height;
actor_class->paint = meta_background_actor_paint;
actor_class->get_paint_volume = meta_background_actor_get_paint_volume;

/**
@@ -463,10 +456,11 @@ meta_background_actor_init (MetaBackgroundActor *self)
META_TYPE_BACKGROUND_ACTOR,
MetaBackgroundActorPrivate);
priv->dim_factor = 1.0;
priv->transition_running = FALSE;
}

/**
* meta_background_actor_new:
* meta_background_actor_new_for_screen:
* @screen: the #MetaScreen
*
* Creates a new actor to draw the background for the given screen.
@@ -487,9 +481,12 @@ meta_background_actor_new_for_screen (MetaScreen *screen)
priv->background = meta_screen_background_get (screen);
priv->background->actors = g_slist_prepend (priv->background->actors, self);

priv->material = meta_create_texture_material (NULL);
priv->bottom_actor = meta_background_new (screen);
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->bottom_actor);
priv->top_actor = meta_background_new (screen);
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->top_actor);

set_texture_on_actor (self);
set_texture_on_actors (self);
update_wrap_mode_of_actor (self);

return CLUTTER_ACTOR (self);
@@ -531,17 +528,17 @@ meta_background_actor_update (MetaScreen *screen)
False,
AnyPropertyType,
&type, &format, &nitems, &bytes_after, &data) &&
type != None)
{
/* Got a property. */
if (type == XA_PIXMAP && format == 32 && nitems == 1)
{
/* Was what we expected. */
root_pixmap_id = *(Pixmap *)data;
}
XFree(data);
}
type != None)
{
/* Got a property. */
if (type == XA_PIXMAP && format == 32 && nitems == 1)
{
/* Was what we expected. */
root_pixmap_id = *(Pixmap *)data;
}
XFree(data);
}

if (root_pixmap_id != None)
{
@@ -592,24 +589,7 @@ meta_background_actor_set_visible_region (MetaBackgroundActor *self,

priv = self->priv;

if (priv->visible_region)
{
cairo_region_destroy (priv->visible_region);
priv->visible_region = NULL;
}

if (visible_region)
{
cairo_rectangle_int_t screen_rect = { 0 };
meta_screen_get_size (priv->background->screen, &screen_rect.width, &screen_rect.height);

/* Doing the intersection here is probably unnecessary - MetaWindowGroup
* should never compute a visible area that's larger than the root screen!
* but it's not that expensive and adds some extra robustness.
*/
priv->visible_region = cairo_region_create_rectangle (&screen_rect);
cairo_region_intersect (priv->visible_region, visible_region);
}
meta_background_set_visible_region (META_BACKGROUND (priv->top_actor), visible_region);
}

/**


+ 245
- 0
src/compositor/meta-background.c View File

@@ -0,0 +1,245 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* meta-background.c: Actor used to create a background fade effect
*
* Copyright 2016 Linux Mint
*
* 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., 51 Franklin Street - Suite 500, Boston, MA
* 02110-1335, USA.
*
* Portions adapted from gnome-shell/src/shell-global.c
* and meta-window-actor.c
*/

#include "config.h"

#include <clutter/clutter.h>
#include "cogl-utils.h"
#include <meta/errors.h>
#include "meta-background-actor-private.h"

struct _MetaBackgroundPrivate
{
MetaScreen *screen;
CoglHandle material;

float texture_width;
float texture_height;

cairo_region_t *visible_region;
};

G_DEFINE_TYPE (MetaBackground, meta_background, CLUTTER_TYPE_ACTOR);

static void
meta_background_dispose (GObject *object)
{
MetaBackground *self = META_BACKGROUND (object);
MetaBackgroundPrivate *priv = self->priv;

meta_background_set_visible_region (self, NULL);

if (priv->material != COGL_INVALID_HANDLE)
{
cogl_handle_unref (priv->material);
priv->material = COGL_INVALID_HANDLE;
}

G_OBJECT_CLASS (meta_background_parent_class)->dispose (object);
}

static void
meta_background_get_preferred_width (ClutterActor *actor,
gfloat for_height,
gfloat *min_width_p,
gfloat *natural_width_p)
{
MetaBackground *self = META_BACKGROUND (actor);
MetaBackgroundPrivate *priv = self->priv;
int width, height;

meta_screen_get_size (priv->screen, &width, &height);

if (min_width_p)
*min_width_p = width;
if (natural_width_p)
*natural_width_p = width;
}

static void
meta_background_get_preferred_height (ClutterActor *actor,
gfloat for_width,
gfloat *min_height_p,
gfloat *natural_height_p)

{
MetaBackground *self = META_BACKGROUND (actor);
MetaBackgroundPrivate *priv = self->priv;
int width, height;

meta_screen_get_size (priv->screen, &width, &height);

if (min_height_p)
*min_height_p = height;
if (natural_height_p)
*natural_height_p = height;
}

static void
meta_background_paint (ClutterActor *actor)
{
MetaBackground *self = META_BACKGROUND (actor);
MetaBackgroundPrivate *priv = self->priv;
guint8 opacity = clutter_actor_get_paint_opacity (actor);
guint8 color_component;
int width, height;

meta_screen_get_size (priv->screen, &width, &height);

color_component = (int)(0.5 + opacity);

cogl_material_set_color4ub (priv->material,
color_component,
color_component,
color_component,
opacity);

cogl_set_source (priv->material);

if (priv->visible_region)
{
int n_rectangles = cairo_region_num_rectangles (priv->visible_region);
int i;

for (i = 0; i < n_rectangles; i++)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (priv->visible_region, i, &rect);

cogl_rectangle_with_texture_coords (rect.x, rect.y,
rect.x + rect.width, rect.y + rect.height,
rect.x / priv->texture_width,
rect.y / priv->texture_height,
(rect.x + rect.width) / priv->texture_width,
(rect.y + rect.height) / priv->texture_height);
}
}
else
{
cogl_rectangle_with_texture_coords (0.0f, 0.0f,
width, height,
0.0f, 0.0f,
width / priv->texture_width,
height / priv->texture_height);
}
}

static void
meta_background_class_init (MetaBackgroundClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);

g_type_class_add_private (klass, sizeof (MetaBackgroundPrivate));

object_class->dispose = meta_background_dispose;

actor_class->get_preferred_width = meta_background_get_preferred_width;
actor_class->get_preferred_height = meta_background_get_preferred_height;
actor_class->paint = meta_background_paint;
}

static void
meta_background_init (MetaBackground *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
META_TYPE_BACKGROUND,
MetaBackgroundPrivate);
}

ClutterActor *
meta_background_new (MetaScreen *screen)
{
MetaBackground *self;
MetaBackgroundPrivate *priv;

self = g_object_new (META_TYPE_BACKGROUND,
NULL);
priv = self->priv;

priv->screen = screen;
priv->material = meta_create_texture_material (NULL);

return CLUTTER_ACTOR (self);
}

void
meta_background_set_layer (MetaBackground *self,
CoglHandle texture)
{
MetaBackgroundPrivate *priv = self->priv;
MetaDisplay *display = meta_screen_get_display (priv->screen);

/* This may trigger destruction of an old texture pixmap, which, if
* the underlying X pixmap is already gone has the tendency to trigger
* X errors inside DRI. For safety, trap errors */
meta_error_trap_push (display);
cogl_material_set_layer (priv->material, 0, texture);
meta_error_trap_pop (display);

priv->texture_width = cogl_texture_get_width (texture);
priv->texture_height = cogl_texture_get_height (texture);

clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}

void
meta_background_set_layer_wrap_mode (MetaBackground *self,
CoglMaterialWrapMode wrap_mode)
{
MetaBackgroundPrivate *priv = self->priv;

cogl_material_set_layer_wrap_mode (priv->material, 0, wrap_mode);
}

void
meta_background_set_visible_region (MetaBackground *self,
cairo_region_t *visible_region)
{
MetaBackgroundPrivate *priv;

g_return_if_fail (META_IS_BACKGROUND (self));

priv = self->priv;

if (priv->visible_region)
{
cairo_region_destroy (priv->visible_region);
priv->visible_region = NULL;
}

if (visible_region)
{
cairo_rectangle_int_t screen_rect = { 0 };
meta_screen_get_size (priv->screen, &screen_rect.width, &screen_rect.height);

/* Doing the intersection here is probably unnecessary - MetaWindowGroup
* should never compute a visible area that's larger than the root screen!
* but it's not that expensive and adds some extra robustness.
*/
priv->visible_region = cairo_region_create_rectangle (&screen_rect);
cairo_region_intersect (priv->visible_region, visible_region);
}
}

+ 44
- 0
src/compositor/meta-background.h View File

@@ -0,0 +1,44 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */

#ifndef META_BACKGROUND_H
#define META_BACKGROUND_H

#include <clutter/clutter.h>

#include <meta/screen.h>

#define META_TYPE_BACKGROUND (meta_background_get_type ())
#define META_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_BACKGROUND, MetaBackground))
#define META_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_BACKGROUND, MetaBackgroundClass))
#define META_IS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_BACKGROUND))
#define META_IS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_BACKGROUND))
#define META_BACKGROUND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_BACKGROUND, MetaBackgroundClass))

typedef struct _MetaBackground MetaBackground;
typedef struct _MetaBackgroundClass MetaBackgroundClass;
typedef struct _MetaBackgroundPrivate MetaBackgroundPrivate;

struct _MetaBackgroundClass
{
ClutterActorClass parent_class;
};

struct _MetaBackground
{
ClutterActor parent;

MetaBackgroundPrivate *priv;
};

GType meta_background_get_type (void);

ClutterActor * meta_background_new (MetaScreen *screen);

void meta_background_set_layer (MetaBackground *self,
CoglHandle texture);
void meta_background_set_layer_wrap_mode (MetaBackground *self,
CoglMaterialWrapMode wrap_mode);
void meta_background_set_visible_region (MetaBackground *self,
cairo_region_t *visible_region);

#endif /* META_BACKGROUND_H */

+ 27
- 14
src/compositor/meta-window-actor.c View File

@@ -181,7 +181,7 @@ static void meta_window_actor_handle_updates (MetaWindowActor *self);

static void check_needs_reshape (MetaWindowActor *self);

G_DEFINE_TYPE (MetaWindowActor, meta_window_actor, CLUTTER_TYPE_GROUP);
G_DEFINE_TYPE (MetaWindowActor, meta_window_actor, CLUTTER_TYPE_ACTOR);

static void
frame_data_free (FrameData *frame)
@@ -405,7 +405,7 @@ meta_window_actor_constructed (GObject *object)
{
priv->actor = meta_shaped_texture_new ();

clutter_container_add_actor (CLUTTER_CONTAINER (self), priv->actor);
clutter_actor_add_child (CLUTTER_ACTOR (self), priv->actor);

/*
* Since we are holding a pointer to this actor independently of the
@@ -429,7 +429,7 @@ meta_window_actor_constructed (GObject *object)
* This is the case where existing window is gaining/loosing frame.
* Just ensure the actor is top most (i.e., above shadow).
*/
clutter_actor_raise_top (priv->actor);
clutter_actor_set_child_above_sibling (CLUTTER_ACTOR (self), priv->actor, NULL);
}

meta_window_actor_update_opacity (self);
@@ -887,7 +887,7 @@ meta_window_actor_get_texture (MetaWindowActor *self)
gboolean
meta_window_actor_is_destroyed (MetaWindowActor *self)
{
return self->priv->disposed;
return self->priv->disposed || self->priv->needs_destroy;
}

gboolean
@@ -1006,7 +1006,12 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
gboolean no_delay_frame)
{
MetaWindowActorPrivate *priv = self->priv;
FrameData *frame = g_slice_new0 (FrameData);
FrameData *frame;

if (meta_window_actor_is_destroyed (self))
return;

frame = g_slice_new0 (FrameData);

priv->needs_frame_drawn = TRUE;

@@ -1279,6 +1284,9 @@ meta_window_actor_should_unredirect (MetaWindowActor *self)
MetaWindow *metaWindow = meta_window_actor_get_meta_window (self);
MetaWindowActorPrivate *priv = self->priv;

if (meta_window_actor_is_destroyed (self))
return FALSE;

if (meta_window_requested_dont_bypass_compositor (metaWindow))
return FALSE;

@@ -1294,16 +1302,13 @@ meta_window_actor_should_unredirect (MetaWindowActor *self)
if (!meta_window_is_monitor_sized (metaWindow))
return FALSE;

if (!meta_prefs_get_unredirect_fullscreen_windows())
return FALSE;

if (meta_window_requested_bypass_compositor (metaWindow))
return TRUE;

if (meta_window_is_override_redirect (metaWindow))
return TRUE;

if (priv->does_full_damage)
if (priv->does_full_damage && meta_prefs_get_unredirect_fullscreen_windows ())
return TRUE;

return FALSE;
@@ -1449,7 +1454,7 @@ meta_window_actor_show (MetaWindowActor *self,
event == 0 ||
!start_simple_effect (self, event))
{
clutter_actor_show_all (CLUTTER_ACTOR (self));
clutter_actor_show (CLUTTER_ACTOR (self));
priv->redecorating = FALSE;
}
}
@@ -1638,8 +1643,7 @@ meta_window_actor_new (MetaWindow *window)
else
window_group = info->window_group;

clutter_container_add_actor (CLUTTER_CONTAINER (window_group),
CLUTTER_ACTOR (self));
clutter_actor_add_child (window_group, CLUTTER_ACTOR (self));
clutter_actor_hide (CLUTTER_ACTOR (self));

@@ -2014,8 +2018,8 @@ meta_window_actor_process_damage (MetaWindowActor *self,
MetaRectangle window_rect;
meta_window_get_outer_rect (priv->window, &window_rect);

if (window_rect.x == event->area.x &&
window_rect.y == event->area.y &&
if (event->area.x == 0 &&
event->area.y == 0 &&
window_rect.width == event->area.width &&
window_rect.height == event->area.height)
priv->full_damage_frames_count++;
@@ -2337,6 +2341,9 @@ meta_window_actor_pre_paint (MetaWindowActor *self)
MetaWindowActorPrivate *priv = self->priv;
GList *l;

if (meta_window_actor_is_destroyed (self))
return;

meta_window_actor_handle_updates (self);

for (l = priv->frames; l != NULL; l = l->next)
@@ -2358,6 +2365,9 @@ meta_window_actor_post_paint (MetaWindowActor *self)

priv->repaint_scheduled = FALSE;

if (meta_window_actor_is_destroyed (self))
return;

if (priv->needs_frame_drawn)
{
MetaScreen *screen = priv->screen;
@@ -2446,6 +2456,9 @@ meta_window_actor_frame_complete (MetaWindowActor *self,
MetaWindowActorPrivate *priv = self->priv;
GList *l;

if (meta_window_actor_is_destroyed (self))
return;

for (l = priv->frames; l;)
{
GList *l_next = l->next;


+ 4
- 4
src/compositor/meta-window-group.c View File

@@ -14,17 +14,17 @@

struct _MetaWindowGroupClass
{
ClutterGroupClass parent_class;
ClutterActorClass parent_class;
};

struct _MetaWindowGroup
{
ClutterGroup parent;
ClutterActor parent;

MetaScreen *screen;
};

G_DEFINE_TYPE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_GROUP);
G_DEFINE_TYPE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_ACTOR);

/* We want to find out if the window is "close enough" to
* 1:1 transform. We do that by converting the transformed coordinates
@@ -116,7 +116,7 @@ meta_window_group_paint (ClutterActor *actor)
* and subtract the opaque area of each window out of the visible
* region that we pass to the windows below.
*/
children = clutter_container_get_children (CLUTTER_CONTAINER (actor));
children = clutter_actor_get_children (actor);
children = g_list_reverse (children);

/* Get the clipped redraw bounds from Clutter so that we can avoid


+ 3
- 3
src/compositor/plugins/Makefile.am View File

@@ -1,11 +1,11 @@

pkglibdir=@MUFFIN_PLUGIN_DIR@

AM_CPPFLAGS=@MUFFIN_CFLAGS@ -I $(top_srcdir)/src -DMUFFIN_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUFFIN_PKGDATADIR=\"$(pkgdatadir)\" -DMUFFIN_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"muffin\" -DSN_API_NOT_YET_FROZEN=1 -DMUFFIN_MAJOR_VERSION=$(MUFFIN_MAJOR_VERSION) -DMUFFIN_MINOR_VERSION=$(MUFFIN_MINOR_VERSION) -DMUFFIN_MICRO_VERSION=$(MUFFIN_MICRO_VERSION) -DMUFFIN_PLUGIN_API_VERSION=$(MUFFIN_PLUGIN_API_VERSION) -DMUFFIN_PLUGIN_DIR=\"@MUFFIN_PLUGIN_DIR@\"
AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_CFLAGS@ -I $(top_srcdir)/src -DMUFFIN_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUFFIN_PKGDATADIR=\"$(pkgdatadir)\" -DMUFFIN_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"muffin\" -DSN_API_NOT_YET_FROZEN=1 -DMUFFIN_MAJOR_VERSION=$(MUFFIN_MAJOR_VERSION) -DMUFFIN_MINOR_VERSION=$(MUFFIN_MINOR_VERSION) -DMUFFIN_MICRO_VERSION=$(MUFFIN_MICRO_VERSION) -DMUFFIN_PLUGIN_API_VERSION=$(MUFFIN_PLUGIN_API_VERSION) -DMUFFIN_PLUGIN_DIR=\"@MUFFIN_PLUGIN_DIR@\"

default_la_CFLAGS = -fPIC
default_la_CFLAGS = $(WARN_CFLAGS) -fPIC
default_la_SOURCES = default.c
default_la_LDFLAGS = -module -avoid-version -no-undefined
default_la_LDFLAGS = $(WARN_LDFLAGS) -module -avoid-version -no-undefined
default_la_LIBADD = @CLUTTER_LIBS@

pkglib_LTLIBRARIES = default.la


+ 2
- 2
src/core/constraints.c View File

@@ -875,7 +875,6 @@ constrain_maximization (MetaWindow *window,
g_slist_free (snapped_windows_as_struts);
} else {
target_size = info->current;
meta_window_extend_by_frame (window, &target_size, info->borders);
meta_rectangle_expand_to_avoiding_struts (&target_size,
&info->entire_monitor,
direction,
@@ -883,7 +882,8 @@ constrain_maximization (MetaWindow *window,
}
}
/* Now make target_size = maximized size of client window */
meta_window_unextend_by_frame (window, &target_size, info->borders);
if (!meta_window_is_client_decorated(window))
meta_window_unextend_by_frame (window, &target_size, info->borders);

/* Check min size constraints; max size constraints are ignored for maximized
* windows, as per bug 327543.


+ 0
- 2
src/core/muffin.c View File

@@ -71,8 +71,6 @@ main (int argc, char **argv)

g_setenv ("CLUTTER_BACKEND", "x11", TRUE);

g_type_init ();

ctx = meta_get_option_context ();
g_option_context_add_main_entries (ctx, muffin_options, GETTEXT_PACKAGE);
if (!g_option_context_parse (ctx, &argc, &argv, &error))


+ 10
- 0
src/core/screen.c View File

@@ -113,6 +113,7 @@ enum
WINDOW_REMOVED,
WINDOW_MONITOR_CHANGED,
WINDOW_WORKSPACE_CHANGED,
WINDOW_SKIP_TASKBAR_CHANGED,
IN_FULLSCREEN_CHANGED,

LAST_SIGNAL
@@ -342,6 +343,15 @@ meta_screen_class_init (MetaScreenClass *klass)
META_TYPE_WINDOW,
META_TYPE_WORKSPACE);

screen_signals[WINDOW_SKIP_TASKBAR_CHANGED] =
g_signal_new ("window-skip-taskbar-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1,
META_TYPE_WINDOW);

screen_signals[IN_FULLSCREEN_CHANGED] =
g_signal_new ("in-fullscreen-changed",
G_TYPE_FROM_CLASS (object_class),


+ 7
- 2
src/core/window-private.h View File

@@ -95,6 +95,12 @@ enum {
#define HUD_WIDTH 24
#define CSD_TITLEBAR_HEIGHT 48

typedef enum {
_NET_WM_BYPASS_COMPOSITOR_HINT_AUTO = 0,
_NET_WM_BYPASS_COMPOSITOR_HINT_ON = 1,
_NET_WM_BYPASS_COMPOSITOR_HINT_OFF = 2,
} MetaBypassCompositorHintValue;

struct _MetaWindow
{
GObject parent_instance;
@@ -480,8 +486,7 @@ struct _MetaWindow
MetaWindow *tile_match;

/* Bypass compositor hints */
guint bypass_compositor : 1;
guint dont_bypass_compositor : 1;
guint bypass_compositor;
};

struct _MetaWindowClass


+ 10
- 37
src/core/window-props.c View File

@@ -1685,51 +1685,25 @@ reload_bypass_compositor (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
gboolean requested_value = FALSE;
gboolean current_value = window->bypass_compositor;
int requested_value = 0;
int current_value = window->bypass_compositor;

if (value->type != META_PROP_VALUE_INVALID)
{
requested_value = ((int) value->v.cardinal == 1);
meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
requested_value = (int) value->v.cardinal;
}

if (requested_value == current_value)
return;

if (requested_value && window->dont_bypass_compositor)
{
meta_verbose ("Setting bypass and dont compositor for same window (%s) makes no sense, ignoring.\n", window->desc);
return;
}

window->bypass_compositor = requested_value;
}

static void
reload_dont_bypass_compositor (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
gboolean requested_value = FALSE;
gboolean current_value = window->dont_bypass_compositor;

if (value->type != META_PROP_VALUE_INVALID)
{
requested_value = ((int) value->v.cardinal == 1);
meta_verbose ("Request to don't bypass compositor for window %s.\n", window->desc);
}

if (requested_value == current_value)
if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_ON)
meta_verbose ("Request to bypass compositor for window %s.\n", window->desc);
else if (requested_value == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF)
meta_verbose ("Request to don't bypass compositor for window %s.\n", window->desc);
else if (requested_value != _NET_WM_BYPASS_COMPOSITOR_HINT_AUTO)
return;

if (requested_value && window->bypass_compositor)
{
meta_verbose ("Setting bypass and dont compositor for same window (%s) makes no sense, ignoring.\n", window->desc);
return;
}

window->dont_bypass_compositor = requested_value;
window->bypass_compositor = requested_value;
}

#define RELOAD_STRING(var_name, propname) \
@@ -1828,8 +1802,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_INVALID, reload_net_wm_window_type, FALSE, TRUE },
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, FALSE, FALSE },
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, FALSE, FALSE },
{ display->atom__NET_WM_DONT_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_dont_bypass_compositor, FALSE, FALSE },
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, TRUE, TRUE },
{ 0 },
};



+ 7
- 2
src/core/window.c View File

@@ -3688,7 +3688,7 @@ meta_window_is_on_primary_monitor (MetaWindow *window)
gboolean
meta_window_requested_bypass_compositor (MetaWindow *window)
{
return window->bypass_compositor;
return window->bypass_compositor == _NET_WM_BYPASS_COMPOSITOR_HINT_ON;
}

/**
@@ -3699,7 +3699,7 @@ meta_window_requested_bypass_compositor (MetaWindow *window)
gboolean
meta_window_requested_dont_bypass_compositor (MetaWindow *window)
{
return window->dont_bypass_compositor;
return window->bypass_compositor == _NET_WM_BYPASS_COMPOSITOR_HINT_OFF;
}

static void
@@ -8360,6 +8360,7 @@ recalc_window_features (MetaWindow *window)
gboolean old_has_resize_func;
gboolean old_has_shade_func;
gboolean old_always_sticky;
gboolean old_skip_taskbar;

old_has_close_func = window->has_close_func;
old_has_minimize_func = window->has_minimize_func;
@@ -8367,6 +8368,7 @@ recalc_window_features (MetaWindow *window)
old_has_resize_func = window->has_resize_func;
old_has_shade_func = window->has_shade_func;
old_always_sticky = window->always_sticky;
old_skip_taskbar = window->skip_taskbar;

/* Use MWM hints initially */
window->decorated = window->mwm_decorated;
@@ -8577,6 +8579,9 @@ recalc_window_features (MetaWindow *window)
if (window->has_resize_func != old_has_resize_func)
g_object_notify (G_OBJECT (window), "resizeable");

if (old_skip_taskbar != window->skip_taskbar)
g_signal_emit_by_name (window->screen, "window-skip-taskbar-changed", window);

/* FIXME perhaps should ensure if we don't have a shade func,
* we aren't shaded, etc.
*/


+ 0
- 1
src/meta/atomnames.h View File

@@ -175,7 +175,6 @@ item(_NET_WM_STATE_STICKY)
item(_NET_WM_FULLSCREEN_MONITORS)
item(_NET_WM_STATE_FOCUSED)
item(_NET_WM_BYPASS_COMPOSITOR)
item(_NET_WM_DONT_BYPASS_COMPOSITOR)
item(_NET_WM_FRAME_DRAWN)
item(_NET_WM_FRAME_TIMINGS)



+ 2
- 2
src/meta/meta-window-actor.h View File

@@ -46,12 +46,12 @@ typedef struct _MetaWindowActorPrivate MetaWindowActorPrivate;

struct _MetaWindowActorClass
{
ClutterGroupClass parent_class;
ClutterActorClass parent_class;
};

struct _MetaWindowActor
{
ClutterGroup parent;
ClutterActor parent;

MetaWindowActorPrivate *priv;
};


+ 1
- 1
src/tools/Makefile.am View File

@@ -3,7 +3,7 @@
icondir=$(pkgdatadir)/icons
icon_DATA=muffin-window-demo.png

AM_CPPFLAGS=@MUFFIN_WINDOW_DEMO_CFLAGS@ @MUFFIN_MESSAGE_CFLAGS@ \
AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_WINDOW_DEMO_CFLAGS@ @MUFFIN_MESSAGE_CFLAGS@ \
-I$(top_srcdir)/src \
-DMUFFIN_ICON_DIR=\"$(pkgdatadir)/icons\" \
-DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"


+ 0
- 2
src/tools/muffin-grayscale.c View File

@@ -80,8 +80,6 @@ main (int argc, char **argv)
g_printerr ("specify a single image on the command line\n");
return 1;
}

g_type_init ();
err = NULL;
pixbuf = gdk_pixbuf_new_from_file (argv[1], &err);


+ 0
- 57
src/ui/frames.c View File

@@ -257,10 +257,6 @@ meta_frames_init (MetaFrames *frames)
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);

frames->tooltip_timeout = 0;

frames->expose_delay_count = 0;

frames->invalidate_cache_timeout_id = 0;
frames->invalidate_frames = NULL;
frames->cache = g_hash_table_new (g_direct_hash, g_direct_equal);
@@ -712,7 +708,6 @@ meta_frames_manage_window (MetaFrames *frames,
frame->layout = NULL;
frame->text_height = -1;
frame->title = NULL;
frame->expose_delayed = FALSE;
frame->shape_applied = FALSE;
frame->prelit_control = META_FRAME_CONTROL_NONE;

@@ -1962,7 +1957,6 @@ meta_frames_motion_notify_event (GtkWidget *widget,
/* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control);

/* No tooltip while in the process of clicking */
}
break;
case META_GRAB_OP_NONE:
@@ -2267,13 +2261,6 @@ meta_frames_draw (GtkWidget *widget,
if (frame == NULL)
return FALSE;

if (frames->expose_delay_count > 0)
{
/* Redraw this entire frame later */
frame->expose_delayed = TRUE;
return TRUE;
}

populate_cache (frames, frame);

region = cairo_region_create_rectangle (&clip);
@@ -2764,50 +2751,6 @@ get_control (MetaFrames *frames,
return META_FRAME_CONTROL_TITLE;
}

LOCAL_SYMBOL void
meta_frames_push_delay_exposes (MetaFrames *frames)
{
if (frames->expose_delay_count == 0)
{
/* Make sure we've repainted things */
gdk_window_process_all_updates ();
XFlush (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
}
frames->expose_delay_count += 1;
}

static void
queue_pending_exposes_func (gpointer key, gpointer value, gpointer data)
{
MetaUIFrame *frame;
MetaFrames *frames;

frames = META_FRAMES (data);
frame = value;

if (frame->expose_delayed)
{
invalidate_whole_window (frames, frame);
frame->expose_delayed = FALSE;
}
}

LOCAL_SYMBOL void
meta_frames_pop_delay_exposes (MetaFrames *frames)
{
g_return_if_fail (frames->expose_delay_count > 0);
frames->expose_delay_count -= 1;

if (frames->expose_delay_count == 0)
{
g_hash_table_foreach (frames->frames,
queue_pending_exposes_func,
frames);
}
}

static void
invalidate_whole_window (MetaFrames *frames,
MetaUIFrame *frame)


+ 0
- 7
src/ui/frames.h View File

@@ -80,7 +80,6 @@ struct _MetaUIFrame
PangoLayout *layout;
int text_height;
char *title; /* NULL once we have a layout */
guint expose_delayed : 1;
guint shape_applied : 1;
/* FIXME get rid of this, it can just be in the MetaFrames struct */
@@ -95,14 +94,11 @@ struct _MetaFrames

GHashTable *frames;

guint tooltip_timeout;
MetaUIFrame *last_motion_frame;

GtkStyleContext *normal_style;
GHashTable *style_variants;

int expose_delay_count;

int invalidate_cache_timeout_id;
GList *invalidate_frames;
GHashTable *cache;
@@ -169,7 +165,4 @@ void meta_frames_notify_menu_hide (MetaFrames *frames);

Window meta_frames_get_moving_frame (MetaFrames *frames);

void meta_frames_push_delay_exposes (MetaFrames *frames);
void meta_frames_pop_delay_exposes (MetaFrames *frames);

#endif

+ 0
- 12
src/ui/ui.c View File

@@ -594,18 +594,6 @@ meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
return retval;
}

LOCAL_SYMBOL void
meta_ui_push_delay_exposes (MetaUI *ui)
{
meta_frames_push_delay_exposes (ui->frames);
}

LOCAL_SYMBOL void
meta_ui_pop_delay_exposes (MetaUI *ui)
{
meta_frames_pop_delay_exposes (ui->frames);
}

LOCAL_SYMBOL GdkPixbuf*
meta_ui_get_default_window_icon (MetaUI *ui)
{


+ 0
- 7
src/ui/ui.h View File

@@ -143,13 +143,6 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
int width,
int height);

/* Used when we have a server grab and draw all over everything,
* then we need to handle exposes after doing that, instead of
* during it
*/
void meta_ui_push_delay_exposes (MetaUI *ui);
void meta_ui_pop_delay_exposes (MetaUI *ui);

GdkPixbuf* meta_ui_get_default_window_icon (MetaUI *ui);
GdkPixbuf* meta_ui_get_default_mini_icon (MetaUI *ui);



+ 1
- 1
src/wm-tester/Makefile.am View File

@@ -1,5 +1,5 @@

AM_CPPFLAGS=@MUFFIN_CFLAGS@
AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_CFLAGS@

wm_tester_SOURCES= \
main.c


+ 18
- 12
src/wm-tester/main.c View File

@@ -200,36 +200,42 @@ set_up_icon_windows (void)
GtkWidget *w;
GtkWidget *c;
GList *icons;
GtkIconTheme *theme;
GdkPixbuf *pix;
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
c = gtk_button_new_with_label ("Icon window");
gtk_container_add (GTK_CONTAINER (w), c);

theme = gtk_icon_theme_get_default ();

icons = NULL;

pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_LARGE_TOOLBAR,
NULL);
pix = gtk_icon_theme_load_icon (theme,
"document-save",
24,
0,
NULL);
icons = g_list_append (icons, pix);

if (i % 2)
{
pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_DIALOG,
NULL);
pix = gtk_icon_theme_load_icon (theme,
"document-save",
48,
0,
NULL);
icons = g_list_append (icons, pix);
}

if (i % 3)
{
pix = gtk_widget_render_icon (w,
GTK_STOCK_SAVE,
GTK_ICON_SIZE_MENU,
NULL);
pix = gtk_icon_theme_load_icon (theme,
"document-save",
16,
0,
NULL);
icons = g_list_append (icons, pix);
}



+ 1
- 1
src/wm-tester/test-attached.c View File

@@ -85,7 +85,7 @@ main (int argc, char **argv)
ATTACH_1,
"Attach to 2",
ATTACH_2,
GTK_STOCK_QUIT,
"Quit",
GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), DESTROY_PARENT, FALSE);


Loading…
Cancel
Save