1
0
Fork 0
Commit graph

656 commits

Author SHA1 Message Date
Florian Müllner
c3d76aead6 window: Relax restrictions for can_tile_maximized ()
The current code requires windows to be resizable to be considered
for tiling, which excludes all maximized/tiled windows. While this
restriction concurs with the desired behavior for edge-tiling, it
feels overly restrictive for keybindings.
As the edge-tiling code in update_move() already ensures the above
restriction, it seems save to remove it from the can_tile_maximized()
function, assuming that windows that are not meant to be tiled or
maximized won't provide a maximize function.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:51 +01:00
Florian Müllner
bed9cb1648 window: Keep track of the last full-maximization state
In order to be able to toggle between tiled and normal/maximized
states, we need to keep track of the last full maximization state.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:50 +01:00
Florian Müllner
4ca552785f window: Queue a frame redraw after tiling
Usually tiling involves a size change and the frame is redrawn
automatically, however this is not the case when switching directly
between left- and right-tiled.
Ensure that a redraw happens in that case as well.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:50 +01:00
Florian Müllner
497f9be61e window: Listen for pref changes
The workspaces-only-on-primary preference changes how windows are
displayed, so listen for pref changes and update the visibility
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=664853
2011-11-26 11:34:03 +01:00
Florian Müllner
0e50287aea keybindings: Allow to add/remove keybindings at runtime
Add meta_display_add_keybinding()/meta_display_remove_keybinding(),
which allow to add/remove keybindings dynamically at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=663428
2011-11-22 00:42:30 +01:00
Florian Müllner
d42a2a3c27 keybindings: Store keybindings dynamically
Rather than defining keybindings in static arrays generated at compile
time, store them in a hash table initialized in meta_display_init_keys()
and filled in init_builtin_keybindings().

This is a prerequisite for allowing to add/remove keybindings at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=663428
2011-11-22 00:42:30 +01:00
Florian Müllner
c5468ee391 prefs: Adapt to re-addition of a separate visual-bell option
Commit d0910da036 merged the visual-bell/visual-bell-type options,
but the change turned out too disruptive for gnome-control-center /
gnome-shell, so gsettings-desktop-schemas commit a5819b2a4e9 re-added
the separate option.
2011-11-14 15:43:48 +01:00
Florian Müllner
d0910da036 Port preferences to GSettings
Move preferences to GSettings, using mainly shared schemas from
gsettings-desktop-schemas.

Unlike GConf, GSettings support is not optional, as Gio is already
a hard dependency of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=635378
2011-11-11 20:26:38 +01:00
Rui Matos
6e47f0e846 window: add _NET_WM_STATE_FOCUSED hint to _NET_WM_STATE
This hint reflects whether a window appears focused.

https://bugzilla.gnome.org/show_bug.cgi?id=661427
2011-11-08 19:19:32 +00:00
Tim Cuthbertson
4fb2fab7f7 window.c: add meta_window_move_resize_frame
meta_window_move_resize_frame operates much like
meta_window_move_resize, but ensures the window
and its frame (if present) will fit within the
specified dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=651899
2011-11-05 18:52:43 -04:00
Jasper St. Pierre
7f9472a58f util: Fix memory leak in meta_later_remove
We never destroy the later list that's added by meta_later_add.

==4289== 16 bytes in 1 blocks are definitely lost in loss record 1,632 of 7,258
==4289==    at 0x4C2640D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4289==    by 0x5178D9F: standard_malloc (gmem.c:88)
==4289==    by 0x5178E37: g_malloc (gmem.c:164)
==4289==    by 0x51924B5: g_slice_alloc (gslice.c:842)
==4289==    by 0x5194521: g_slist_insert_sorted_real (gslist.c:900)
==4289==    by 0x519465A: g_slist_insert_sorted (gslist.c:957)
==4289==    by 0x4EA609A: meta_later_add (util.c:876)
==4289==    by 0x4E9C330: meta_screen_queue_workarea_recalc (screen.c:2640)
==4289==    by 0x4E9A360: update_num_workspaces (screen.c:1646)
==4289==    by 0x4E99026: meta_screen_new (screen.c:924)
==4289==    by 0x4E7AB51: meta_display_open (display.c:803)
==4289==    by 0x4E9168E: meta_run (main.c:552)

https://bugzilla.gnome.org/show_bug.cgi?id=642652
2011-10-21 15:44:50 -04:00
Rui Matos
6aa4bfd060 tiling: do not tile if moving in snap mode
If we are moving in snap mode (shift pressed) we don't want to tile. We must
also cancel any pending tiling if snap mode is activated during the move drag.

