1
0
Fork 0
Commit graph

2407 commits

Author SHA1 Message Date
Dan Winship
d2b63eaf1f fix a crash-on-exit
meta_frames_destroy() was not safe to be called multiple times, which
was causing a crash on exit due to something else changing somewhere
that makes it get called multiple times.

https://bugzilla.gnome.org/show_bug.cgi?id=654489
2011-07-12 13:53:19 -04: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
Florian Müllner
4a10c95e76 core: Replace lower_beneath_focus_window()
The code assumed that the focus window was always the one at the
top of the window stack, which is not true if an unfocused window
has the above hint set.

Rather than fixing this assumption, rename the function to
lower_beneath_grab_window() and use the display's grab window - the
function is only used for displaying the tile previews, which means
that we want the grab window anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=650661
2011-07-09 01:08:58 +02:00
Florian Müllner
54b2fab849 theme: Allow using custom colors from the GTK+ theme
Add an additional color type to pick up colors defined with
@define-color in the GTK+ theme's CSS:

  gtk:custom(name,fallback)

(where "name" refers to the name defined in GTK+'s CSS, and fallback
refers to an alternative color spec which is used when the color
referenced by "name" is not found)

The main intent of the change is to allow designers to improve
Adwaita's dark theme variant without having to compromise on colors
which work in the light variant as well.

https://bugzilla.gnome.org/show_bug.cgi?id=648709
2011-07-08 22:40:43 +02:00
Thierry Reding
8033184134 Fix out-of-tree build.
This patch fixes an issue encountered when building mutter
out-of-tree:

  * When generating mutter-enum-types.[ch], the glib-mkenums command is
    executed from $(srcdir), so it is wrong to prepend $(srcdir) to the
    template file.

https://bugzilla.gnome.org/show_bug.cgi?id=624910
2011-07-08 16:33:12 -04:00
Florian Müllner
d95da2dfbe theme: Port from GtkStateType to GtkStateFlags
We now use GtkStyleContext exclusively, so it's a bit weird to store
widget state as GtkStateType and translate it always to GtkStateFlags.
Just use GtkStateFlags instead of GtkStateType.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
03457029f7 draw-workspace: Update to current GTK style API
Move from GtkStyle to GtkStyleContext.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
f8d900c3ea theme: Add helper functions for light/dark colors
GtkStyleContext no longer has dark/light colors GtkStyle used to
have. We already have compatibility code for them in theme.c, so
add two helper functions to make it available outside theme.c.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
e16beba111 mutter-window-demo: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:54 +02:00
Florian Müllner
60ee25d8d5 theme-viewer: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:54 +02:00
Florian Müllner
ce1369609f theme: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 01:29:54 +02:00
Florian Müllner
8199699e7c gradient: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.
It might be worth considering using cairo patterns for the gradients
rather than using custom code to render gradients to a pixbuf which
is then drawn with cairo, but for now this is just a straight port
of the existing code.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 01:29:54 +02:00
Dan Winship
48cabd1364 window: fix appears-focused propagation with attached grandchildren
When detaching/attaching a dialog, we were only updating
appears-focused on the parent if the child itself was focused, but in
fact, we need to do it if the child has an attached child which is
focused too.

To simplify the case of detaching a focused subtree from its parent,
we change meta_window_propagate_focus_appearance() to use
@window->display->focus_window as the window to add/remove as the
attached_focus_window, and @window only as the starting point to
propagate from. That way we can propagate focus-removal up to
@window's (soon-to-be-ex-)ancestors without having to remove it from
its descendants as well.

https://bugzilla.gnome.org/show_bug.cgi?id=647712
2011-07-07 16:51:36 -04:00
Dan Winship
6dc79ce60a reload_transient_for: avoid xtransient_for loops
Don't set a window's xtransient_for if it would create a loop. Since
this is the only place we ever set xtransient_for, we can therefore
assume everywhere else that it does not loop.

https://bugzilla.gnome.org/show_bug.cgi?id=647712
2011-07-07 16:51:36 -04:00
Owen W. Taylor
b5f277bd7b Freeze api_version to 3.0
Back the API version down to 3.0; since we don't make any stability
guarantees, there's no reason to have a merry-go-round of different
directories and filenames that people have to keep up with.
2011-07-01 19:19:11 -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
Jasper St. Pierre
d752096cdf Fix XShape
Commit c3a04bf unintentionally broke XShape handling. By studying the code
extremely carefully, I found this inconsistency with the code that was
there before.

https://bugzilla.gnome.org/show_bug.cgi?id=635268
2011-06-29 16:07:34 -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
Florian Müllner
b533ad2669 core: Remove META_CORE_IS_TITLEBAR_ONSCREEN
The functionality is no longer needed outside of core/, so remove
the getter.

https://bugzilla.gnome.org/show_bug.cgi?id=652369
2011-06-15 21:34:04 +02:00
Florian Müllner
526bc34bba frames: Always start grab operation on left click
When left-clicking the frame border with the titlebar being
off-screen, rather than starting the expected grab operation the
window menu was popped up.
This behavior is pretty confusing, especially since the menu button
was removed from the default layout, making right-clicking the only
way to get to the window menu.

https://bugzilla.gnome.org/show_bug.cgi?id=652369
2011-06-15 21:34:04 +02:00
Dan Winship
c70087db0c meta_quit: ignore repeated calls after it's already quitting
meta_run() calls meta_finalize() after the main loop exits, which ends
up calling meta_display_close(), which calls
meta_quit(META_EXIT_SUCCESS), meaning that any exit status passed to
the original meta_quit() call is lost.

Fix this by ignoring meta_quit() calls after the main loop is no
longer running.

