1. 01 Mar, 2010 1 commit
  2. 16 Feb, 2010 4 commits
    • Chris Lord's avatar
      [stage-x11] Fix a warning due to a missing cast · 719e314b
      Chris Lord authored
      I stupidly forgot to cast a ClutterStage to a ClutterActor and somehow
      missed or didn't get the compiler warning. Fix.
    • Chris Lord's avatar
      [stage-x11] Fix resizing for foreign windows · f9f03894
      Chris Lord authored
      As well as manually setting the geometry size, we needed to queue a
      relayout. This is what the ConfigureNotify handler would normally do,
      but we don't get this event when using a foreign window (obviously).
      This should fix resizing in things like gtk-clutter.
    • Chris Lord's avatar
      [stage-x11] Set the geometry size for foreign wins · df6e7aee
      Chris Lord authored
      If we get into the resize function and it's a foreign window, set the
      geometry size so that the allocate will set the backend size and call
    • Chris Lord's avatar
      [stage-x11] Fix switching fullscreen mode · 1117b6a9
      Chris Lord authored
      Setting/unsetting fullscreen on a mapped or unmapped window now works
      If you unfullscreen a window that was initially full-screened, it will
      unset the fullscreen hint and the WM will likely push the size down to
      the largest valid size.
      If the window was previously un-fullscreened, Clutter will restore the
      previous size.
      Fullscreening also now works if the WM switches the hint without the
      application's knowledge (as happens when you resize a window to the size
      of the screen, for example, with stock metacity).
  3. 15 Feb, 2010 2 commits
    • Chris Lord's avatar
      [stage] Fix some races to do with window resizing · 2fcb644e
      Chris Lord authored
      When we resize, we relied on the stage's allocate to re-initialise the
      GL viewport. Unfortunately, if we resized within Clutter, the new size
      was cached before the window is actually resized, so glViewport wasn't
      being called after resizing (some of the time, it's a race condition).
      Change the way resizing works slightly so that we only resize when the
      geometry size doesn't match our preferred size, and queue a relayout on
      ConfigureNotify so the glViewport gets called.
      Also change window creation slightly so that setting the size of a
      window before it's realized works correctly.
    • Emmanuele Bassi's avatar
      x11: Do not set pid or title on foreign windows · d607400f
      Emmanuele Bassi authored
      If a StageX11 is using a foreign window we should not need to set the
      _NET_WM_PID or the WM_TITLE properies.
  4. 07 Feb, 2010 2 commits
    • Chris Lord's avatar
      [stage-x11] Set the default size differently · c82c94e6
      Chris Lord authored
      We want to set the default size without triggering the layout machinary,
      so change the window creation process slightly so we start with a
      640x480 window.
    • Chris Lord's avatar
      [stage] Set default size correctly · b968defa
      Chris Lord authored
      Due to the way the new sizing works, clutter stage must set its size in
      init (to maintain old behaviour) and the properties on the X11 stage
      must be initialised to 1x1 so that it actually goes ahead with the
      Fixes stages that aren't user resizable and have no size set from
      appearing at 1x1.
  5. 06 Feb, 2010 4 commits
    • Chris Lord's avatar
      Revert "[x11] Don't set actor size on ConfigureNotify" · 8083dc41
      Chris Lord authored
      This reverts commit 29cc027f.
      I misunderstood the problem, this commit breaks resizes coming from
      outside of Clutter.
    • Chris Lord's avatar
      [x11] Don't set actor size on ConfigureNotify · 29cc027f
      Chris Lord authored
      Calling clutter_actor_set_size in response to ConfigureNotify makes
      setting the size of the stage racy - the most common result of which
      seems to be that you can't set the stage dimensions to anything less
      than 640x480.
      Instead, add a first_allocation bit to the private structure of the X11
      stage and force the first resize (necessary or the default stage will be
      a 1x1 window).
    • Chris Lord's avatar
      [stage-x11] make get_geometry always get geometry · 4887707b
      Chris Lord authored
      Now that we have a minimum size getter on the stage object, change
      get_geometry to actually always return the geometry. This fixes stages
      that are set as user-resizable appearing at 1x1 size.
      This will need changing in other back-ends too.
    • Chris Lord's avatar
      [stage] Add set/get_minumum_size · fd11d309
      Chris Lord authored
      Add two functions to set/get the minimum stage size. This takes effect
      when a stage is set to user resizable.
  6. 08 Jan, 2010 1 commit
    • Emmanuele Bassi's avatar
      x11: Switch back to RGB visuals by default · 5157da9f
      Emmanuele Bassi authored
      Since asking for ARGB by default is still somewhat experimental on X11
      and not every toolkit or complex widgets (like WebKit) still do not like
      dealing with ARGB visuals, we should switch back to RGB by default - now
      that at least we know it works.
      For applications (and toolkit integration libraries) that want to enable
      the ClutterStage:use-alpha property there is a new function:
        void clutter_x11_set_use_argb_visual (gboolean use_argb);
      which needs to be called before clutter_init().
      The CLUTTER_DISABLE_ARGB_VISUAL environment variable can still be used
      to force this value off at run-time.
  7. 08 Dec, 2009 1 commit
    • Emmanuele Bassi's avatar
      x11: Do not manage a foreign window · e957e277
      Emmanuele Bassi authored
      If a Stage has been set to use a foreign Window then Clutter should not
      be managing it; calling XWithdrawWindow and XMapWindow should be
      reserved to the windows we manage ourselves.
  8. 02 Nov, 2009 1 commit
    • Robert Bragg's avatar
      [stage-x11] Ensure viewport is initialized before first stage paint · f8f88737
      Robert Bragg authored
      This ensures that glViewport is called before the first stage paint.
      Previously _clutter_stage_maybe_setup_viewport (which is done before we
      start painting) was bailing out without calling cogl_setup_viewport because
      the CLUTTER_STAGE_IN_RESIZE flag may be set if the stage was resized before
      the first paint.  (NB: The CLUTTER_STAGE_IN_RESIZE flag isn't removed until
      we get an explicit event back from the X server since the window manager may
      choose to deny/alter the resize.)
      We now special case the first resize - where the viewport hasn't previously
      been initialized and use the requested geometry to initialize the
      glViewport without waiting for a reply from the server.
  9. 16 Oct, 2009 2 commits
    • Robert Bragg's avatar
      [x11 backend] remove data duplicated between backends and stages · 3187e196
      Robert Bragg authored
      Make backends the canonical point of reference for the xdisplay, the xscreen
      number, the x root window and the xvisinfo for creating foreign stages.
    • Robert Bragg's avatar
      [backends] Remove the idea of offscreen stages from all backends · 15d7a866
      Robert Bragg authored
      The only backend that tried to implement offscreen stages was the GLX backend
      and even this has apparently be broken for some time without anyone noticing.
      The property still remains and since the property already clearly states that
      it may not work I don't expect anyone to notice.
      This simplifies quite a bit of the GLX code which is very desireable from the
      POV that we want to start migrating window system code down to Cogl and the
      simpler the code is the more straight forward this work will be.
      In the future when Cogl has a nicely designed API for framebuffer objects then
      re-implementing offscreen stages cleanly for *all* backends should be quite
  10. 05 Oct, 2009 2 commits
    • Emmanuele Bassi's avatar
      [x11] Fix Stage user-initiated resize · 111512a2
      Emmanuele Bassi authored
      The user-initiated resize is conflicting with the allocated size. This
      happens because we change the size of the stage's X Window behind the
      back of the size allocation machinery.
      Instead, we should change the size of the actor whenever we receive a
      ConfigureNotify event to reflect the new size of the actor.
    • Emmanuele Bassi's avatar
      [x11] Remove a useless forced paint · e3c2ed00
      Emmanuele Bassi authored
      We force the redraw before mapping, in the hope that when a composited
      window manager maps the window it will have its contents ready; that is
      not going to work: the solution for this problem requires the implementation
      of a protocol for compositors, and not a hack.
      Moreover, painting before mapping will cause a paint with the wrong
      GL viewport size, which is the wrong thing to do on GLX.
  11. 08 Sep, 2009 1 commit
    • Emmanuele Bassi's avatar
      [stage] Rework the Stage implementation class · 6988744d
      Emmanuele Bassi authored
      Instead of using ClutterActor for the base class of the Stage
      implementation we should extend the StageWindow interface with
      the required bits (geometry, realization) and use a simple object
      This require a wee bit of changes across Backend, Stage and
      StageWindow, even though it's mostly re-shuffling.
      First of all, StageWindow should get new virtual functions:
        * geometry:
          - resize()
          - get_geometry()
        * realization
          - realize()
          - unrealize()
      This covers all the bits that we use from ClutterActor currently
      inside the stage implementations.
      The ClutterBackend::create_stage() virtual function should create
      a StageWindow, and not an Actor (it should always have been; the
      fact that it returned an Actor was a leak of the black magic going
      on underneath). Since we never guaranteed ABI compatibility for
      the Backend class, this is not a problem.
      Internally to ClutterStage we can finally drop the shenanigans of
      setting/unsetting actor flags on the implementation: if the realization
      succeeds, for instance, we set the REALIZED flag on the Stage and
      we're done.
      As an initial proof of concept, the X11 and GLX stage implementations
      have been ported to the New World Order(tm) and show no regressions.
  12. 14 Aug, 2009 1 commit
    • Xu Li's avatar
      Add new Atom atom_NET_WM_PID to set pid info · f7edc97d
      Xu Li authored
      Clutter advertises itself on X11 as implementing the _NET_WM_PING protocol,
      which is needed to be able to detect frozen applications; this allows us to
      stop the destruction of the stage by blocking the CLUTTER_DELETE event and
      wait for user feedback without the Window Manager thinking that the app has
      gone unresponsive.
      In order to implement the _NET_WM_PING protocol properly, though, we need
      to add the _NET_WM_PID property on the Stage window, since the EWMH states:
        [_NET_WM_PID] MAY be used by the Window Manager to kill windows which
        do not respond to the _NET_WM_PING protocol.
      Meaning that an unresponsive Clutter application might not be killable by
      the window manager.
      Fixes bug:
        http://bugzilla.openedhand.com/show_bug.cgi?id=1748Signed-off-by: default avatarEmmanuele Bassi <ebassi@linux.intel.com>
  13. 07 Aug, 2009 1 commit
    • Emmanuele Bassi's avatar
      [x11] Do not ask to destroy an empty Window · 420ed353
      Emmanuele Bassi authored
      The fix for bug 1750 inside commit b190448e made Clutter-GTK spew
      BadWindow errors. The reason for that is that we call XDestroyWindow()
      without checking if the old Window is None; this happens if we call
      clutter_x11_set_stage_foreign() on a new ClutterStage before it has
      been realized.
      Since Clutter-GTK does not need to realize the Stage it is going to
      embed anymore (the only reason for that was to obtain a proper Visual
      but now there's ClutterBackendX11 API for that), the set_stage_foreign()
      call is effectively setting the StageX11 Window for the first time.
  14. 04 Aug, 2009 1 commit
  15. 31 Jul, 2009 1 commit
  16. 17 Jul, 2009 1 commit
    • Neil Roberts's avatar
      [stage] Force an allocation before showing the stage · 7b811f8b
      Neil Roberts authored
      A lot of applications change the size of the stage from the default
      before the stage is initially shown. The size change won't take affect
      until the first allocation run. However we want the window to be at
      the correct size when we first map it so we should force an allocation
      run before showing the stage.
      There was an explicit call to XResizeWindow in
      clutter_stage_x11_show. This is not needed anymore because
      XResizeWindow will already have been called by the allocate method.
  17. 13 Jul, 2009 1 commit
  18. 01 Jul, 2009 1 commit
  19. 18 Jun, 2009 1 commit
    • Emmanuele Bassi's avatar
      Hide clutter_context_get_default() · c6fba47a
      Emmanuele Bassi authored
      The clutter_context_get_default() function is private, but shared
      across Clutter. For this reason, it should be prefixed by '_' so
      that the symbol is hidden from the shared object.
  20. 09 Jun, 2009 1 commit
    • Emmanuele Bassi's avatar
      [stage] Rename :fullscreen to :fullscreen-set · 7c89a0cc
      Emmanuele Bassi authored
      The :fullscreen property is very much confusing as it is implemented.
      It can be written to a value, but the whole process might fail. If we
        g_object_set (stage, "fullscreen", TRUE, NULL);
      and the fullscreen process fails or it is not implemented, the value
      will be reset to FALSE (if we're lucky) or left TRUE (most of the
      The writability is just a shorthand for invoking clutter_stage_fullscreen()
      or clutter_stage_unfullscreen() depending on a boolean value without
      using an if.
      The :fullscreen property also greatly confuses high level languages,
      since the same symbol is used:
        - for a method name (Clutter.Stage.fullscreen())
        - for a property name (Clutter.Stage.fullscreen)
        - for a signal (Clutter.Stage::fullscreen)
      For these reasons, the :fullscreen should be renamed to :fullscreen-set
      and be read-only. Implementations of the Stage should only emit the
      StageState event to change from normal to fullscreen, and the Stage
      will automatically update the value of the property and emit a notify
      signal for it.
  21. 08 Jun, 2009 1 commit
    • Emmanuele Bassi's avatar
      [x11] Do not forcibly set the stage size on fullscreen · 12b4e040
      Emmanuele Bassi authored
      Setting the stage size using clutter_actor_set_size() is almost always
      wrong: the X11 stage implementation should save the size and queue a
      relayout -- like it does when receiving a ConfigureNotify. The same
      should happen when setting it to be full screen.
  22. 04 Jun, 2009 3 commits
    • Emmanuele Bassi's avatar
      [x11] Rework map/unmap and resizing · e4ff24bc
      Emmanuele Bassi authored
      The mapping and unmapping of the X11 stage implementation is
      a bit bong. It's asynchronous, for starters, when it really
      can avoid it by tracking the state internally.
      The ordering of the map/unmap sequence is also broken with
      respect to the resizing.
      By tracking the state internally into StageX11 we can safely
      remove the MapNotify and UnmapNotify X event handling.
      In theory, we should use _NET_WM_STATE a lot more, and reuse
      the X11 state flags for fullscreening as well.
    • Emmanuele Bassi's avatar
      [actor] Use flags to control allocations · 0187bb39
      Emmanuele Bassi authored
      Instead of passing a boolean value, the ::allocate virtual function
      should use a bitmask and flags. This gives us room for expansion
      without breaking API/ABI, and allows to encode more information to
      the allocation process instead of just changes of absolute origin.
    • Emmanuele Bassi's avatar
      Remove usage of Units and macros · 046e571b
      Emmanuele Bassi authored
      The ClutterUnit and relative macros should not be used when dealing
      with pixels -- which is to say, all the time when inside Clutter.
  23. 13 May, 2009 1 commit
    • Emmanuele Bassi's avatar
      [x11] Abstract XVisualInfo creation · e59a19bd
      Emmanuele Bassi authored
      The XVisualInfo for GL is created when a stage is being realized.
      When embedding Clutter inside another toolkit we might not want to
      realize a stage to extract the XVisualInfo, then set the stage
      window using a foreign X Window -- which will cause a re-realization.
      Instead, we should abstract as much as possible into the X11 backend.
      Unfortunately, the XVisualInfo for GL is requested using GLX API; for
      this reason we have to create a ClutterBackendX11 method that we
      override inside the ClutterBackendGLX implementation.
      This also allows us to move a little bit of complexity from out of
      the stage realization, which is currently a very delicate and hard
      to debug section.
  24. 11 May, 2009 2 commits
  25. 06 May, 2009 1 commit
    • Emmanuele Bassi's avatar
      Remove Units from the public API · d6d208da
      Emmanuele Bassi authored
      With the recent change to internal floating point values, ClutterUnit
      has become a redundant type, defined to be a float. All integer entry
      points are being internally converted to floating point values to be
      passed to the GL pipeline with the least amount of conversion.
      ClutterUnit is thus exposed as just a "pixel with fractionary bits",
      and not -- as users might think -- as generic, resolution and device
      independent units. not that it was the case, but a definitive amount
      of people was convinced it did provide this "feature", and was flummoxed
      about the mere existence of this type.
      So, having ClutterUnit exposed in the public API doubles the entry
      points and has the following disadvantages:
        - we have to maintain twice the amount of entry points in ClutterActor
        - we still do an integer-to-float implicit conversion
        - we introduce a weird impedance between pixels and "pixels with
          fractionary bits"
        - language bindings will have to choose what to bind, and resort
          to manually overriding the API
          + *except* for language bindings based on GObject-Introspection, as
            they cannot do manual overrides, thus will replicate the entire
            set of entry points
      For these reason, we should coalesces every Actor entry point for
      pixels and for ClutterUnit into a single entry point taking a float,
        void clutter_actor_set_x (ClutterActor *self,
                                  gfloat        x);
        void clutter_actor_get_size (ClutterActor *self,
                                     gfloat       *width,
                                     gfloat       *height);
        gfloat clutter_actor_get_height (ClutterActor *self);
      The issues I have identified are:
        - we'll have a two cases of compiler warnings:
          - printf() format of the return values from %d to %f
          - clutter_actor_get_size() taking floats instead of unsigned ints
        - we'll have a problem with varargs when passing an integer instead
          of a floating point value, except on 64bit platforms where the
          size of a float is the same as the size of an int
      To be clear: the *intent* of the API should not change -- we still use
      pixels everywhere -- but:
        - we remove ambiguity in the API with regard to pixels and units
        - we remove entry points we get to maintain for the whole 1.0
          version of the API
        - we make things simpler to bind for both manual language bindings
          and automatic (gobject-introspection based) ones
        - we have the simplest API possible while still exposing the
          capabilities of the underlying GL implementation
  26. 24 Apr, 2009 2 commits
    • Havoc Pennington's avatar
      Enforce invariants on mapped, realized, visibility states · 125bded8
      Havoc Pennington authored
      Bug 1138 - No trackable "mapped" state
      * Add a VISIBLE flag tracking application programmer's
        expected showing-state for the actor, allowing us to
        always ensure we keep what the app wants while tracking
        internal implementation state separately.
      * Make MAPPED reflect whether the actor will be painted;
        add notification on a ClutterActor::mapped property.
        Keep MAPPED state updated as the actor is shown,
        ancestors are shown, actor is reparented, etc.
      * Require a stage and realized parents to realize; this means
        at realization time the correct window system and GL resources
        are known. But unparented actors can no longer be realized.
      * Allow children to be unrealized even if parent is realized.
        Otherwise in effect either all actors or no actors are realized,
        i.e. it becomes a stage-global flag.
      * Allow clutter_actor_realize() to "fail" if not inside a toplevel
      * Rework clutter_actor_unrealize() so internally we have
        a flavor that does not mess with visibility flag
      * Add _clutter_actor_rerealize() to encapsulate a somewhat
        tricky operation we were doing in a couple of places
      * Do not realize/unrealize children in ClutterGroup,
        ClutterActor already does it
      * Do not realize impl by hand in clutter_stage_show(),
        since showing impl already does that
      * Do not unrealize in various dispose() methods, since
        ClutterActor dispose implementation already does it
        and chaining up is mandatory
      * ClutterTexture uses COGL while unrealizable (before it's
        added to a stage). Previously this breakage was affecting
        ClutterActor because we had to allow realize outside
        a stage. Move the breakage to ClutterTexture, by making
        ClutterTexture just use COGL while not realized.
      * Unrealize before we set parent to NULL in clutter_actor_unparent().
        This means unrealize() implementations can get to the stage.
        Because actors need the stage in order to detach from stage.
      * Update clutter-actor-invariants.txt to reflect latest changes
      * Remove explicit hide/unrealize from ClutterActor::dispose since
        unparent already forces those
        Instead just assert that unparent() occurred and did the right thing.
      * Check whether parent implements unrealize before chaining up
        Needed because ClutterGroup no longer has to implement unrealize.
      * Perform unrealize in the default handler for the signal.
        This allows non-containers that have children to work properly,
        and allows containers to override how it's done.
      * Add map/unmap virtual methods and set MAPPED flag on self and
        children in there. This allows subclasses to hook map/unmap.
        These are not signals, because notify::mapped is better for
        anything it's legitimate for a non-subclass to do.
      Signed-off-by: default avatarEmmanuele Bassi <ebassi@linux.intel.com>
    • Emmanuele Bassi's avatar
      [x11] Use XWithdrawWindow() · 60645727
      Emmanuele Bassi authored
      Bug 1516 - Does not withdraw toplevels correctly
      clutter_stage_x11_hide() needs to use XWithdrawWindow(), not
      As it stands now, if the window is already unmapped (say the WM has
      minimized it), then the WM will not know that Clutter has closed the
      window and will keep the window managed, showing it in the task list
      and so forth.