~ubuntu-branches/ubuntu/wily/mutter/wily

« back to all changes in this revision

Viewing changes to src/compositor/compositor.c

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-04-10 22:27:59 UTC
  • mfrom: (0.7.1 upstream) (0.3.20 experimental)
  • Revision ID: james.westby@ubuntu.com-20110410222759-o6n1i5p0unsti44n
Tags: 3.0.0-0ubuntu1
* New upstream release

* Merge with debian experimental (LP: #742458), remaining changes:
  + debian/patches/03_link_gles2.patch: Link to clutter-glx-1.0
    explicitily at the end of link flags, to bring in libGLESv2 on armel.
* debian/control.in:
  + rename gir package to gir1.2-mutter-3.0
* debian/libmutter0.symbols:
  + updated
* debian/patches:
  + fix 03_link_gles2.patch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
#include <clutter/x11/clutter-x11.h>
6
6
 
7
 
#include "screen.h"
8
 
#include "errors.h"
9
 
#include "window.h"
 
7
#include <meta/screen.h>
 
8
#include <meta/errors.h>
 
9
#include <meta/window.h>
10
10
#include "compositor-private.h"
11
 
#include "compositor-mutter.h"
 
11
#include <meta/compositor-mutter.h>
12
12
#include "xprops.h"
13
 
#include "prefs.h"
14
 
#include "meta-shadow-factory.h"
 
13
#include <meta/prefs.h>
 
14
#include <meta/meta-shadow-factory.h>
15
15
#include "meta-window-actor-private.h"
16
16
#include "meta-window-group.h"
17
17
#include "meta-background-actor.h"
18
 
#include "../core/window-private.h" /* to check window->hidden */
19
 
#include "../core/display-private.h" /* for meta_display_lookup_x_window() */
 
18
#include "window-private.h" /* to check window->hidden */
 
19
#include "display-private.h" /* for meta_display_lookup_x_window() */
20
20
#include <X11/extensions/shape.h>
21
21
#include <X11/extensions/Xcomposite.h>
22
22
 
550
550
 
551
551
  info->plugin_mgr =
552
552
    meta_plugin_manager_get (screen);
553
 
 
554
 
  if (info->plugin_mgr != meta_plugin_manager_get_default ())
555
 
    {
556
 
      /* The default plugin manager has been initialized during
557
 
       * global preferences load.
558
 
       */
559
 
      if (!meta_plugin_manager_load (info->plugin_mgr))
560
 
        g_critical ("failed to load plugins");
561
 
    }
562
 
 
563
 
  if (!meta_plugin_manager_initialize (info->plugin_mgr))
564
 
    g_critical ("failed to initialize plugins");
 
553
  meta_plugin_manager_initialize (info->plugin_mgr);
565
554
 
566
555
  /*
567
556
   * Delay the creation of the overlay window as long as we can, to avoid
1198
1187
 
1199
1188
  return info->output;
1200
1189
}
 
1190
 
 
1191
#define FLASH_TIME_MS 50
 
1192
 
 
1193
static void
 
1194
flash_out_completed (ClutterAnimation *animation,
 
1195
                     ClutterActor     *flash)
 
1196
{
 
1197
  clutter_actor_destroy (flash);
 
1198
}
 
1199
 
 
1200
static void
 
1201
flash_in_completed (ClutterAnimation *animation,
 
1202
                    ClutterActor     *flash)
 
1203
{
 
1204
  clutter_actor_animate (flash, CLUTTER_EASE_IN_QUAD,
 
1205
                         FLASH_TIME_MS,
 
1206
                         "opacity", 0,
 
1207
                         "signal-after::completed", flash_out_completed, flash,
 
1208
                         NULL);
 
1209
}
 
1210
 
 
1211
void
 
1212
meta_compositor_flash_screen (MetaCompositor *compositor,
 
1213
                              MetaScreen     *screen)
 
1214
{
 
1215
  ClutterActor *stage;
 
1216
  ClutterActor *flash;
 
1217
  ClutterColor black = { 0, 0, 0, 255 };
 
1218
  gfloat width, height;
 
1219
 
 
1220
  stage = meta_get_stage_for_screen (screen);
 
1221
  clutter_actor_get_size (stage, &width, &height);
 
1222
 
 
1223
  flash = clutter_rectangle_new_with_color (&black);
 
1224
  clutter_actor_set_size (flash, width, height);
 
1225
  clutter_actor_set_opacity (flash, 0);
 
1226
  clutter_container_add_actor (CLUTTER_CONTAINER (stage), flash);
 
1227
 
 
1228
  clutter_actor_animate (flash, CLUTTER_EASE_OUT_QUAD,
 
1229
                         FLASH_TIME_MS,
 
1230
                         "opacity", 192,
 
1231
                         "signal-after::completed", flash_in_completed, flash,
 
1232
                         NULL);
 
1233
}