Commit Graph

2038 Commits

Author SHA1 Message Date
Benjamin Otte
afd3b96e2e Simplify code: Use cairo_paint() to paint the whole pixmap
Also, gdk_drawable_get_size() is going away soon

https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:54:14 +02:00
Benjamin Otte
b79e6c0b3e Remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:54:14 +02:00
Benjamin Otte
c6f8ad24bd Remove MetaArea widget
It's unused.

https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:54:14 +02:00
Benjamin Otte
d4d05e496a Remove meta_ui_get_pixbuf_from_pixmap() function
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:54:14 +02:00
Benjamin Otte
0a88329526 Move begin_paint() handling to expose handler
This way, we can remove the special casing in
meta_frames_paint_to_drawable().
Since the setup in meta_frames_paint_to_drawable() is relatively cheap,
doing it once per rectangle in the expose area should be fine.

https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:54:00 +02:00
Benjamin Otte
b4344b5ab5 Remove NULL checks in meta_frame_layout_get_borders()
This function actually handles NULL. (And I'm going to pass some NULLs
soon).

https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:31:02 +02:00
Benjamin Otte
4ac836fde4 Remove client area from region in expose event
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:31:02 +02:00
Benjamin Otte
7897448a5b frames.c: Remove workaround now that clip_to_screen() works properly
This code seems to be basically broken. It looks like it tried to clip
the expose area to the screen, but used screen coordinates for the
screen area but frame coordinates for the frame area. So someone tried
to work around this by adding a border around the screen, which made the
broken clipping work most of the time (see bugs below for examples where
it didn't).
Anyway, all of this is gone now.

https://bugzilla.gnome.org/show_bug.cgi?id=399529
https://bugzilla.redhat.com/show_bug.cgi?id=557402
https://bugzilla.gnome.org/show_bug.cgi?id=538438
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:31:01 +02:00
Benjamin Otte
94f4011844 frames.c: Make clip_to_screen() actually clip to the screen
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:31:01 +02:00
Benjamin Otte
3f8e6020f7 ui: Clip the region once, not every rectangle manually
https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-23 12:31:01 +02:00
Florian Müllner
beb65f011d tile-preview: Fix crash when falling back to default style
gtk_rc_get_style_by_paths() returns NULL if no matching style was
found and the default style should be used. Actually use the default
style in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=630003
2010-09-22 00:11:14 +02:00
Owen W. Taylor
c2f894963a Use GDK error trapping straight-up
The hacks we were playing by calling gdk_error_trap_push() and then
resetting the error handler are incompatible with the rewrite of
GDK error traps.

Since the new error code has some features that simplify what we
are doing (like automatically figuring out whether a XSync() is needed)
and because our custom error handler didn't have a lot of a point,
use a separate code path for GTK+ 3.0 builds that just uses the
GDK error traps straight-up without a custom error handler.

https://bugzilla.gnome.org/show_bug.cgi?id=630195
2010-09-20 18:41:21 -04:00
Nickolas Lloyd
dacea8edf9 Fix behavior of the window resize popup to only appear when resizing
This patch reverts part of commit 94f6479, which accidentally removed
a section of code and introduced this bug.

https://bugzilla.gnome.org/show_bug.cgi?id=598603
2010-09-20 11:14:45 -04:00
Adel Gadllah
3fed2ab64d [mutter-shaped-texture] Use a base material for all instances
Use a base material for all textures rather than recreating it for every instance,
this should allow Cogl to optimize the program generation.

Idea 'stolen' from:

http://git.clutter-project.org/clutter/commit/?id=7e56a98413817479d0501ce8af9fad3e6411104d

https://bugzilla.gnome.org/show_bug.cgi?id=629350
2010-09-19 16:17:36 +02:00
Owen W. Taylor
ed9d7f18a6 Avoid confusion when _NET_WM_USER_TIME_WINDOW is in the window stack
Wine sets _NET_WM_USER_TIME_WINDOW to point to an unmapped toplevel;
this was causing much confusion because both the real window and
the unmapped window were in the window stack and mapped back to the
same MetaWindow.

Debugged by Alban Browaeys
https://bugzilla.gnome.org/show_bug.cgi?id=593887
2010-09-17 14:23:33 -04:00
Florian Müllner
97e2b4666b Implement side-by-side tiling
When dragging a window over a screen edge and dropping it there,
maximize it vertically and scale it horizontally to cover the
corresponding half of the current monitor.

Whenever a "hot area" which triggers this behavior is entered, an
indication of window's target size is displayed after a short delay
to avoid distraction when moving a window between monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=606260
2010-09-17 16:00:03 +02:00
Florian Müllner
7d8cc4f940 Fix build error introduced in the last commit 2010-09-15 03:15:46 +02:00
Florian Müllner
ee2f995fc7 introspection: Fix annotations
The scanner got stricter again - some annotations need fixing.
2010-09-15 02:31:47 +02:00
Maxim Ermilov
66105c6e7e Optionally attach modal dialogs
Add a preference /apps/mutter/general/attach_modal_dialogs. When true, instead
of having independent titlebars, modal dialogs appear attached to the titlebar
of the parent window and are moved together with the parent window.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
2010-09-11 05:36:12 +04:00
Maxim Ermilov
bb1ab0afd9 Lower a window and all its transients as a unit
It's strange to leave transients windows around, after ancestor window was
lowered and unfocused.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
2010-09-11 05:36:02 +04:00
Jasper St. Pierre
0d51d9e4cf Remove usage of 'gdk_display', a removed symbol in gtk3.
https://bugzilla.gnome.org/show_bug.cgi?id=629232
2010-09-10 15:18:06 -04:00
Colin Walters
e3789e31ef introspection: Remove workaround MetaMutter comment
The scanner should understand this better now.
2010-09-09 11:45:08 -04:00
Florian Müllner
8a6b583cdc Adjust for API break in gdkkeysyms.h
The key symbols were renamed to avoid namespace conflicts with
gobject-introspection.
2010-09-09 17:37:48 +02:00
Colin Walters
4c0763792d introspection: Build with --warn-fatal, drop fix-meta-rectangle.py hack
Cleanly build with --warn-fatal.  Implementation:

* Liberally apply (skip) where the API is clearly C only, e.g. uses
  XLib.  The theming code and MutterPlugin are skipped too.
* Add missing (transfer) and (element-type) annotations

For a few functions that had a comment, I turned it into gtk-doc, but
I didn't (with a few exceptions) try to write new documentation in
this pass.
2010-09-07 10:48:07 -04:00
Colin Walters
77a5e817a5 introspection: Use new --accept-unprefixed
Also depend on an introspection version which has this.
2010-09-01 13:20:39 -04:00
Colin Walters
47fcb998f5 introspection: Enable warnings
Also depend on Makefile to ensure we rerun on build changes.
2010-08-31 19:50:43 -04:00
Rob Staudinger
1024eae742 Really install region.h as private header
Libmutter-private's preview-widget.h depends on region.h, so that one
needs to be installed as well in order to keep dependees build.

Signed-off-by: Tomas Frydrych <tf@linux.intel.com>
2010-08-27 10:59:21 +01:00
Tomas Frydrych
dad1f01c5b Fixed incorrect location of regin.h in the previous commit
region.h lives in include, not ui
2010-08-27 10:06:37 +01:00
Tomas Frydrych
ce53f35974 Added region.h to installed headers
region.h is explicictely included by the installed preview-widget.h
2010-08-27 09:59:08 +01:00
Adel Gadllah
2a54baf60e Trap xerrors in mutter_window_pre_paint
XDamageSubstract can create a BadDamage
(when the window goes away before XDamageSubstract is called)
and thus resulting into a crash.

Fix it by protecting the call with an error trap.

https://bugzilla.gnome.org/show_bug.cgi?id=623235
2010-08-23 22:31:51 +02:00
Thierry Reding
4544fe7571 Fix build against gtk+ older than 2.21.6.
The gdk_window_get_background_pattern() function copied from GDK and
introduced in commit 0839c10 has a small syntax error and uses a private
API (_gdk_drawable_ref_cairo_surface()). This patch imports the missing
API and fixes the syntax error.

https://bugzilla.gnome.org/show_bug.cgi?id=626583
2010-08-23 11:11:50 +01:00
Tomas Frydrych
a125b0179a Do not cancel Alt+Tab grab due to modifier key events
If the user just presses a modifier (e.g., shift) during Alt+Tab grab, we need
to keep the grab in place to allow the custom Alt+Tab handler to deal with what
might simply be a change of tabbing direction.

https://bugzilla.gnome.org/show_bug.cgi?id=613126
2010-08-23 10:35:10 +01:00
Owen W. Taylor
8b34b4bd0b MutterShapedWindow: drop all indirect references to textures
We don't get correct notifications for the ::cogl-texture property of
ClutterTexture in the case when we are unsetting the pixmap before calling
XFreePixmap. (This is because ClutterX11TexturePixmap is a hack on top
of ClutterTexture and we're a hack on top of that.) So we need to manually
clear everything out.

For consistency we also make sure that we drop all references to dead
textures:

 - When the shape changes
 - If the window pixmap texture changes without first being cleared
   (this is not expected to happen)

https://bugzilla.gnome.org/show_bug.cgi?id=627210
2010-08-19 16:12:11 -04:00
Nickolas Lloyd
63f81ed027 Fix meta_window_set_user_time: assertion `!window->override_redirect' failed error messages
This patch adds a check in event_callback () to check whether the
window is override-redirect or not, and avoids unnecessarily calling
meta_window_set_user_time () if it is.

https://bugzilla.gnome.org/show_bug.cgi?id=606158
2010-08-18 17:22:01 -04:00
Owen W. Taylor
c9ebc0ea25 Always use mipmap emulation
Rather than trying to find out from Clutter whether mipmap generation
can be used together with texture_from_pixmap, just always assume
it can't and use the MutterTextureTower emulation code.

This fixes a problem with our previous hack for doing the query
no longer working. In the rare cases where mipmap generation
is supported, it is unlikely to produce significantly more efficient
or better looking results than the emulation. (In terms of efficiency,
we have better knowledge of when we need to update the lower mipmaps
and when we don't than CoglTexturePixmapX11.)

Some care is taken so mutter_shaped_texture_set_create_mipmaps() works
when changed on the fly and properly discards the old mipmap levels.
This isn't necesary currently, since it can only be controlled via
envvar, but is easier than future-proofing through documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=627087
2010-08-18 14:02:32 -04:00
Owen W. Taylor
15a214e435 Fix order of pixmap = None and XFreePixmap() in last commit
The last commit set MutterWindow->priv->back_pixmap to None before
calling XFreePixmap on it. Fix.
2010-08-17 19:07:49 -04:00
Owen W. Taylor
0b3327f04d Unset window pixmaps from MutterShapedWindow before freeing them
At least with the Mesa/DRI implementation of GLX, calling XFreePixmap()
on a pixmap before glxDestroyPixmap() on the corresponding GLX pixmap
causes an X error. To avoid triggering this with the new
ClutterTexturePixmapX11 code, we need to move our XFreePixmap after
unsetting the pixmap from the actor.

https://bugzilla.gnome.org/show_bug.cgi?id=627210
2010-08-17 18:42:02 -04:00
Florian Müllner
0839c100c0 Use gdk_window_get_background_pattern() to clear the background
gdk_window_get_back_pixmap() and gdk_window_get_background() have
been removed/deprecated. Use gdk_window_get_background_pattern()
as replacement.

https://bugzilla.gnome.org/show_bug.cgi?id=626583
2010-08-17 20:57:47 +02:00
Florian Müllner
08cfdcd802 Replace GDK drawing API with cairo
The GDK drawing API was deprecated/removed.

https://bugzilla.gnome.org/show_bug.cgi?id=626583
2010-08-17 20:42:05 +02:00
Adel Gadllah
a1bb3835cc [mutter-shaped-texture] Remove material_workaround
It is no longer needed as the workaround has been removed in
452025e984,
but the material is still around and unused.

https://bugzilla.gnome.org/show_bug.cgi?id=625712
2010-08-16 23:06:46 +02:00
Owen W. Taylor
e590cd2b99 Don't screw up the event mask when "managing" our own windows
When we do pseudo-management on an override-redirect window, we have to be
careful to augment the existing event mask, not replace it, or
delivery of pointer events will be disrupted.

When we unmanage a window, we shouldn't try to unselect events at all,
since that will interfere with event selection done by GDK.

http://bugzilla.gnome.org/show_bug.cgi?id=597763
2010-08-09 12:57:57 -04:00
Adel Gadllah
ce1ffa4624 Check for TFP usage after actually setting the pixmap
Starting with clutter 1.4 clutter / cogl only knows whether TFP is in use after
setting the pixmap, so doing the check before setting the pixmap will just
lead to a wrong message.

https://bugzilla.gnome.org/show_bug.cgi?id=624757
2010-07-30 16:16:55 +02:00
Andreas Mueller
2b84afc1e3 src/core/util.c: Fix warning in case WITH_VERBOSE_MODE is not set
Signed-off-by: Andreas Mueller <schnitzeltony@gmx.de>

https://bugzilla.gnome.org/show_bug.cgi?id=624166
2010-07-12 11:07:26 -04:00
Florian Müllner
adbe3a2312 Fix gtk+ dependency in libmutter-private pkg-config file 2010-07-09 18:05:02 +02:00
Owen W. Taylor
7853bb8042 Work around g-ir-scanner problem with Gdk.Rectangle
g-ir-scanner is currently buggy and confuses the Gdk.Rectangle alias
with MetaRectangle. Since this is moderately hard to fix in
gobject-introspection and the fix would conflict with in-progress
changes, work around by doing a 'sed job' on the generated Meta.gir.

https://bugzilla.gnome.org/show_bug.cgi?id=623639
2010-07-06 15:11:13 -04:00
Owen W. Taylor
11a8ab47fa Make MetaRectangle a boxed type
Export a boxed type for MetaRectangle; this is mostly of interest
because GdkRectangle has been turned into a typedef for
cairo_rectangle_int_t which causes massive problems for using it from
gobject-introspection based language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=623335
2010-07-02 13:14:39 -04:00
Florian Müllner
7feeb72721 Use cairo_region_t when building with gtk+-3.0
GdkRegion has been removed from Gtk+. The replacement is a
yet-unreleased cairo API, so use it only when building with
Gtk+-3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=587991
2010-07-02 04:36:28 +02:00
Florian Müllner
01447d94d1 Allow building with Gtk+-3.0
Add a configure switch to select the Gtk+ version to build with. The
default is to build against Gtk+-2.0 >= 2.18.

https://bugzilla.gnome.org/show_bug.cgi?id=622303
2010-07-02 04:36:27 +02:00
Florian Müllner
e267a63330 Add compatibility with GTK+ 2.18
In order to replace calls to deprecated GDK code, the current
development version of GTK+ is required. Add some basic compatibility
code to allow building mutter with GTK+ 2.18.

https://bugzilla.gnome.org/show_bug.cgi?id=587991
2010-07-01 20:55:12 +02:00
Florian Müllner
c65a24486d Replace deprecated GDK symbols
The fix depends on new API added in this cycle, so the required
GTK+ version is bumped to 2.21.1.

https://bugzilla.gnome.org/show_bug.cgi?id=587991
2010-07-01 20:55:11 +02:00