1
0
Fork 0
Commit graph

516 commits

Author SHA1 Message Date
Jasper St. Pierre
95f3bb3b81 window-actor: Rename variable in scanning function
"w" usually stands for "width", but here it stands for the end X bound,
so we'll rename it to the more traditional "x2".

https://bugzilla.gnome.org/show_bug.cgi?id=691874
2013-01-17 16:33:53 -05:00
Jasper St. Pierre
9596c24f83 plugin-manager: Remove a bogus check
We dereference the plugin_mgr in the initializer above,
so it's wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=690609
2013-01-09 14:06:24 -05:00
Jasper St. Pierre
66d37e06ba compositor: Remove unused code fetching _XSETROOT_ID
We don't use this atom anywhere, so don't bother fetching it.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Adel Gadllah
3876a1a192 Support bypass compositor hints
Add support for _NET_WM_BYPASS_COMPOSITOR and _NET_WM_DONT_BYPASS_COMPOSITOR
as proposed here: https://mail.gnome.org/archives/wm-spec-list/2012-February/msg00010.html

https://bugzilla.gnome.org/show_bug.cgi?id=683020
2012-12-18 19:02:34 +01:00
Jasper St. Pierre
6139bc77ec Remove support for Core Events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:23 -05:00
Jasper St. Pierre
774ceec243 Select for XI2 events everywhere else
In random places that are not grabs, we selected for events on
things like the root window, stage window, COW and more. Switch
these over to using the proper XI2 APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
8931b8026e compositor: Identify XI2 events as grabbed events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:43 -05:00
Jasper St. Pierre
55251aa986 compositor: Use XInput2 to grab the pointer/keyboard
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:42 -05:00
Giovanni Campagna
e73946f0bf MetaBackgroundActor: add a setter for GLSL uniforms
It doesn't make sense to GLSL shaders without uniforms.

https://bugzilla.gnome.org/show_bug.cgi?id=682536
2012-11-17 02:14:38 +01:00
Florian Müllner
424fc5245a Add compositor hook to process keybindings selectively
Currently keybindings are blocked while the compositor holds a grab; if
we want a keybinding to be available anyway, we use captured ClutterEvents
to determine the KeyBindingAction the event would have triggered and
run our own handlers (ugh).
Instead, provide a hook to allow the compositor to filter out keybindings
before processing them normally, regardless of whether the compositor
holds a grab or not.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:47:05 +01:00
Rui Matos
c37c741592 meta-background-actor: Fix compilation error 2012-11-05 19:44:03 +01:00
Giovanni Campagna
859ea1457d Add the ability to add shader hooks to MetaBackgroundActor
Using ClutterEffect is not pratical on MetaBackgroundActor, as the FBO
redirection has a noticeable performance impact. Instead, allow adding
GLSL code directly to the pipeline used to draw the background texture.
At the same time, port MetaBackgroundActor to modern Cogl API.