https://bugzilla.gnome.org/show_bug.cgi?id=662270
2011-10-20 16:18:38 +01:00
Jasper St. Pierre
bb035fe6e0 window: Correct coordinates for the configure event
We should still correct the coordinates for withdrawn windows.
2011-10-17 21:53:58 -04:00
Jasper St. Pierre
6d0c1f08d2 frame: Make sure to offset by invisible borders when unmanaging windows
When we reparent a window to the root when we're exiting, we need to offset
the position by the invisible borders, otherwise windows will creep up and
to the left.

https://bugzilla.gnome.org/show_bug.cgi?id=660848
2011-10-17 21:53:58 -04:00
Jasper St. Pierre
f700a7be07 Make meta_display_unmanage_screen public
https://bugzilla.gnome.org/show_bug.cgi?id=660848
2011-10-17 21:53:58 -04:00
Rui Matos
138eb1e3b4 tiling: keep track of the monitor where a window was tiled
meta_window_get_current_tile_area() computes the area where the tiled window
should be based on the current pointer position but that's only meaningful
when the user is actually dragging the window.

When running the tiling constrain the pointer might be on other monitor and at
that point the window jumps to this other monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=642580
2011-10-18 02:40:36 +01:00
Rui Matos
c39129b6e8 tiling: for tiled maximization use the tile area as target size/position
When using more than one monitor, tiled maximization can be triggered with the
pointer in one monitor while most of the window area remains in another. This
means that the maximization constraint would maximize the window into the wrong
monitor as it uses the work area size/position as target.

Fix this by using the current tile area as target size/position.

https://bugzilla.gnome.org/show_bug.cgi?id=657519
2011-10-18 02:33:41 +01:00
Owen W. Taylor
ba31ba4615 Update window->has_resize_func at the right time when unfullscreening
Since the frame window size that meta_window_move_resize() uses depends
on whether the window has horizontal/vertical resize functionality, we
need to update this flag before we resize the window.

https://bugzilla.gnome.org/show_bug.cgi?id=659854
2011-10-17 15:08:00 -04:00
Owen W. Taylor
f94f008ed6 window.c: use a consistent mapping from frame_type => decorated
If a window had a type hint intended for override-redirect windows
like NOTIFICATION, we ended up with a window that was decorated but
with a frame type of FRAME_TYPE_LAST, causing assertion failures.
Fix this by making recalc_window_features() just call
meta_window_get_frame_type().

https://bugzilla.gnome.org/show_bug.cgi?id=599988
2011-10-17 11:58:10 -04:00
Matthias Clasen
9d4f3c5842 Allow keyboard ops to work without a pointer grab
https://bugzilla.gnome.org/show_bug.cgi?id=660457
2011-10-15 22:50:45 +02: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
Rui Matos
9f54f1d75d frame: destroy window->frame_bounds when destroying the frame
Since window->frame_bounds is used as a cache we need to invalidate it when
destroying the frame.

https://bugzilla.gnome.org/show_bug.cgi?id=660773
2011-10-04 12:47:42 +01:00
Jasper St. Pierre
c4692b8d51 window: Fix _NET_FRAME_EXTENTS to work properly
_NET_FRAME_EXTENTS should contain the difference between where a window asked
to be placed, and where it is. Ideally, this should be the same as the visible
extents.

https://bugzilla.gnome.org/show_bug.cgi?id=659848
2011-09-24 13:21:25 -04:00
Jasper St. Pierre
764569eb7a window: Fix window placement to exclude invisible borders
A window can specify geometry that it is placed at. We need to exclude invisible
borders when calculating where to place the window, otherwise the window will have
a strange offset.

https://bugzilla.gnome.org/show_bug.cgi?id=659848
2011-09-24 13:21:25 -04:00
Rui Matos
7ba6503e9b display: trivial code clean up
Remove redundant if statement.
2011-09-14 23:30:29 +01:00
Alexander Larsson
19b6888ea5 When monitors change, keep windows on same output.
If XRANDR is availible, we track the first (or primary) output per
crtc (== xinerama monitor) so when the monitors change we can try
to find the same output and move windows there. If we can't find the
original monitor in the new set (or XRANDR is not supported) we move
the window to the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=645408
2011-09-14 15:38:55 +02:00
Rui Matos
7223c4e184 window: remove warning about _NET_WM_MOVERESIZE's lack of timestamps
The comments in the code about the protocol's inadequacies are enough, there's
no need to spam our standard outputs.
2011-09-12 18:46:47 +01:00
Owen W. Taylor
e1362562b4 MetaDisplay: Renamed 'ignored_serials' for clarity
The ignored_serials member of Display refers explicitly to crossing
serials - rename the member and associated functions and constants
for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=597190
2011-09-12 09:56:59 -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
Matthias Clasen
818320e748 Don't show a title on alerts
This goes better with the general style of similar alerts throughout
GNOME 3, and as has been pointed out in bug 591735, 'Mutter' is
a somewhat unfortunate title in several lanuages, such as English
and German.
2011-09-06 12:51:53 -04:00
Owen W. Taylor
7af6aa9739 Additional annotation fixes
* At least one line (possibly blank) is required after a function name for a doc header
  to be parsed correctly.