https://bugzilla.gnome.org/show_bug.cgi?id=652010
2011-06-06 16:22:39 -04:00
Florian Müllner
4257b8deff window: Expose minimized state as property
Track the minimized state in a property, so that we can receive
change notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=651568
2011-05-31 21:20:42 +02:00
Adam Jackson
05662b678e Fix crash in meta_display_get_above_tab_keycode
https://bugzilla.gnome.org/show_bug.cgi?id=647777
2011-05-25 14:20:06 -04:00
Jasper St. Pierre
64f37a3769 window: Add wm-class property and notify it when changed.
https://bugzilla.gnome.org/show_bug.cgi?id=649315
2011-05-25 12:10:03 -04:00
Florian Müllner
7577437167 ui-frames: Delay attaching the style to new frames
Like the setting of new frames' background is delayed until the
frame is associated with its window, delay attaching the initial
style, so that the correct style variant is picked.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
be6775767c core: Update frame style when _GTK_THEME_VARIANT changes
When the _GTK_THEME_VARIANT property changes, rather than just
updating the window's theme_variant property, update its frame
style as well, so that the window decoration reflects the requested
variant. As the initial properties of a window may be read before
its frame is created, there will be cases where the change is not
picked up initially.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
0d9a9b8d3b theme: Do not create temporary GtkStyle objects
In order to pick up colors from a GtkStyleContext, a temporary
GtkStyle object was created from the context and destroyed after
copying the requested GdkColor. This is slightly inefficient, so
get the appropriate GdkRGBA from the context and translate it to
a GdkColor, based on the compatibility code in gtkstyle.c.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
4affd22817 ui-frame: Add support for style variants
Rather than sharing a single style context between all frames, use
a default style and one style per encountered variant (as determined
by the _GTK_THEME_VARIANT property), so that colors from the GTK+ style
are picked from the correct theme variant.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
eb17cd9ba9 ui: Add meta_ui_update_frame_style()
This method allows forcing a style update of a particular frame
from the core, so that it can pick up style variants.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
0cdac78bd5 core: Allow retrieving the theme variant via core_get()
To associate frames with the correct style variant, the UI will
need access to the window's theme variant property.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
4f3b03e13b window: Parse _GTK_THEME_VARIANT property
Since version 3.0, GTK+ has support for style variants. At the moment,
themes may provide a dark variant, which can be requested by
applications via GtkSettings. The requested variant is exported to
X11 via the _GTK_THEME_VARIANT property - support this property, in
order to pick up the correct style variant in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
da4486b833 theme: Get GTK+ colors from style context
Rather than using a single widget's style for GTK+ colors in themes,
use the style context parameter of the drawing functions for those
colors. Right now, a single style context is shared between frames,
but this will change to support different style variants.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:22 +02:00
Florian Müllner
37aeb5baf1 frame: Delay updating the background until the frame is ready
To determine the correct background style, the UI needs to access
some frame properties via meta_core_get(); this call will bail out
early if window->frame is unset, so delay the call until the
association is made.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:22 +02:00
Florian Müllner
a2cb38b382 tile-preview: Use gdk_cairo_set_source_rgba()
gdk_cairo_set_source_rgba() is a convenience function which was
added to GTK+-3.0 after the port to GtkStyleContext, so we ended
up using cairo_set_source_rgba() instead. Save a couple of lines ...
2011-05-18 23:07:22 +02:00
Owen W. Taylor
c573523c4d Filter mirrored monitors from the monitors list
For the purposes of window placement or arranging window manager or
plugin controls, screens that are just mirrors of other screens should
be ignored, so filter them out of the monitors list.

https://bugzilla.gnome.org/show_bug.cgi?id=649299
2011-05-18 13:00:11 -04:00
Dan Winship
64e6b77dc3 window: don't allow side-by-side tiling of non-maximizable windows
If a window is not maximizable, then that probably means it looks dumb
at very large sizes. Even if its hints would allow you to manually
resize it to a large size, don't allow automatically tiling it to half
the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=647901
2011-05-16 10:16:12 -04:00
Colin Walters
d0414a3ea6 theme.c: Squash memory leak
When converting a token to a different type, we need to free its
string.

https://bugzilla.gnome.org/show_bug.cgi?id=649500
2011-05-11 14:15:48 -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
89dbef9eb3 Fix crash with non-responding application with no title
If a window had no title property set, then the
application-not-responding dialog would cause Mutter to crash
because window->title was NULL; handle that case and use the
string "Application is not responding."

https://bugzilla.gnome.org/show_bug.cgi?id=649114
2011-05-03 11:01:05 -04:00
Owen W. Taylor
60dd31ed48 Fix escaping for application-not-responding dialog
We need to escape markup in the title, or a title "<i>Italic</i>"
will be displayed as italic.

https://bugzilla.gnome.org/show_bug.cgi?id=649114
2011-05-03 11:01:05 -04:00
Owen W. Taylor
40f51114b5 meta_show_dialog: fix encoding of command line arguments
Command line arguments are supposed to be in the locale encoding,
not UTF-8, and Zenity decodes command line string command line
arguments with this assumption using GOption.

There was a half-hearted attempt to deal with this in delete.c,
but it wasn't correct since it immediately mixed the window title,
converted to the locale encoding with a UTF-8 message.

https://bugzilla.gnome.org/show_bug.cgi?id=649114
2011-05-03 11:01:05 -04:00
Dan Winship
d9007a08c9 Don't call textdomain()
As a library, libmutter should not be setting the default translation
domain to point to itself.

Also, move the bindtextdomain() call earlier
(meta_get_option_context), so that translations of command-line
options will be available.

We could call textdomain() in mutter.c, but there's no need to, since
mutter uses dgettext() everywhere anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=649202
2011-05-02 14:37:47 -04:00
Matthias Clasen
c248c57b6e Make session saving work a bit better
Previously, the restart command hardcoded "mutter" as the binary name.
This commit changes it to use g_get_prgname() which has a better chance
of being correct (and it does fix session saving for gnome-shell).

Now that mutter is a library, it might be more correct (but also
much higher overhead) to add api for setting these things from
the outside.

https://bugzilla.gnome.org/show_bug.cgi?id=648828
2011-04-29 07:23:30 -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
c3a04bf394 Convert frame region handling to cairo regions
It's useful to get frame shapes and manipulate them within Mutter, for
example so that the compositor can use them to clip drawing.
For this, we'll need the regions as cairo regions not X regions, so
convert frame shaping code to work in terms of cairo_region_t.

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
Florian Müllner
3543782f39 edge-tiling: Fix cancelling maximize tiling
If a window can not be tiled, e.g. due to its minimum size hints,
dragging away from the top after activating the maximize tile preview
does not cancel the maximization request, the only way to do so is by
hitting Escape.
To fix, reset the tiling state in the maximize-tile code path as
well if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=646149
2011-04-25 23:12:05 +02:00
Colin Walters
4ff4ebebb6 meta_window_is_remote: If WM_CLIENT_MACHINE not set, don't assume remote
Apparently the "fox" toolkit doesn't set WM_CLIENT_MACHINE; while we
could do gymnastics to attempt to figure this out (talk to the X
server?), better to just default to FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=647662
2011-04-25 16:43:09 -04:00
Dan Winship
eb0e658c99 window: fix a case of appears-focused getting stuck
Since appears-focus only propagates up from modal dialogs, if an
application removed the modal hint from a dialog before destroying it,
then its parent would be left with a stray reference to it in
attached_focus_window, causing it to be permanently appears-focused.

The obvious fix, calling meta_window_propagate_focus_appearance() when
the modal hint is removed, tends to cause noticeable flashing, because
the window will get drawn unfocused and then focused again.