https://bugzilla.gnome.org/show_bug.cgi?id=669798
2012-11-05 19:12:37 +01:00
Owen W. Taylor
f258556cec MetaPluginManager: don't send events to Clutter twice
When support for multiple plugins was removed, the logic that was
supposed to send events to Clutter directly *only if there is no filter
function from a plugin* was broken, so events were being sent to
Clutter twice if Clutter didn't consume them the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=686406
2012-11-03 19:36:41 -04:00
Jasper St. Pierre
7938458eb8 window-actor: Don't create a mask texture unnecessarily
Mask texture resources may be expensive. Don't create one
if we don't need to, like on an unshaped window without
a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=681676
2012-09-26 13:53:14 -03:00
Florian Müllner
0371194191 window-group: Add missing cast 2012-09-04 09:10:35 +02:00
Florian Müllner
3b0c7c568d window-group: Remove unused variables 2012-09-04 08:56:48 +02:00
Jasper St. Pierre
bc96a14185 window-group: Subtract the unredirected window in stage space
meta_window_group_paint tries to carefully figure out which parts of the
scene it can avoid painting. One area it avoids painting is the region of
the screen occupied by an unredirected window (if there's one present).
When subtracting from the visible region, it gets the coordinate spaces
confused, and ends up subtracting the area at the wrong offset. Fix this
by translating the rectangle subtracted from the visible region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:38:53 -03:00
Jasper St. Pierre
fbcddbcf3e window-group: Skip the unredirected window
We shouldn't need to process it here.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:23:06 -03:00
Jasper St. Pierre
dfe8979a90 window-group: Don't create a region when we have an unredirected window
We don't do anything with it other than modify an existing region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:06:09 -03:00
Jasper St. Pierre
d8bc7f7aa1 window-actor: Fix a memory leak
We need to free the frame_paint_region here.

https://bugzilla.gnome.org/show_bug.cgi?id=682648
2012-08-25 05:51:01 -03:00
Owen W. Taylor
7a2a6e2675 MetaWindowGroup: Fix bad merge
I accidentally committed merge indicators: fix compilation.
2012-08-15 22:46:23 -04:00
Owen W. Taylor
c27b4b7cfc MetaWindowGroup: Handle painting inside a ClutterClone
Look at the current COGL model-view matrix and use that to find
out any offset we are painting at as a result of being inside
a ClutterClone.

https://bugzilla.gnome.org/show_bug.cgi?id=681953
2012-08-15 20:43:19 -04:00
Owen W. Taylor
0ab572d511 MetaWindowGroup: fix logic for handling translations
Instead of getting the x/y of the MetaBackgroundActor with respect to the
parent, use the same logic that we do for windows, fixing the case
where there is a more complex transformation involved.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-15 20:43:07 -04:00
Florian Müllner
4e2c2cb1ab shadows: Adjust values for attached modal dialogs
The designers consider the current shadow too dramatic for the new
centered position; adjust the shadow to use the same values as
popup menus.
2012-08-10 16:36:26 +02:00
Tom Beckmann
cd0870730f window-group: Translate background's visible region as necessary
Currently when the window group is moved, the visible region set
on the background actor no longer matches the actually visible
region, resulting in flickering around window actors.
Fix by translating the visible region with the window group.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-07 01:28:09 +02:00
Florian Müllner
1a5132d391 shadow-factory: Don't use a top-fade on attached modals
https://bugzilla.gnome.org/show_bug.cgi?id=674499
2012-07-14 03:30:56 +02:00
Jasper St. Pierre
a2f2e07e9b meta-window-actor: Fix a potential crash in the window shaping code
There was a potential case where we were trying to use uninitialized memory,
in the case where the X server threw an error during XShapeGetRectangles.
In this case, we need to use the implicit shape for the window, which means
we need to rearrange code flow to make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=677977
2012-06-25 14:07:35 -04:00
Jasper St. Pierre
f5e48223c9 meta-plugin-manager: Guard against a NULL start vfunc
The default plugin has no such vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=678238
2012-06-25 13:52:47 -04:00
Jasper St. Pierre
66eac7824a meta-window-actor: Don't unredirect shaped windows
If a window has its BoundingRegion shaped, we shouldn't unredirect it,
as it expects the rest of the windows from being shown under it. This
prevents applications like the Skype screen recorder or gtkRecordMyDesktop
which want to show a "border" around the recorded area from being
unredirected, giving the appearance of making the desktop freeze.

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:43 -04:00
Jasper St. Pierre
4041f96ed3 meta-window-actor: Refactor should_unredirect a bit more
"Flat is better than nested"

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:42 -04:00
Jasper St. Pierre
f9454e29db meta-plugin-manager: Only allow one plugin to be loaded
The "multiple plugins loaded at once" strategy was always a big fiction:
while it may be viable if you're super careful, it's fragile and requires
a bit of infrastructure that we would be better off without.

Note that for simplicity, we're keeping the MetaPluginManager, but it only
manages one plugin. A possible future cleanup would be to remove it entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
574c0c3287 meta-plugin: Remove "disabled" feature
It's just code cruft that nobody's using

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
9fa5aa9889 meta-plugin: Kill off "features"
We already check that the plugin has the appropriate vfunc in the klass
structure, so we shouldn't need to check for the same data again with
a "features" long.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
7c1b734053 meta-plugin: Remove some cruft
https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
30bc8bc6ce window-actor: Add a debugging tool to write a region to a PNG
Just a helper function that I keep rewriting all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
ac18f41ed1 window-actor: Use MetaRegionBuilder when scanning the visible region
This gives a pretty solid performance improvement when resizing windows.
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
60c05a0dac window-actor: Add back antialiased window corners
This simply adds fancy arcs to the mask texture. It's still not painted
with GTK+ yet.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:05 -04:00
Jasper St. Pierre
c47de98c88 window-actor: Paint the shape region with cairo
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
f1aada0fae window-actor: Punt mask generation to MetaWindowActor
This effectively makes MetaShapedTexture not a MetaShapedTexture, but a simple
and dumb MetaMaskedTexture, with an optimization for clipped regions.

We're doing this as the mask may need to be more complicated than made of
a cairo path -- we eventually want GTK+ to draw the entire frame background,
which we'll then scan.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
4de492eb20 shaped-texture: Remove the cairo overlay (and rounded corners)
As we want GTK+ to paint the mask on an A8, we can't simply use a cairo
path. A later commit will make this into a simple masked texture, and
meta-window-actor will be in control of the mask.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
9ca00d5cce window-actor: Remove an unnecessary frame check
meta_frame_calc_borders will zero out the borders if we don't have a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
878b1012b4 window-actor: Another simple clang warning fix
If we explicitly check for a NULL pointer, clang will assume
that the pointer may be NULL at some point. We clearly rely
on the pointer being non-NULL earlier, so fix this guy up.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-05-01 18:25:33 -04:00
Owen W. Taylor
ba4f008d40 meta_window_actor_has_shadow: remove verbosity
meta_window_actor_has_shadow() is called for every paint for every
window, verbosely logging in it makes the output of MUTTER_VERBOSE
pretty much useless.
2012-05-01 11:37:23 -04:00
Jasper St. Pierre
ebf8c460e1 default plugin: Remove start method that does nothing
All animations use the constants directly, so this is just declaring
a bunch of local variables and then doing nothing with it.

Another clang warning.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
25d3432eee window-group: Remove an unnecessary assignment
Clang warns about this.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
cd7a74fbcd texture-tower: Remove potential leak
The expression in here does not match the one where we malloc the
data.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 10:02:41 -04:00
Neil Roberts
ed358c8f4b meta-texture-rectangle: Use Cogl's API to create a rectangle texture
Cogl now has public experimental API to create a rectangle texture
which we can use instead of creating a foreign texture with GL. This
avoids Mutter depending on Cogl including a GL header from its public
headers which it might not do in future.

https://bugzilla.gnome.org/show_bug.cgi?id=672711
2012-04-25 14:54:09 +01:00
Robert Bragg
a22859a64a shaped-texture: never slice shape mask texture
Since Cogl doesn't support multi-texturing with sliced textures and the
shape texture is combined with the texture-from-pixmap texture we need
to make sure we never construct a sliced mask texture. This patch simply
passes the COGL_TEXTURE_NO_SLICE flag to cogl_texture_from_data when
creating the shape mask texture.

https://bugzilla.gnome.org/show_bug.cgi?id=674731
2012-04-25 11:57:33 +01:00
Jasper St. Pierre
c0b4d68390 meta-window-actor: Remove some unused constants
https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
e389eff79d Remove meta_compositor_update_workspace_geometry
This callback is just dead code

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
044d58951e Switch to gtk-doc syntax
https://bugzilla.gnome.org/show_bug.cgi?id=673752
2012-04-24 15:20:39 -04:00
Giovanni Campagna
3aad30143c default plugin: use the right type for varargs
Coordinates in Clutter are double, so twice the size of an int, and
if not correctly casted memory corruption occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=673809
2012-04-10 03:45:25 +02:00
Owen W. Taylor
c8b4939c7e Fix uninstalling default.so
We need a clean uninstall for 'make distcheck' to pass; libtool
hijinks leave a left-over plugins/default.so - remove it manually.
2012-03-26 14:23:19 -04:00
Jasper St. Pierre
8c1b2d5eda Simplify the frame testing logic in callers to grab borders
A lot of code did something similar to:

  MetaFrameBorders borders;

  if (window->frame)
    meta_frame_calc_borders (window->frame, &borders);
  else
    meta_frame_borders_clear (&borders);

Sometimes, the else part was omitted and we were unknowingly using
uninitalized values for OR windows. Clean this up by just testing
for a NULL frame in meta_frame_calc_borders and clearing for the
caller if so.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
2012-03-17 06:40:54 -04:00
Rui Matos
a8ead4d447 MetaWindowActor: don't draw shadows for tiled windows with a match
The shadow between 2 tiled windows ruins the visual tiles effect.

https://bugzilla.gnome.org/show_bug.cgi?id=643075
2012-03-16 19:12:10 +01:00
Damien Radtke
04bf73ff6d default plugin: animate minimization to icon geometry
Instead of minimizing windows in place, minimize them to the icon
geometry for the window (if set), or to the upper-left corner if
it's not set.

https://bugzilla.gnome.org/show_bug.cgi?id=667437
2012-03-13 13:53:05 -04:00
Rui Matos
3f3e3ce37e plugins/default: Fix compiler error 2012-03-09 14:05:28 +01:00
Jasper St. Pierre
5e3d93da87 plugin: Remove unneeded wrapper APIs
Mutter originally started out with the idea that only a subset of the total
API was exposed to plugins, so some APIs are duplicated on MutterPlugin.
We've long since abandoned that idea; remove these wrappers.

https://bugzilla.gnome.org/show_bug.cgi?id=671103
2012-03-08 16:52:44 -05:00
Robert Bragg
d249cfd040 Pass CoglContext to cogl_texture_pixmap_x11_new()
The experimental Cogl api cogl_texture_pixmap_new() was recently changed
so it now expects an explicit CoglContext argument and it can also
return exceptions now via a GError. This patch updates mutters use of
the api accordingly.
2012-02-21 18:23:22 +00:00
Adel Gadllah
3cb912aee2 MetaShapedTexture: Implement get_paint_volume
Add a get_paint_volume implementation to MetaShapedTexture.
2012-02-21 18:09:25 +01:00
Jasper St. Pierre
0dab6df25a configure: Require Clutter 1.9.10
We depend on API introduced in Clutter 1.9.10. Additionally, remove
a compatibility fallback that isn't needed anymore.
2012-02-16 16:44:03 -05:00
Jasper St. Pierre
c844bab232 meta-background-actor: Chain up in dispose
This was preventing Clutter from running its dispose, preventing
it from being destroyed correctly. While a major bug and possibly
big memory leak, the most obvious effect was the message that Clutter
spat out:

  Clutter-CRITICAL **: clutter_actor_iter_next: assertion `ri->age == ri->root->priv->age' failed

Since we never disposed the actor correctly, it was never removed
from its parent, and the age wasn't updated correctly.
2012-02-16 16:29:33 -05:00
Jasper St. Pierre
7319b10d72 MetaShapedTexture: Remove visible_pixels_region
When we were shaping the window with a cairo region, there was an easy
optimization to restrict painting only to the pixels we were going to
actually draw. With rounded corners, the amount of work we have to do
figure out what pixels isn't worth the small savings of not drawing the
completely transparent parts of the corners, so remove this optimization,
and the supporting meta_shaped_texture_get_visible_pixels_region()

https://bugzilla.gnome.org/show_bug.cgi?id=657639
2012-02-03 19:58:21 -05:00
Jasper St. Pierre
1265efcf78 MetaShapedTexture: Add a new method to flatten the shaped texture into pixels
This will be used by the Shell to implement a screenshot_window method.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 19:57:38 -05:00
Jasper St. Pierre
3e0ef03fd9 MetaShapedTexture: Make public and directly derive from ClutterActor
ClutterTexture has many features that we simply don't use and don't make
sense for a subclass with custom drawing. Deriving directly from ClutterActor
simplifies our code by avoiding workarounds and makes things more robust.

Additionally, make it public. GNOME Shell was already assuming that any
MetaShapedTexture was also a ClutterTexture, and we need to replace these
bits with new API for GNOME Shell to use.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 15:35:41 -05:00
Jasper St. Pierre
ac7ec585c8 compositor: Use raw Xlib to resize the compositor window
If we get two configure events on the root window in close
sequence, then we could get the sequence:

 ConfigureNotify on the root window w1xh1
   Processed by Mutter
 clutter_actor_set_size(stage, w1, h1)
 <relayout happens, stage window resized by clutter>

 ConfigureNotify on the root window, w2xh2
   Processed by Mutter
 clutter_actor_set_size(stage, w2, h2)
 ConfigureNotify on the stage window, w1, h1)
   Processed by Clutter
 clutter_actor_set_size(stage, w1, h1)
 <relayout happens, stage window resized by clutter>

Leaving the stage at the wrong size. To avoid fighting with Clutter,
switch to resizing the stage with XResizeWindow(), similar to how a
toplevel window is handled by a window manager.
2011-12-15 16:06:07 -05:00
Jasper St. Pierre
264c555af0 Do not use the default stage
https://bugzilla.gnome.org/show_bug.cgi?id=664028
2011-12-15 16:06:07 -05:00
Adel Gadllah
bbbb0e6002 meta-window-actor: Add error traps in meta_window_actor_set_redirected
meta_window_actor_set_redirected makes X calls on the client window
so it need to set error traps.
2011-12-15 19:53:41 +01:00
Jasper St. Pierre
3a4512cd91 Use generic marshaller
https://bugzilla.gnome.org/show_bug.cgi?id=662153
2011-12-13 19:53:57 -05:00
Jasper St. Pierre
162213be0d Fix cogl crash from updating non-existent texture
The code here was always incorrect - we were processing damage events for
windows without having a texture. Before, this didn't matter, as
cogl_texture_get_width silently returned 0 for invalid handles. Cogl commit
4c3dadd35e changed this.

The fix here involves two strategies. First, we try to guard MetaTextureTower
from invalid textures. Second, we try not to go down the path that eventually
calls meta_shaped_texture_update_area by not handling damage events if we
don't have a texture for the window.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2011-11-10 16:40:12 -05:00
Jasper St. Pierre
1596d1af10 meta-window-group: Fix types typo
gboolean is a typedef for int, so it doesn't matter too much

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2011-11-10 15:52:25 -05:00
Jasper St. Pierre
821d4458ea Minor annotation fixes. 2011-10-24 17:06:17 -04:00
Jasper St. Pierre
3599917123 meta-window-group: Use clutter_actor_has_effects if available
This avoids a potentially costly allocation on every pixmap update.

https://bugzilla.gnome.org/show_bug.cgi?id=662225
2011-10-21 09:20:46 -04:00
Rui Matos
bf175e72ad MetaWindowActor: don't unredirect ARGB32 windows
In particular this would a cause a "flash" when showing the tile preview for
maximization on a non-primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=662053
2011-10-18 02:33:34 +01:00
Jasper St. Pierre
f82966adb5 Various annotation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=660854
2011-10-04 16:44:39 -04:00
Adel Gadllah
1b4dce6f84 meta-window-group: Plug memory leak
We have to free the list returned by clutter_actor_get_effects() .

https://bugzilla.gnome.org/show_bug.cgi?id=660464
2011-09-29 15:36:10 +02:00
Adel Gadllah
7c6bc73031 MetaWindowActor: Skip paint optimization for actors with an effect
The optimizations might not work for an actor with an effect, and
our clipped drawing interferes badly with the operation of
CoglOffscreenEffect.

https://bugzilla.gnome.org/show_bug.cgi?id=659523
2011-09-20 20:52:03 +02:00
Rui Matos
c1368155fc MetaWindowActor: unset the shaped texture overlay path for frameless windows
When a window loses its frame we must unset any overlay path previously set on
the shaped texture.

Not doing so would cause rendering glitches near the window corners in
e.g. chrome/chromium by changing the Appearance preference "Use system title
bar and borders" → "Hide system title bar and use compact borders".

https://bugzilla.gnome.org/show_bug.cgi?id=659477
2011-09-19 18:52:43 +01:00
Adel Gadllah
abde64cb0c Don't unredirect non fully opaque windows
When a window is set to be translucent with _NET_WM_WINDOW_OPACITY it shouldn't
be unredirected as this will cause the hint to have no effect.
2011-09-16 21:39:03 +02:00
Adel Gadllah
6923973c8a compositor: Fix cow shaping on multi monitor setups
XFixesCreateRegionFromWindow does not take the window's position into account,
which results into setting a wrong shape for windows not located on the
leftmost monitor.

Fix that by creating the region from the window's MetaRectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=657869
2011-09-16 19:02:11 +02:00
Owen W. Taylor
2dc5693c60 Don't lose application redraws
Our usage of DamageReportBoundingBox was causing us to miss some
updates when an area of the screen was drawn twice in rapid
succession. Add an explicit XSync() call to force the server
to flush rendering to the kernel before we draw.

https://bugzilla.gnome.org/show_bug.cgi?id=657071
2011-09-14 14:36:52 -04:00
Jasper St. Pierre
9520eaa970 MetaShapedTexture: Fix a crash caused by a silly typo 2011-09-13 20:15:22 -04:00
Jasper St. Pierre
088e0c1ee7 MetaWindowActor: Make sure to always pop an error trap
https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:42:06 -04:00
Jasper St. Pierre
de704386a1 Revert "MetaWindowActor: Delete useless error trap"
This reverts commit 766799ec6d.
2011-09-13 13:41:43 -04:00
Jasper St. Pierre
766799ec6d MetaWindowActor: Delete useless error trap
https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:40:26 -04:00
Adel Gadllah
7c50db5bf5 meta-window-actor: Skip unnecessary steps in pre_paint
We don't have to call check_needs_pixmap, check_needs_reshape
and check_needs_shadow on unredirected windows, so skip that.

https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:40:11 -04:00
Owen W. Taylor
1ab6abc044 focus-follows-mouse: ignore events generated when reshaping the stage
* Export meta_display_add_ignored_crossing_serial()
* Add the serial for reshaping the stage
* Increase the size of the "ignored_serials" array a bit to
  try to avoid the possibility of losing serials from multiple
  reshapes happening close together.

https://bugzilla.gnome.org/show_bug.cgi?id=597190
2011-09-12 09:56:59 -04:00
Jasper St. Pierre
622583a0d5 MetaWindowActor: Corner paths needs to be made in clockwise order
https://bugzilla.gnome.org/show_bug.cgi?id=657661
2011-08-30 10:55:06 -04:00
Adel Gadllah
2f33d85a41 compositor: Fix crash in pre_paint_windows when no windows are open
https://bugzilla.gnome.org/show_bug.cgi?id=657692
2011-08-30 15:20:34 +02:00
Adel Gadllah
ada8882b61 Fix typo 2011-08-29 23:18:51 +02:00
Adel Gadllah
d3831729a0 Unredirect fullscreen windows
Some apps that do a lot of rendering on the screen like games, mostly run in
fullscreen where there is no need for them to be redirected doing so does add
an overhead; while performance is critical for those apps.

This can be disabled / enabled at runtime using
meta_enable_unredirect_for_screen / meta_disable_unredirect_for_screen

https://bugzilla.gnome.org/show_bug.cgi?id=597014
2011-08-29 23:05:30 +02:00
Jasper St. Pierre
8c74ad1992 MetaWindowActor: Don't use uninitialized frame borders
https://bugzilla.gnome.org/show_bug.cgi?id=656335
2011-08-29 12:58:05 -04:00
Rui Matos
88064fd534 MetaBackgroundActor: fix a typo
https://bugzilla.gnome.org/show_bug.cgi?id=657583
2011-08-29 16:54:29 +01:00
Rui Matos
b28c6533f8 MetaBackgroundActor: make it a public class
https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 16:54:09 +01:00
Rui Matos
53e70b3e99 MetaBackgroundActor: add a dim-factor property
This property darkens the background.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 15:40:20 +01:00
Owen W. Taylor
c630046858 MetaBackgroundActor: allow creating multiple instances
Instead of requiring a singleton MetaBackgroundActor for the screen,
allow creating multiple copies that internally share a single
CoglTexture behind the scenes. This will be useful for allowing
multiple views of the screen background with different rendering
options.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 07:51:12 -04:00
Jasper St. Pierre
978e601217 MetaWindowActor: Don't use truncated values when drawing the cairo overlay path
This was causing visual artifacts on large border radius values.
2011-08-26 21:50:20 -04:00
Jasper St. Pierre
dcfa6986c6 Antialiased corners
Use a specially constructed cairo overlay to give us fully anti-aliased
corners on the mask texture.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-26 12:24:23 -04:00
Jasper St. Pierre
49a3fd53b0 MetaShapedTexture: Allow for a "cairo overlay"
A cairo overlay gives us a path to overlay the mask texture data, allowing for
complex, anti-aliasing effects on the frame shape.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-26 12:24:22 -04:00
Jasper St. Pierre
f83568fc4e MetaShapedTexture: Use a proper stride, calculated by cairo
This will help us when painting directly on to the mask texture with
cairo, which is needed for rounded corner AA.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-24 09:38:23 -04:00
Jasper St. Pierre
46415bb248 MetaWindowActor: Fix incorrect short-circuit
The code here was wrong in every way: it only updated the shape if all the
borders changed. It never saved new last_borders even if it *had* changed,
and the bounding rectangle's x and y positions were still important otherwise.

This had user-visible impact when doing simple things like changing the
border_width. It would short-circuit here and due to the above incorrectness,
weirdness could happen where windows would be cut off and so on.

https://bugzilla.gnome.org/show_bug.cgi?id=656334
2011-08-24 09:38:23 -04:00
Jasper St. Pierre
2f254e5aa3 MetaWindowActor: Compensate for invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
e0e78993f6 MetaWindowActor: Remove priv->attrs
It was deprecated and most of the information was in the MetaWindow anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
7e0a56fb80 Track the shape of the client window directly
Since we're not setting the frame's output shape any more, it doesn't
make sense to calculate the output shape based on the frame window.
Instead, track the client window directly and calculate the output shape
based on that.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Jasper St. Pierre
65e1b416ef Port MetaShapedTexture/MetaWindowActor to use cairo regions instead of XRects
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Emmanuele Bassi
f396a7aeb4 Do not use ClutterGLXTexturePixmap
MetaShapedTexture can be a ClutterX11TexturePixmap sub-class, given that
ClutterGLXTexturePixmap is just a shim compatibility layer since Clutter
1.4, and it's been deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=655064
2011-07-22 10:49:04 +01:00
Emmanuele Bassi
ffa2310a34 Use Cogl API to check for TfP extension support
Do not use the ClutterGLXTexturePixmap method, since it's been
deprecated and it's just a convenience function around the Cogl
API anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=655064
2011-07-22 10:49:04 +01:00
Neil Roberts
fccd626604 Use a utility function to create GL_ARB_texture_rectangles
meta-texture-rectangle and meta-shaped-texture both create textures
with GL_TEXTURE_RECTANGLE_ARB as the target using direct GL
calls. This patch moves that code into a shared utility function in a
separate file instead. The function resolves the required GL symbols
dynamically instead of linking to them directly so that if Clutter
eventually stops linking to -lGL mutter will continue to build. The
function also splits the texture creation into a separate texture
creation and data upload stage so that it can use
cogl_texture_set_region to upload the data. That way it can avoid
clobbering the glPixelStore state and it can let Cogl do any necessary
format conversion. The code preserves the old value of the rectangle
texture binding instead of clobbering it because Cogl expects to be
able to cache this value to avoid redundant glBindTexture
calls. Finally, the function uses cogl_object_set_data to
automatically destroy the GL texture when the Cogl texture is
destroyed. This avoids having to have special code to destroy the cogl
texture.

https://bugzilla.gnome.org/show_bug.cgi?id=654569
2011-07-19 11:06:23 +01:00
Jasper St. Pierre
5237b2aa65 Fix dump_region 2011-07-18 16:49:10 -04:00
Adel Gadllah
3f694c7335 MetaTextureTower: Remove workaround for old clutter bug
texture_tower_revalidate_fbo() called cogl_flush() to work around
clutter bug #2110, which has been long fixed.

As we depend on clutter 1.7.x anyway we can just remove that workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=654729
2011-07-16 14:24:31 +02:00
Adel Gadllah
3da2f876bd Use paint volumes unconditionally
As we depend on clutter 1.7.x we no longer need to the 1.5.2
version check for paint volumes so just remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=654730
2011-07-16 14:20:51 +02:00
Neil Roberts
4167ef870c meta-window-group: Use clutter_stage_get_redraw_clip_bounds
Clutter now has some API to get the bounds of the current redraw clip
so Mutter no longer needs to make direct GL calls to get the scissor
rect. This should make it more robust against Cogl or Clutter changing
how it does the clipping.

https://bugzilla.gnome.org/show_bug.cgi?id=654551
2011-07-13 16:39:50 +01:00
Jakub Steiner
47b432bf89 Improve shadow defaults.
- menus have a very subtle shadow, define the outline better. Required for gtk theming.
- focused windows are better identified now as unfocused windows have a subtle shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=649374
2011-07-11 16:00:03 +02:00
Owen W. Taylor
be8df20675 Fix typo when computing shadow bounds
A x/y typo that was causing shadow bounds to be incorrectly
computed and trails to be left in some circumstances. Behavior
noted by Jakub Steiner.

https://bugzilla.gnome.org/show_bug.cgi?id=649374
2011-07-08 22:38:12 -04:00
Jasper St. Pierre
2b93c19328 Clip the shaped region to the bounding region
According to the XShape specification, the shaped region should always be
a subset of the bounding region. Certain programs such as wine depended
on this behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=627880
2011-06-30 16:35:13 -04:00
Owen W. Taylor
66a830fd46 Fixes for compositor replacement
* When unmanaging a screen, stop redirecting subwindows explicitly,
  so that we do that before destroying the window manager selection
  window.
* Improve comment in the retry code
* When exiting because the previous compositor couldn't be replaced,
  don't g_error() and drop a core file.

https://bugzilla.gnome.org/show_bug.cgi?id=653121
2011-06-30 16:26:10 -04:00
Owen W. Taylor
fe12294b92 Create the 1x1 texture for the root background unsliced
When there was no root background pixmap, we were using a 1x1 repeating
texture as a simple way of drawing a solid color without adding a
second code path. However, when that 1x1 texture was combined into
a larger "atlas texture", hardware repeat couldn't be used, so a
small inefficiency from this approach became an enormous inefficiency
as clutter drew every pixel of the background as a separate rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=652507
2011-06-29 12:27:02 -04:00
Colin Walters
c18940a5a2 compositor: Loop and retry to get compositor selection when replacing
There are unavoidable race conditions here when another process is
replacing us.  As a band aid, loop for 5 seconds.

https://bugzilla.gnome.org/show_bug.cgi?id=653121
2011-06-21 15:22:31 -04:00
Colin Walters
6596374886 region-utils.c: Squash a memory leak
"chunk" was an allocated but unused variable.

https://bugzilla.gnome.org/show_bug.cgi?id=649504
2011-05-11 14:15:48 -04:00
Owen W. Taylor
67c3c93b8f Only shadow ARGB windows with a frame outside the frame
An ARGB window with a frame is likely something like a transparent
terminal. It looks awful (and breaks transparency) to draw a big
opaque black shadow under the window, so clip out the region under
the terminal from the shadow we draw.

Add meta_window_get_frame_bounds() to get a cairo region for the
outer bounds of the frame of a window, and modify the frame handling
code to notice changes to the frame shape and discard a cached
region. meta_frames_apply_shapes() is refactored so we can extract
meta_frames_get_frame_bounds() from it.

https://bugzilla.gnome.org/show_bug.cgi?id=635268
2011-04-26 15:10:02 -04:00
Owen W. Taylor
c30c29b8c3 Make _NET_WM_WINDOW_OPACITY orthogonal to window actor opacity
Using MetaWindowActor.opacity for _NET_WM_WINDOW_OPACITY makes it
difficult to implement effects like fading a window in on map.
Instead, set the opacity on the MetaShadedTexture child and use
it when drawing the shadow.

Since the check MetaWindowGroup does on meta_actor_get_paint_opacity()
no longer covers this, we need to handle the opacity in
meta_window_actor_get_obscured_region() explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=648613
2011-04-26 15:10:02 -04:00
Dan Winship
f464b85ffc window: add an appears-focused property, redraw shadows when it changes
We need to redraw a window's shadow any time the value of
meta_window_appears_focused() changes. So make that into a property so
we can get notifications on it.

https://bugzilla.gnome.org/show_bug.cgi?id=636904
2011-03-28 12:09:10 -04:00
Dan Winship
3597035f67 bell: add a composited flash-screen function
The old bell_flash_screen() has no effect when compositing. Add
meta_compositor_flash_screen(), and use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=639765
2011-03-18 13:53:53 -04:00
Owen W. Taylor
349fb7c297 MetaWindowActor: keep a reference to the MetaWindow
Until the actor is destroyed, we need to have access to the
MetaWindow to access some fields used for painting. Keep a strong
reference to the window rather than just hoping the window will
not be freed.

https://bugzilla.gnome.org/show_bug.cgi?id=642787
2011-03-16 15:36:55 -04:00
Dan Winship
c84da3ce1b Move the installed includes to a subdir
If mutter is going to be a "real" library, then it should install its
includes so that users can do

    #include <meta/display.h>

rather than

    #include <display.h>

So rename the includedir accordingly, move src/include to src/meta,
and fix up all internal references.

There were a handful of header files in src/include that were not
installed; this appears to have been part of a plan to keep core/,
ui/, and compositor/ from looking at each others' private includes,
but that wasn't really working anyway. So move all non-installed
headers back into core/ or ui/.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
2011-03-07 18:19:53 -05:00
Dan Winship
bb50f65532 Allow mutter to be used as a library
Move all of the mutter code into a new libmutter-wm.so, split its
main() method into meta_get_option_context(), meta_init() and
meta_run(), add methods for using in-process plugins, and add
libmutter-wm.pc pointing to the new library.

The mutter binary is now just a tiny program that links against
libmutter-wm. The --version and --mutter-plugins options are handled
at the mutter level, not in libmutter-wm, and a few strange unused
command-line options (--no-force-fullscreen and --no-tab-popup) have
been removed.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
2011-03-07 18:19:53 -05:00
Dan Winship
4c76791d4c Remove some unused plugin functionality
Revert the early_initialize changes (which get in the way in the
"libmutter-wm" paradigm), remove the GConf key for setting plugins,
and remove plugin "params", which weren't being used. Also remove all
the logic for unloading and reloading plugins, since the list never
changes after startup now.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
2011-03-07 10:01:37 -05:00
Jani Monoses
27626d14b7 Fix non-GLX build.
Include clutter-x11.h when not building for GLX.
2011-03-02 15:55:51 +02:00
Colin Walters
f2158218be plugins: Add early_initialize vfunc
For GNOME Shell, we need to grab our DBus names *before* we talk XSMP.
gnome-session takes our XSMP connection as "I'm ready", and starts
running all the other random crud that people dropped in as autostart
files.  But for example, we need to have claimed
org.freedesktop.Notifications before a lot of said crud starts.

This requires a plugin API version bump.

Misc: Move handling of --version way earlier in main() where
it should be; no point having it wedged after plugin handling.
2011-02-25 14:38:04 -05:00
Owen W. Taylor
735c33bd9f MetaBackgroundActor: Handle paint opacity
We were ignoring the opacity set on the background actor, causing problems,
e.g., when fading out the workspace thumbnails in GNOME Shell.

https://bugzilla.gnome.org/show_bug.cgi?id=641979
2011-02-12 18:27:09 -05:00
Colin Walters
1133a4ff9c Make plugin loading failure fatal
If a plugin was explicitly specified, falling back to the default
silently is bad; a manager component like gnome-session can
do a better job of handling this scenario.

An example we've hit in gnome-shell is where SpiderMonkey changes
without gjs being rebuilt, and loading the plugin fails due to
unresolved symbols.

But there are obviously others, like the file being missing or
corrupt.

https://bugzilla.gnome.org/show_bug.cgi?id=641384
2011-02-03 14:23:03 -05:00
Owen W. Taylor
a9504f1495 MetaWindowActor: Add a 'position-changed' signal
Similar to the recently added 'size-changed' signal, we may want to do
something in response to a window being repositioned without waiting for
notify::allocation. (Especially since what we can do in notify::allocation
is severely limited by Clutter forbidding queueing an allocation at that
point.)

https://bugzilla.gnome.org/show_bug.cgi?id=641310
2011-02-02 23:55:47 -05:00
Owen W. Taylor
1a276a2ee5 Don't constantly restack hidden windows
A logic bug was resulting in the bottom hidden window (hidden means means
minimized or on a different workspace) continually being stacked above
the other hidden windows.

https://bugzilla.gnome.org/show_bug.cgi?id=640679
2011-01-26 17:02:17 -05:00
Florian Müllner
ad707be01e window-actor: Add "size-changed" signal
Emit a signal when the window size changes. While it is already
possible to connect to notify::allocation (or width/height), the
new signal is emitted outside a clutter allocation cycle, which
makes it more convenient when adjusting an actor's size/position
in response.
2011-01-25 21:32:20 +01:00
Owen W. Taylor
4f079affea Fix set but not used variables
GCC 4.6 warns about variables that are set but never subsequently
used; fix all such instances.

https://bugzilla.gnome.org/show_bug.cgi?id=640469
2011-01-24 16:26:57 -05:00
Adel Gadllah
8181454af5 MetaWindowActor: Add meta_window_actor_is_destroyed
Add a meta_window_actor_is_destroyed method which gets
whether the X window that the actor was displaying has been destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=639853
2011-01-18 19:35:41 +01:00
Jasper St. Pierre
7e53094044 default plugin: Clean up unused n_workspaces variable.
n_workspaces is unused, which may cause compilation
errors under certain environments.

https://bugzilla.gnome.org/show_bug.cgi?id=639458
2011-01-16 13:54:31 -05:00
Andreas Mueller
d3df33ecdb Fix errors building for gles-systems (clutter-eglx)
* GL_TEXTURE_RECTANGLE_ARB not avaliable
* clutter_glx_texture_pixmap_using_extension / CLUTTER_GLX_TEXTURE_PIXMAP not avaliable

Signed-off-by: Andreas Mueller <schnitzeltony@gmx.de>
2011-01-04 11:27:16 -05:00
Owen W. Taylor
3f9c375f1c MetaRegionIterator: avoid reading off end of rectangles array
Fix an off-by-one error in the check for "can we peek ahead to the next
rectangle".

https://bugzilla.gnome.org/show_bug.cgi?id=636491
2010-12-06 12:00:30 -05:00
Dan Williams
5397335ae8 Fix builds with clutter < 1.5.2 2010-11-22 22:00:02 -06:00
Adel Gadllah
1394c566eb [MetaWindowActor] Fix crash in shadow shape creation
Protect against shape_region or bounding_region being NULL in check_needs_shadow.

This can happen for short lived windows and result into a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=635421
2010-11-21 19:57:42 +01:00
Owen W. Taylor
8817e68926 Use COGL_MATERIAL_WRAP_MODE_* defines not COGL_PIPELINE_*
Since we aren't depending on Clutter 1.5 or using the new
CoglPipeline name elsewhere, we need to stick to the old
COGL_MATERIAL_WRAP_MODE_* names, which are provided with
compatibility defines in Clutter 1.4.

Pointed out by Rico Tzschichholz
2010-11-19 14:41:44 -05:00
Owen W. Taylor
6260814285 Turn off background repeats for a full-size image
If we have repeats on for a full-sized image, then if the background
is displayed scaled (for example, in a desktop preview mode) then we
can get artifacts along the edge of the background where the repeat
of the opposite edge is blended in by bilinear scaling. So turn off
repeats when the screen and background image sizes match.

https://bugzilla.gnome.org/show_bug.cgi?id=634833
2010-11-18 13:58:37 -05:00
Owen W. Taylor
07e6c5aac2 Draw the root window background
Add code to track and draw the root window background. The advantage of doing
it here as compared to in a plugin is that we can use the visiblity smarts
of MetaWindowGroup to optimize out drawing the background when obscured.

If handling other than tracking the _XROOTPMAP_ID property is desired in the
future, more functionality like setting the background from a file or doing
cross-fades can be added.

The new background actor is exposed to plugins via meta_plugin_get_background_actor()
similar to other exposed actors to allow cloning the background for use in
other displays. The actual class is not installed for public consumption at
the moment since it has no useful methods.

https://bugzilla.gnome.org/show_bug.cgi?id=634833
2010-11-18 13:58:37 -05:00
Owen W. Taylor
0477a3066d Refactor "texture material" creation from MetaShadowFactory
Create new cogl-utils.[ch] and move a helper function from
MetaShadowFactory there as meta_create_texture_material(); this
allows us to create single-layer materials from different parts of
Mutter and have them share the same template material.

Also expose a function for creating a 1x1 texture of a given
color meta_create_color_texture_4ub().

https://bugzilla.gnome.org/show_bug.cgi?id=634833
2010-11-18 13:58:37 -05:00
Owen W. Taylor
59639909b1 MetaWindowGroup: further optimize paints by using current scissor
When in a partial stage paint, we can combine that with the visibility
information in MetaWindowGroup to further eliminate unneeded drawing.

Since there is no current Clutter API to access the current clip,
drop to using GL directly.

https://bugzilla.gnome.org/show_bug.cgi?id=634779
2010-11-18 13:58:36 -05:00
Adel Gadllah
64c37852b1 meta-actor-window: Use G_UNLIKELY for TFP check
This is just a microptimization, as we pretty much always use
TFP (and do the check every time we set a pixmap),
we can let gcc generate better code here.

https://bugzilla.gnome.org/show_bug.cgi?id=633002
2010-11-18 18:51:04 +01:00
Owen W. Taylor
bac668d287 Optimize out restacks that don't change actor order
For various reasons (mostly the stack tracker correctly predicting the
stacking order before getting events, but also because of the processing
that the compositor does to get the actor stacking order) the compositor
can be told to sync the stack when it has nothing to do. Detect this
at the last moment before actually telling Clutter to restack to avoid
triggering unnecessary redraws.

https://bugzilla.gnome.org/show_bug.cgi?id=634771
2010-11-18 10:07:38 -05:00
Owen W. Taylor
8b24711bba Omit shadows for fullscreen and maximized windows
Fullscreen and maximized windows never have visible shadows - the only
case where we would ever see them is if they bleed onto an adjacent
monitor and that looks bad.

It's small performance win to avoid computing them, and this also avoids
painting the top shadow for all maximized windows in GNOME Shell - since
the top panel isn't a X window, it doesn't factor into the computation
of what parts of windows are visible and maximized windows are computed
as having a top shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00
Owen W. Taylor
ca5f2ac3ec Implement more accurate clipping of obscured shadows
Instead of making optimizing obscured shadows an all-or-none operation,
pass the clip region to meta_shadow_paint() and only paint the 9-slices
that are at least partially visible.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00