* SnStartupSequence isn't a type known to introspection
2011-08-30 15:12:09 -04:00
Jasper St. Pierre
faae2daae8 Add (element-type) annotations to make gobject-introspection happy 2011-08-30 12:54:49 -04:00
Jasper St. Pierre
05fee9beea Account for invisible borders when constraining modal dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=656619
2011-08-29 13:00:26 -04:00
Dan Winship
2be1574e55 window: only attach dialogs to NORMAL, DIALOG, and MODAL_DIALOG windows
Attaching dialogs to unusual windows (like the desktop) looks bad, so
don't do it.

https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-08-27 13:12:25 -04:00
Dan Winship
7f8c59614e window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.

Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).

Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.

https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-08-27 13:12:25 -04:00
Jasper St. Pierre
d33d113746 frame: Add "get_corner_radiuses" chain
https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-24 09:38:23 -04:00
Jasper St. Pierre
be4ef9b43d MetaWindow: Compensate for invisible border changes
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
a133d8b42e MetaWindow: Repurpose get_outer_rect and add get_input_rect
get_outer_rect now returns the visible region, and a new get_input_rect
method returns the boundaries of the full frame, including the possible
invisible regions. When undecorated, both do the samething.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
a1a2527c75 MetaFrameBorders: Add invisible borders
This just adds the invisible border field and populates it with data
but doesn't use it in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
6f5882302f prefs: Add draggable_border_width preference
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
ce9c7a210d MetaFrameBorders: Add meta_frame_borders_clear
Just a quick little commit to help clean things up for when we add invisible
borders. Additionally, do a little housekeeping in preview-widget as well.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
e0fb83c691 Replace public MetaFrameGeometry with MetaFrameBorders
There were actually *two* MetaFrameGeometry structs: one in theme-private.h,
one in frame.h. The latter public struct was populated by a mix of (void*)
casting and int pointers, usually pulling directly from the data in the private
struct.

Remove the public struct, replace it with MetaFrameBorders and scrap all
the pointer hacks to populate it, instead relying on both structs being used
in common code.

This commit should be relatively straightforward, and it should not do any
tricky logic at all, just a sophisticated find and replace.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -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
183bcd6fc7 Stop shaping the frame window
In preparation for switching to handling the output shape purely by what we
paint, stop applying a shape to the frame of the window. Even when we restore
handling the output shape, this will change the behavior with respect to input;
transparent areas between the frame and the contents will stop clicks rather
than passing them through, but that is arguably at least as expected
considering how that we decorate shaped windows with a frame all around.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Tim Cuthbertson
f76372dd7d MetaWindow: Add :resizable and :above properties
Allow libmutter users to treat windows different based on these
attributes and to watch for changes.

https://bugzilla.gnome.org/show_bug.cgi?id=653858
2011-08-09 04:58:18 -04:00
Rui Matos
d3edcbc11e window: remove redundant condition
This condition is already checked for at this point.
2011-07-27 01:42:25 +01:00
Rui Matos
779ef582f1 prefs: Initialize button_layout struct even on pref string corner cases
We were leaving some members of the button_layout struct uninitialized if the
pref string didn't have at least one colon or if it was an empty string ("").

https://bugzilla.gnome.org/show_bug.cgi?id=654539
2011-07-24 01:41:25 +01:00
Dan Winship
cd7a968093 util: fix a reentrancy problem with meta_later
Calling meta_later_add() or meta_later_remove() from within a
META_LATER_BEFORE_REDRAW callback ended up being a no-op, because of
how run_repaint_laters() was fiddling with the laters list. (This
resulted in a crash in window.c:idle_calc_repaint(), which assumed it
would only be called when a certain queue was non-empty, but was
getting called anyway because of a failed meta_later_remove() call.)

Fix this by having run_repaint_laters() work on a copy of the laters
list instead, and add refcounting to MetaLater so that removing a
later that run_repaint_laters() hasn't gotten to yet won't cause
problems.

https://bugzilla.gnome.org/show_bug.cgi?id=642957
2011-07-13 10:40:41 -04:00
Owen W. Taylor
12f71c9795 Improve handling of <Super>key combinations
When we get a press of the overlay key, and then another key is pressed,
first try to handle the combination as a global keybinding. If that fails,
call XAllowEvents(..., ReplayKeyboard, ...) to let it be handled by
our per-window keybindings or by the application.

This requires restructuring things to call XAllowEvents a bit later
so we can pass the right mode.

https://bugzilla.gnome.org/show_bug.cgi?id=624869
2011-07-13 09:44:33 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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