So instead we just change meta_window_propagate_focus_appearance() to
check the window type only when focusing in, not when focusing out.

This would also cause flashing, but in this case we can avoid it by
not notifying the change in appears-focus on the parent window if it
is the expected_focus_window (which it will be by this point). (This
does mean though that if something weird happens and the window
doesn't end up becoming the focus window, it won't get redrawn
unfocused until something else forces it to.)

https://bugzilla.gnome.org/show_bug.cgi?id=647613
2011-04-20 14:40:47 -04:00
Dan Winship
7503d4812c window: don't crash on spurious calls to idle_calc_showing()
If idle_calc_showing() gets called when its queue is empty (which
shouldn't happen), just return rather than crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=642957
2011-04-02 07:34:39 -04:00
Alexander Larsson
634b76b82c Don't move all window to active workspace if monitors change
https://bugzilla.gnome.org/show_bug.cgi?id=645408
2011-03-28 18:19:25 -04:00
Jasper St. Pierre
a3ea43da52 display: Fix crash with cycle_group
Commit e3ebcc004d introduced an unsafe
access for 'window', which could cause a segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=645843
2011-03-28 17:38:07 -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
Colin Walters
c13e62f72c Export meta_get_replace_current_wm()
This is necessary for gnome-shell to know whether it should try to
replace the org.gnome.Shell DBus name.

Note: We can't just #include <meta/util.h> because it #defines '_'
at least which obviously conflicts with core gettext.  We should
un-export util.h or fix it.

https://bugzilla.gnome.org/show_bug.cgi?id=645590
2011-03-23 16:08:51 -04:00
Florian Müllner
92e317ec2a Adjust the position of attached dialogs to fit on-screen
As the position of attached modal dialogs is determined entirely
by the position of the parent window, the dialog may end up
partially off-screen (especially if the dialog is wider than the
parent). In this case, diverge from the calculated position and
try to fit the dialog on-screen.

https://bugzilla.gnome.org/show_bug.cgi?id=631308
2011-03-22 02:56:51 +01:00
Florian Müllner
c5d1d2db62 Add and export meta_window_move_to_monitor
This is useful for DnD to another monitor in gnome-shell.
In addition to a normal move it corrects the saved rect for
maximized and fullscreened windows.

https://bugzilla.gnome.org/show_bug.cgi?id=645032
2011-03-22 00:55:37 +01:00
Florian Müllner
5500c2b3a8 window: Allow resizing of attached modal dialogs
Currently attached modal dialogs are not resizable, but we don't
communicate this to GTK+, so the dialog may end up with resize
grips anyway. As a fix, allow resizing, but account for the dialog
being centered to its parent.

https://bugzilla.gnome.org/show_bug.cgi?id=643597
2011-03-22 00:27:10 +01:00
Owen W. Taylor
82db52aaf4 iconcache: don't crash on a non-alpha mask pixmap
We assume when applying a mask that it is a depth-1 pixmap that
cairo interprets as alpha. So ignore a non-depth-1 mask.

https://bugzilla.gnome.org/show_bug.cgi?id=641975
2011-03-21 18:51:14 -04:00
Owen W. Taylor
654d966e6c iconcache: Correctly interpret monochrome icons
Getting the contents of a depth-1 pixmap through cairo gives us
an alpha pixmap. We need to convert to a monochrome pixmap
as is expected by the ICCCM definition of WM_HINTS.

https://bugzilla.gnome.org/show_bug.cgi?id=641975
2011-03-21 18:47:52 -04:00
Jasper St. Pierre
92663c81f5 iconcache: Fix apply_mask
apply_mask made some wrong assumptions that became untrue
after rendering_cleanup landed, such as the number of channels
in the pixmap, causing corruption.

https://bugzilla.gnome.org/show_bug.cgi?id=641975
2011-03-21 18:15:47 -04:00
Ron
e3ebcc004d display: Grab attached dialogs' parent
Currently, attached modal dialog can be grabbed (either by the
title bar, or using Alt+Button1), though they won't move when
dragged. To address this, grab the parent in that case, which
allows to move both the parent and the attached dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=638674
2011-03-21 22:46:23 +01:00
Florian Müllner
26e41bc24a tiling: Fix dragging windows free from edge-tiling
Commit 96c43866 changed the tiling behavior to prefer edge tiling
over maximization in corner cases (well, quite literally). As a
side effect, it only allows untiling of edge-tiled windows by
dragging the window towards the correct edge.
This patch restores the old behavior for untiling, while keeping
the new behavior for untiled windows.

https://bugzilla.gnome.org/show_bug.cgi?id=645455
2011-03-21 22:00:54 +01:00
Florian Müllner
c9e9412540 window: Remove unnecessary checks
For tiling, we check whether the pointer is near the edges of
the monitor where the pointer is located, so checking that the
pointer is within the bounds of the monitor is unnecessary and
confusing.
2011-03-21 22:00:54 +01:00
Owen W. Taylor
83b6ec7899 Fix description for workspaces_only_on_primary key
The description was a bit corrupted and didn't make sense. Fix.

https://bugzilla.gnome.org/show_bug.cgi?id=645224
2011-03-21 15:30:28 -04:00
Giovanni Campagna
9fad2246ae Fix previous commit
It is actually caller-allocates, not callee (the object is provided
by the binding, not by the function)
2011-03-19 20:56:18 +01:00
Giovanni Campagna
585da56118 Add introspection annotations for (out) arguments.
Mark that the the third argument to meta_rectangle_union and
meta_rectangle_intersect is an (out) argument that should be created
by the language binding.

https://bugzilla.gnome.org/show_bug.cgi?id=645247
2011-03-19 20:21:35 +01:00
Owen W. Taylor
96c43866b1 Make entire side of screen edge-tiling not maximization
If dragging the title bar to the edge of the screen to side-tile,
it's easy to end up above the workarea and end up maximized instead.
Make the entire side of the screen act as edge-tiling.

https://bugzilla.gnome.org/show_bug.cgi?id=644961
2011-03-18 14:55:52 -04:00
Owen W. Taylor
9043191927 Add MUTTER_WM_CLASS_FILTER environment variable
In a performance or regression testing environment, we may want to
only manage windows from a particular test program, and ignore all
other windows. The MUTTER_WM_CLASS_FILTER environment variable is a
list of WM_CLASS values that should be managed; other windows will
be unmapped and ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=644252
2011-03-18 14:55:52 -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
Dan Winship
9f39a18fc5 Update meta_show_dialog for gtk's removal of --screen
gtk3 no longer has the --screen command-line argument, which mutter
was passing to zenity. Use --display (with an explicitly-specified
screen number) instead.

https://bugzilla.gnome.org/show_bug.cgi?id=643683
2011-03-18 13:53:53 -04:00
Colin Walters
3cd0e86bdd session: Don't set XSMP restart
This made sense back in the day of stateless window managers,
but gnome-shell isn't.  gnome-session will handle gnome-shell
crashing, since it's a required component.

https://bugzilla.gnome.org/show_bug.cgi?id=644529
2011-03-17 13:52:54 -04:00
Frédéric Péters
9dd642f4af Go with a single libmutter library
https://bugzilla.gnome.org/show_bug.cgi?id=644565
2011-03-17 15:31:53 +01:00
Alexander Larsson
637cce0f91 Only show workspace and stick/unstick in menu item for primary monitor
If workspaces_only_on_primary then it makes no sense to have these
menu items on the monitors where workspaces don't take any effect.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
74b97dcd14 Add signals for when windows change monitors
This is useful in order to track e.g. which windows are on the primary
monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
4e28a4d654 Add workspaces_only_on_primary preferences (default FALSE)
This adds a preference that when enabled makes all windows not on
the primary monitor be visible on all workspaces (i.e. not part of the
workspace switching handling).

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
9d62d13f88 Split out on_all_workspaces and on_all_workspaces_requested
Sometimes on_all_workspaces is requested by the client/user, and sometimes
its calculated implicitly due to internal state. We split this up so that
we know when the user has explicitly asked for sticky window, when e.g.
setting wmspec properties or storing session info.

on_all_workspaces means this window is visible on all workspaces.

on_all_workspaces_requested, means the user explicitly made the window
sticky somehow (via imported session, _NET_WM_STATE from another wm,
toggled in the window menu, etc). It always implies on_all_workspaces is
TRUE.

Right now the only time we set on_all_workspaces is for override-redirect
windows, but later we can add a "windows on non-primary monitor are not
part of the workspace switching" feature.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
eeca838778 Add meta_window_is_on_primary_monitor function
This is useful in a couple of places to avoid opencoding it.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
d6f0d2c64c Add API to get the monitor of a window
https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01:00
Alexander Larsson
44cfceba00 Track the monitor for each window
https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 13:48:54 +01: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
Alexander Larsson
f9b5cdfeb1 Add api to get the primary monitor of the screen
We don't actually use the full xrandr to get the primary monitor, we
just rely on the xrandr xinerama compat code to return the primary
monitor first. This lets us avoid adding unnecessary xrandr code and
avoids issues with _NET_WM_FULLSCREEN_MONITORS monitor indexes being
defined wrt xinerama monitor index order.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-16 20:28:33 +01:00
Alexander Larsson
0ff602be06 Add MetaScreen::monitors-changed signal
https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-16 10:31:31 +01:00
Jeffery Olson
70ffb564ff expose MetaWindow .move(), resize() and add/expose .move_frame()
The latter move method will place the window by the origin of the
enclosing window decoration/frame, while the former will place by the
origin of the inner window, itself.

(Also moved meta_window_showing_on_its_workspace comment into
 gtk-doc)

https://bugzilla.gnome.org/show_bug.cgi?id=642355
2011-03-09 13:49:54 -05:00
Dan Winship
6c4a283b4c Fix initial setting of _NET_WM_STATE on new windows
When reload_net_wm_state() is called at startup to read the initial
value of _NET_WM_STATE, it was calling recalc_window_type(), but not
recalc_features(), which meant that, eg, meta->skip_taskbar would
never get initialized from meta->wm_state_skip_taskbar, which meant
that next time mutter went to update the window's _NET_WM_STATE, it
would overwrite the app-specified initial values. Fix that.

(In metacity, this bug is masked by the fact that recalc_features()
gets called when reading the intial value of WM_NORMAL_HINTS, which
comes after _NET_WM_STATE in metacity's prop_hooks_table. In mutter,
the table got reordered at some point, exposing the bug.)

https://bugzilla.gnome.org/show_bug.cgi?id=624360
2011-03-09 10:21:56 -05:00
Rico Tzschichholz
bbd98e7b86 Fix ld failure caused by several incomplete LDADD statements
https://bugzilla.gnome.org/show_bug.cgi?id=644188
2011-03-08 11:23:30 -05: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
28752718c5 Remove meta_restart() / "mutter-message restart"
meta_restart() was broken, in that it restarted mutter with what was
left of argv after GOption and Clutter had possibly modified it.
Rather than try to fix this, just remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
2011-03-07 18:03:43 -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
Dan Winship
a66ae4ad55 Use standard introspection configure/Makefile bits
This changes the introspection configure flag from
--with/--without-introspection to --enable/--disable-introspection,
and changes it so that trying to enable introspection when g-i is not
installed results in an error, rather than being silently ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=643959
2011-03-06 13:04:58 -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
Jeff Olson
f75e96cd3c introspection: Annotate meta_window_get_rect()
g-ir-scanner assumes (transfer full) for boxeds, and doesn't
warn on missing annotations here.

https://bugzilla.gnome.org/show_bug.cgi?id=643194
2011-02-28 14:08:40 -05:00
Colin Walters
9bc1521615 Don't exit on XSMP request
It looks amazingly lame if we simply call exit() during logout.  While
it's true that for applications that use XSMP, gnome-session will
close them before us, that doesn't do anything for non-XSMP apps,
which we really hope is the common case.

Instead, we just go away when the X server does.

https://bugzilla.gnome.org/show_bug.cgi?id=643437
2011-02-28 14:01:08 -05: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
e7d336ab0e Don't pass handled key events to GTK+
If we handle a key event then passing it to GTK+ as well can only
cause confusion. Normally GTK+ would do nothing with a key event for
some window it doesn't know about, but plugins might be doing more
things with the GTK+ event queue.

https://bugzilla.gnome.org/show_bug.cgi?id=642426
2011-02-17 11:40:23 -05:00
Rui Matos
6e23b0af3b all-keybindings.h: change <Alt>Above_Tab from cycle_group to switch_group
and revert cycle_group back to <Alt>F6 as in GNOME 2.30

https://bugzilla.gnome.org/show_bug.cgi?id=639341
2011-02-15 13:34:32 -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
3716c30264 When live_hidden_previews is set, force placement for hidden windows
If we are previewing hidden windows, we might be previewing them in a context
like a thumbnail view of a workspace where we care about positioning. So, instead
of waiting until the window is first actually shown to place it, if
live_hidden_previews is set, place the window window when we first compute its
visibility, even if we don't end up showing it.

https://bugzilla.gnome.org/show_bug.cgi?id=641309
2011-02-02 19:19:50 -05:00
Owen W. Taylor
8b220079d0 Add ability to override workspace layout
A plugin that does workspace management on its on may want to set the
workspace layout without having to deal with putting a property
on the root window to be read back and parsed.

Add meta_screen_override_window_layout() that allows the same types
of layouts as _NET_DESKTOP_LAYOUT but without setting a property.

https://bugzilla.gnome.org/show_bug.cgi?id=640552
2011-02-01 11:34:56 -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
Owen W. Taylor
4c4c720dc1 Update _NET_CURRENT_DESKTOP on workspace removal
When we delete a workspace before the active workspace, we need
to upate the _NET_CURRENT_DESKTOP since the active workspace index
changes. To do this workspace.c:set_active_space_hint() is moved
to screen.c:meta_screen_set_active_workspace_hint() so that it
can be shared.

https://bugzilla.gnome.org/show_bug.cgi?id=640581
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
19d1f97600 Use G_GNUC_UNUSED to suppress warning
On gcc-4.4 (void)<expr> doesn't suppress warnings from
__attribute__((warn_unused_result)), so use
G_GNUC_UNUSED (which expands to __attribute__((unused))) instead
of removing a dummy variable.

https://bugzilla.gnome.org/show_bug.cgi?id=640508
2011-01-25 08:39:20 -05: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
Jasper St. Pierre
b4888103a6 display: Don't crash on Alt-Escape.
Fix a crash caused by 286160646b, where
we don't get a window when called from do_choose_window.

https://bugzilla.gnome.org/show_bug.cgi?id=640229
2011-01-24 19:38:55 +01:00
Florian Müllner
2eb8b09b1a Restore the original tile state when a drag is cancelled
If a drag operation is cancelled, the dragged window should be
restored to its previous state/position. Implement this for tiled
states.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
bca610ed50 Hide tile preview when cancelling a drag with Escape
As the tile preview is shown or hidden when a window is dragged
around, it may stick around if the drag operation is cancelled.
Make sure that the preview is hidden in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
53d6938b55 screen: Add a method to hide the tile preview unconditionally
Add meta_screen_tile_preview_hide() to hide the tile preview
independent from the tile state of the dragged window.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
286160646b display: Keep track of the original tile state during drag
Drag operations may be cancelled, in which case the dragged window
should be restored to the position/state it had when the drag was
initialized. In order to do this for tiled states, the original
state has to be saved during the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
58068260a5 window: Make meta_window_tile() semi-public
The previous tiling state of a grabbed window should be restored
if the drag operation is cancelled (by hitting the Escape key).
This might involve to meta_window_tile(), so export the function
in window-private.h.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01: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
Rui Matos
bbfc435a5c Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
https://bugzilla.gnome.org/show_bug.cgi?id=639532
2011-01-16 13:55:41 -05: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
Florian Müllner
565f002bc4 ui: Port to GtkStyleContext
GtkStyle has been deprecated in favor of GtkStyleContext. A full
port would involve replacing GdkColor with GdkRGBA - leave this
out for the time being.

Bump the required version of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=637761
2011-01-13 18:55:39 +01:00
Owen W. Taylor
4ea00e102b Add an "Above_Tab" pseudo-keysym
We want switching between the windows of an application to be an easily
accessible operation. The convenient and memorable keybinding is the
key above the tab key - but the keysym for that key isn't consistent
across different keyboard layouts.

Add code that figures out the key from the XKB geometry and a magic
keysym name "Above_Tab" that refers to this key and switch
the default binding for cycle_group to <Alt>Above_Tab. (This will
have no effect for the normal case of getting the key binding from
GConf until this patch is applied to Metacity as well.)

https://bugzilla.gnome.org/show_bug.cgi?id=635569
2011-01-05 18:58:11 -05:00
Florian Müllner
ed99d12e8b theme: Add tiled_left/tiled_right frame states
It may be desirable for theme authors to treat side-by-side tiled
windows differently, for instance to give the edge-touching border
a width of 0, so add additional frame states for tiled windows.

https://bugzilla.gnome.org/show_bug.cgi?id=637330
2011-01-05 01:49:58 +01:00
Florian Müllner
0a2bb1b71c theme: Add background functions for single buttons
With the existing background functions, single buttons can not be
styled separately - on the left side, the style of the left button
is picked, and the right button's style on the right side.

As theme authors may want to add rounded corners to button groups
as a whole, it makes sense to treat the case of a single button in
a group differently.

https://bugzilla.gnome.org/show_bug.cgi?id=635683
2011-01-05 01:49:49 +01:00
Florian Müllner
4bc8c70c75 theme-parser: Use peek_required_version() for validation
When validating button functions and frame styles, the required
format version of the features used in the theme was compared to
the major version number of the supported format, limiting additions
to major theme format bumps.
Use peek_required_version() instead, so the minor version number
of the supported theme format is taken into account.

https://bugzilla.gnome.org/show_bug.cgi?id=635683
2011-01-04 21:40:38 +01:00
Florian Müllner
9f2581318a buttons: Fix background functions for non-default layouts
While the configured layout is taken into account for positioning
the buttons, the mapping from button function states to button
position states just assumed the default button layout in LTR
locales.
Do a proper mapping depending on the actual layout instead.

https://bugzilla.gnome.org/show_bug.cgi?id=635686
2011-01-04 19:00:30 +01:00
Nickolas Lloyd
48b9807c86 Remove option to turn compositing off
This patch removes the ability to disable compositing in mutter.  As
clutter compositing was the reason for the fork from metacity, turning
compositing off does not make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=626875
2011-01-04 11:55:05 -05:00
Owen W. Taylor
0a821d2341 Update window->visible_to_compositor before calling into compositor
To deal with reentrancy from compositor plugins doing things like
moving windows between workspaces in an effect callback, update
the visible_to_compositor flag before calling into the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=613124
2011-01-04 11:46:44 -05:00
Owen W. Taylor
78092a404f If enabling a compositor with existing windows, set them visible as necessary
When a compositor is present, we keep the visibility state of the
compositor windows in sync with window->visible_to_compositor. We need
to do the same when enabling the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=613124
2011-01-04 11:40:41 -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
Adel Gadllah
1160744830 ui: Make sure we use the correct atom
We have to use gdk_x11_xatom_to_atom for display to make
it consistent with the surrounding code.
2010-12-24 18:07:03 +01:00
Florian Müllner
cbce4fd39d ui: Adapt to GDK API changes
Some API which was only meaningful on X11 was moved to the X11
backend and renamed accordingly, so adapt to those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=637802
2010-12-22 13:39:36 -05:00
Emmanuele Bassi
2faf56947b Use GdkDeviceManager to get the core pointer
Commit 2c8c1c6df49 in gtk+ removed gdk_display_get_core_pointer().

The equivalent functionality can be achieved by using the
GdkDeviceManager to retrieve the client pointer device.
2010-12-17 17:12:01 +00:00
Florian Müllner
53777b133b ui: Disable multidevice support in GDK
GDK now uses XI2 by default, which conflicts with the X calls done
in mutter. Enforce the previous behavior.
2010-12-15 18:11:13 +01:00
Florian Müllner
594a69317a tiling: Reset maximized tile mode when unmaximizing
Maximized tiled windows end up with an inconsistent tile mode when
unmaximized by other means than dragging the window free (e.g.
using the unmaximize button or double clicking the title bar), so
reset the tile mode when unmaximizing.

This is not a problem for side-by-side tiling, as there are no
alternatives to dragging the window free.
2010-12-10 17:30:18 +01: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
Colin Walters
544c8edd9e theme: Handle new GTK+ states 2010-12-04 17:33:01 -05:00
Florian Müllner
654bd15319 tiling: Do not restore maximized tile state when unmaximizing
When a tiled window is maximized (e.g. by clicking the title bar
button), unmaximizing the window restores the tiled state. While
this is reasonable for side-by-side tiling, it is confusing for
"maximize" tiled windows, as unmaximization has no visible effect.

Change unmaximize to only restore the tiled state of side-by-side
tiled windows.
2010-12-04 21:35:15 +01:00
Florian Müllner
b85171007e window: Add a missing break
When adding maximize tiling, the cleaning of the tiled flag was
refactored to use a switch statement - a break was missed in the
process.
2010-12-04 21:35:15 +01:00
Florian Müllner
7d0ff87cbe tiling: Fix "maximize" tile with no chrome at the top
The original patch triggered "maximize" when the window was dragged
to the top, so that the pointer was below or on the monitor edge and
above the work area's top.

If there's no chrome at the top of the monitor, so that monitor edge
and work area top fall together, the pointer cannot be moved above
the work area's top, so tiling was not triggered.
2010-12-03 02:45:41 +01:00
Benjamin Otte
8994e621f7 Replace some GDK X11 calls with future-proof ones
GTK is about to clean up its code and remove duplicate macros and
GdkDrawable usage. To prepare for that landing, we use the future-safe
versions of the same calls.

https://bugzilla.gnome.org/show_bug.cgi?id=636302
2010-12-03 00:17:42 +01:00
Benjamin Otte
d746591894 ui: Port testgradient example to GTK3
https://bugzilla.gnome.org/show_bug.cgi?id=636301
2010-12-03 00:17:42 +01:00
Florian Müllner
161c1088f9 tiling: disable "shake loose" feature when edge tiling
The old behavior of being able to shake loose a maximized window
overlaps with and is for the most part superceded by top edge tiling.

This commit changes the code to only enable shake loose behavior
when edge tiling is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 17:42:14 -05:00
Ray Strode
07c0471902 tiling: Add new "maximized" tile
In addition to the existing side-by-side tiling modes, this commit
adds a new "maximize" tiling mode.  It allows the user to maximize
their windows (in other words, tile with the edge panels) by dragging
their window to the top edge of the monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 17:11:11 -05:00
Ray Strode
5f4ee1b6e7 tiling: use META_WINDOW_TILED_SIDE_BY_SIDE in state check
The meta_window_handle_mouse_grab_op_event function ensures
the tile_mode variable is in a consistent state after a drag
op is finished.

The way this is current done is:

if (!window->maximized_vertically &&
    window->tile_mode != META_TILE_NONE)
  window->tile_mode = META_TILE_NONE;

While valid, it doesn't "read" as well as using the
META_WINDOW_TILED_SIDE_BY_SIDE macro, since the macro is specifically
about side-by-side tiling.

This commit just changes things to use the macro and to not bother
checking the tile mode (since if we just reset it anyway, then it doesn't
matter if the value is right or wrong to begin with).

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Ray Strode
aa3a4a48e4 tiling: add side_by_side suffix to tile code
The meta_window_can_tile function and META_WINDOW_TILED
macro are pretty side-by-side tiling specific, so
rename them.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Ray Strode
0d27c9600f tiling: rename side-by-side tiling to edge tiling
Currently, the new tiling feature, supports side-by-side, horizontal
tiling when dragging windows to one of the vertical edges of a monitor.

Other types of tiling (on other monitor edges) are potentially useful,
though.

This commit renames the preference from side_by_side_tiling to
edge_tiling.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Milan Bouchet-Valat
1986b20499 Add (out) annotation and documentation to meta_window_get_outer_rectangle()
GObject introspection cannot detect that rect is an (out) parameter.
Also add a meaningful documentation for humans like us.
2010-12-02 00:06:42 +01:00
Florian Müllner
6b98644c58 workspace: Consider text direction when switching
A direction parameter is passed to meta_compositor_switch_workspace(),
to indicate the direction of the switch depending on the workspace
layout.
In contrast to the switcher popup, this parameter does not take the
text direction of the locale into account. Change this, so that the
workspace switching animations move in the correct direction.

https://bugzilla.gnome.org/show_bug.cgi?id=636083
2010-11-29 21:42:58 +01:00
Dan Williams
5397335ae8 Fix builds with clutter < 1.5.2 2010-11-22 22:00:02 -06:00
Owen W. Taylor
b031543f5a Fix updating overlay key keycode when keymap changes
overlay_key_combo needs the same treatment as other keycodes on a
change - we should always recompute it if we have a keysym not
a keycode, and not only if the keycode hasn't already been
computed.
2010-11-22 16:10:34 -05:00
Owen W. Taylor
c6be05f9d7 Unify keymap-reloading code branches
Simplify the keymap loading logic by unifying the different
branches; in the reorganization this patch fixes a bug where when
we got a MappingKeyboard event we wouldn't update virtual modifiers
correctly.

Based on a patch by Thomas Thurman <tthurman@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=565540
2010-11-22 16:02:03 -05:00
Derek Poon
cb88e0d052 Update keybindings when XKB keyboard layout changes
* Select for XKB keyboard notification events explicitly; since GTK+
  has selected for XKB events, delivery of old-school MappingNotify
  events is disabled.

* Fix a bug where once a keycode was loaded for a key binding,
  it would never be reassigned; we want to laod new keycodes for
  all bindings that have a key symbol rather than a fixed
  keycode.

[ With fixes from Owen W. Taylor <otaylor@fishsoup.net> ]

https://bugzilla.gnome.org/show_bug.cgi?id=565540
2010-11-22 16:02:03 -05: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
f372fa29b2 MetaStackTracker: Avoid queueing resync for obvious no-ops
Since we can't distinguish a ConfigureEvent that indicates a raise
from a ConfigureEvent that indicates a move, we get lots of
STACK_OP_RAISE_ABOVE events for windows that are already in the
right place in the stacking order. Avoid queueing a restack in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=634771
2010-11-18 09:54:44 -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
d4c28fc5f5 Add meta_window_get_maximized() and meta_window_is_fullscreen()
These functions duplicate existing properties; they are added for
convenience and to avoid the GObject property code on some
performance critical painting paths.

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
Owen W. Taylor
15f9590427 Report a correct paint volume for shadowed windows
Since we paint shadows directly now rather than using a child actor
in the ClutterGroup, we need to implement get_paint_volume() for
Clutter 1.5.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00
Owen W. Taylor
21a246eb42 Use a template material for shadows
To avoid unnecessary shader recompilation, use a root template material
for all shadows.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00
Owen W. Taylor
1bbaec81ce Make window shadows globally configurable
Instead of setting shadow parameters on individual windows, add the
idea of a "shadow class". Windows have default shadow classes based
on their frame and window type, which can be overriden by setting
the shadow-class property.

Each shadow class has separably configurable parameters for the
focused and unfocused state. New shadow classes can be defined with
arbitrary names.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00
Owen W. Taylor
7952feb48b Export meta_frame_type_to_string()
Frame types will form the bases of shadow classes, which are strings,
so export the to-string function so that we can do the conversion
uniformly.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
52aebdf223 Add meta_window_get_frame_type()
Add a public function to get the frame type for a window; the
code is refactored from existing code in core.c.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
6b16604c26 Export meta_window_appears_focused()
Move meta_window_appears_focused() into the public window.h so
we can use it to change the shadow type.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
3c4d52732e Make MetaShadowFactory public
The basic MetaShadowFactory type is moved to a public header, while
the functions to fetch and paint shadows are kept private.
The public object will be used for configuration of shadows by
plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
d56d267f7d MetaShadowFactory: convert to a GObject
https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
8eb31944a5 MetaShadowFactory: Add the ability to top-fade a shadow
For attached modal dialogs, we want the shadow to fade out at the top
as if the window was glued to the parent at the top. Add a
shadow-top-fade property to MetaWindowActor and the corresponding
parameter to meta_shadow_factory_get_shadow().

The internal implementation of MetaShadow is adjusted to work
in terms of an "inner border" and "outer border" instead of doing
the calculations in terms of an aggregate border and the spread
of the shadow. The old way of doing things gets clumsy when the
top_fade distance is added in as well.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
ed2fbcd13a Add frame type for attached modal dialogs
Add a new frame type META_FRAME_TYPE_ATTACHED which is used for
attached modal dialogs.

The theme format version is bumped to 3.2, and attached windows
can have borders defined in a metacity-theme-3.xml as:

 <window version=">= 3.2" type="attached" style_set="[name]"/>

If no style is defined for "attached", drawing will fall back
to the "border" type.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
9f4942e9a7 Make shadows pretty and configurable
The current shadow code just uses a single fixed texture (the Gaussian
blur of a rectangle with a fixed blur radius) for drawing all window
shadows. This patch adds the ability

* Implement efficient blurring of arbitrary regions by approximating
  a Gaussian blur with multiple box blurs.

* Detect when multiple windows can use the same shadow texture by
  converting their shape into a size-invariant MetaWindowShape.

* Add properties shadow-radius, shadow-x-offset, shadow-y-offset,
  shadow-opacity to allow the shadow for a window to be configured.

* Add meta_window_actor_paint() and draw the shadow directly
  from there rather than using a child actor.

* Remove TidyTextureFrame, which is no longer used

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:56 -05:00
Javier Jardón
9aedd32e01 Use gtk_button_box_new() instead gtk_[h|v]button_box_new() 2010-11-11 01:25:35 +01:00
Matthias Clasen
02e709e89e Prepare for the demise of size_request
The size_request vfunc is going to be dropped in GTK3; replace
the usage in MetaAccelLabel and MetaPreview with
get_preferred_width/get_preferred_height vfuncs.

https://bugzilla.gnome.org/show_bug.cgi?id=633352
2010-11-03 19:06:08 -04:00
Owen W. Taylor
c40fab214d Fix warning from synthesized events with GdkDevice
In GTK+ 3, it's mandatory to have a GdkDevice in a synthesized event,
so fill in the pointer device for the events we synthesize and forward
to GTK+. Since gdk_event_set_device() only works for allocated events,
we need to switch to gdk_event_new() rather than using stack allocated
events.

https://bugzilla.gnome.org/show_bug.cgi?id=633401
2010-10-28 17:27:14 -04:00
Owen W. Taylor
441c050808 Fix check for events on UI widgets
Now that we create MetaWindow objects for override-redirect windows, we need
to check all key press events to see if they are on GTK+ widgets, not just
events that don't match a MetaWindow. This fixes a problem with alt-Tab stealing
grabs away from the window menu.

https://bugzilla.gnome.org/show_bug.cgi?id=633398
2010-10-28 16:33:28 -04:00
Owen W. Taylor
85425f64a5 Stop confusing GDK's grab tracking
With client side windows, mixing GDK event delivery with explicit calls
to XUngrabPointer() can result in GDK losing button release events
it expects to get. This means that GDK thinks there is an implicit
grab in effect when there is none and send events to the wrong window.

Avoid this by bypassing GDK's event handling for most mouse events.
We do a simplified conversion of the X event into a GdkEvent and send
it to directly to libgtk for delivery.

We make an exception when a GDK grab is already in effect - this is
needed for the correct operation of menus.

http://bugzilla.gnome.org/show_bug.cgi?id=599181
2010-10-28 15:48:54 -04:00
Florian Müllner
b445ee3763 Remove compatibility for GTK+-2.0
While the Meego developers agreed to switching mutter to GTK+-3.0
unconditionally a while ago, Canonical used a GTK+-2.0 build for their
Unity project. As Canonical now announced a switch to compiz as their
window manager, there is no longer a reason to maintain GTK+-2.0
compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=633133
2010-10-28 12:16:14 +02:00
Dan Winship
03578b69f3 meta_display_get_keybinding_action: remove keysym parameter
meta_display_process_key_event() always looks up events based on the
"default" keysym for the keycode, so we should do the same here. This
fixes, eg, the lookup of Shift-Alt-Tab (which would otherwise be
unrecognized because the keysym would be XK_ISO_Left_Tab rather than
XK_Tab).

https://bugzilla.gnome.org/show_bug.cgi?id=632155
2010-10-25 16:37:52 -04:00
Giovanni Campagna
8cbaee47a0 Use correct signature and connection function for ::draw
In ui/fixedtip.c, use g_signal_connect instead of g_signal_connect_swapped
since we're not using the data pointer (and for clarity).
At the same time, ensure that both the GTK2 and the GTK3 code paths
have the correct signature for the handler.

https://bugzilla.gnome.org/show_bug.cgi?id=633051
2010-10-25 18:24:22 +02:00
Rico Tzschichholz
7227b636c6 Fix typo 2010-10-24 12:00:57 +02:00
Owen W. Taylor
af715f71e7 Make color constants work without warnings
The code for defining a color as a constant had broken logic: it
would try to parse the color first as an double, then as an integer;
the second attempt would produce an error about overwriting the
already-set-GError. Then it would clear the error and store the constant
as a color.

Use the fact that colors have to start with a letter or #, divide the
space of constants into:

 - Integers
 - Doubles
 - Colors

so we get good error messages. Based on a patch by
William Jon McCann <jmccann@redhat.com>.

Note that this breaks the ability to specify an integer constant as
identical to another integer constant (the same didn't work for doubles.)
I think this was an accidental side effect of the code and not something
that was intentional or people were relying on

https://bugzilla.gnome.org/show_bug.cgi?id=632116
2010-10-23 16:11:06 -04:00
Owen W. Taylor
52bc675fcb introspection: remove --allow-unprefixed
Remove --allow-unprefixed option to the scanner, and fix resulting
problems:

 * theme.h and boxes.h are split into a main -header and a private
   header that includes stuff that is not generally useful and
   hard to introspect. Merge theme-parser.h into theme.h.

 * meta_display_get_atom() and meta_window_get_window_type_atom()
   are marked as (skip)

 * Fix annotation: (element-type Strut) => (element-type Meta.Strut)

https://bugzilla.gnome.org/show_bug.cgi?id=632494
2010-10-23 15:58:16 -04:00
Owen W. Taylor
1920f211b0 Remove Mutter namespace prefix
Move all objects and functions namespaced with Mutter into the Meta namespace
to get a single consistent namespace. Changes that aren't simply changing mutter
to meta:

 MutterWindow              => MetaWindowActor
 mutter_get_windows        => meta_get_window_actors
 mutter_plugin_get_windows => meta_plugin_get_window_actors

https://bugzilla.gnome.org/show_bug.cgi?id=628520
2010-10-23 15:48:29 -04:00
Owen W. Taylor
804117c456 Remove MetaRegion
In many places, MetaRegion was being used entirely internally, rather
than for gtk2/gtk3 compatibility. In these cases, it's simpler to just
depend on cairo-1.10 (for both gtk2 and gtk3) and use cairo_region_t.

The few places where we did need GDK compatibility (GdkEvent.region and
gdk_window_shape_combine_mask) are replaced with a combination of
converting GdkRegion to cairo_region_t and conditional code.

https://bugzilla.gnome.org/show_bug.cgi?id=632474
2010-10-23 15:48:29 -04:00
Dan Winship
9a4d1686a6 Fill in missing MetaKeyBindingAction values
Also, add an assertion to init_bindings() to keep it from getting out
of sync again in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=632149
2010-10-20 14:00:06 -04:00
Nickolas Lloyd
e8dda03441 Fix drawing of <arc> elements
This patch fixes the drawing of <arc> theme elements to appear in the desired orientation

https://bugzilla.gnome.org/show_bug.cgi?id=631487
2010-10-11 17:46:29 -04:00
Owen W. Taylor
4b214b4710 Clean up antialiasing fixes
Simplify the code by noting that when we have square end-caps, the
results of generic line path give the right pixel-aligned rectangle
for horizontal/vertical lines.

Add comments and remove some extra braces.

https://bugzilla.gnome.org/show_bug.cgi?id=630426
2010-10-06 13:01:54 -04:00
Brandon Wright
6ed34976c9 Patch to fix theme breakage in 2.30.2; see bug 630426 2010-10-06 12:40:30 -04:00
Owen W. Taylor
a1e2e2a13d Fix builddir != srcdir builds
An accidental removal of $$pwd was causing Meta-<version>.gir to
be generated in srcdir.
2010-10-04 13:38:24 -04:00
William Jon McCann
a53a40c43e Use the correct image missing icon name from the icon naming spec
Fixes an assertion when the wrong icon can't be found.
2010-10-02 16:35:19 -04:00
Benjamin Otte
33489c8cb8 Adapt to GTK API changes
This code adapts mutter to the latest changes to GTK in
http://git.gnome.org/browse/gtk+/commit/?id=872ef111ecabf6cd4453590b1e17afd3c9757f28
that remove the dest argument from gdk_pixbuf_get_from_window() and
gdk_pixbuf_get_from_surface().

It also removes the dest argument from meta_gdk_pixbuf_get_from_pixmap()
to match. The function is internal and the argument wasn't used.

https://bugzilla.gnome.org/show_bug.cgi?id=631147
2010-10-02 04:27:05 +02:00
Florian Müllner
c382d8f7ea Remove unused variable 2010-09-30 18:49:21 +02:00
Adel Gadllah
f2ccf70f8d mutter-window: Don't track the window type twice
Currently mutter-window has its own type field, even though the same
information is already present in meta_window.

And while at it get rid of MetaCompWindowType, it is equally redundant.

https://bugzilla.gnome.org/show_bug.cgi?id=630363
2010-09-30 18:35:12 +02:00
Alban Browaeys
ff04e38326 Replace gtk_window_set_visual() with gtk_widget_set_visual()
gtk_window_set_visual() was changed back to work on a widget level
for more compatibility with 2.x.

https://bugzilla.gnome.org/show_bug.cgi?id=630843
2010-09-28 15:37:53 -04:00
Adel Gadllah
1123fca3f2 mutter-window: Add error traps check_needs_reshape
A window might change its shape and close immediately and thus causing
XShapeGetRectangles to produce a BadWindow, use an error trap
to avoid that.
2010-09-27 20:11:53 +02:00
Matthias Clasen
33e2d15495 Adapt to GtkObject removal in GTK3
The destroy signal has been moved to GtkWidget, so change the class_init
functions of MetaFrames and MetaAccelLabel to match.

https://bugzilla.gnome.org/show_bug.cgi?id=630671
2010-09-27 13:58:36 -04:00
Benjamin Otte
b265e8099a theme: Get rid of x/y_offset usage when drawing frames
Commit aa65f94c67 that started passing
cairo_t around broke offsets. Since passing cairo_t makes them
unnecessary, this patches removes them rather than fixing them.

This patch changes API.

https://bugzilla.gnome.org/show_bug.cgi?id=630203
2010-09-27 17:07:23 +02:00