Commit Graph

2287 Commits

Author SHA1 Message Date
Carlos Garnacho
61a7789c83 window: Use meta_device_pointer_warp() 2011-07-15 18:03:45 +02:00
Carlos Garnacho
c352e1078e core: Keep track of per pointer/keyboard grabs
There is now a MetaGrabInfo struct, holding all information about
an ongoing grab, there were unfortunately no means of making this
commit smaller, as things are too intertwined to separate it,

On places where it was most obvious, the correct device has been
used (in reaction to events, for example), in other parts, the
private API has been extended to include the MetaDevice (or device
ID for core.h functions), in other places, the virtual core
pointer/keyboard are used out of cluelessness.
2011-07-15 18:00:01 +02:00
Carlos Garnacho
d664579115 ui: Use input-events.h to translate XEvents to GdkEvents
This is the only use in the UI part of core functions not
exported via core.h, but this is sort of a hack within a hack,
and still better than doing the XInput2 vs core dance again.
2011-07-15 17:58:49 +02:00
Carlos Garnacho
49dfb40b82 devices: Make MetaDevice/MetaDeviceMap partly public
MetaDevice is quite limited outside of the core, mostly useful
to represent a device, and get the paired one.
2011-07-15 17:58:49 +02:00
Carlos Garnacho
e08c4756eb keybindings: Replace XGrabKey() with meta_device_map_grab_key() 2011-07-15 17:58:49 +02:00
Carlos Garnacho
6378527458 display: Replace XGrabButton with meta_device_map_grab_button() 2011-07-15 17:58:49 +02:00
Carlos Garnacho
f0705e142c core: Add XInput2 device map implementation 2011-07-15 17:58:49 +02:00
Carlos Garnacho
3f7193e558 Replace XAllowEvents with meta_device_allow_events() 2011-07-15 17:58:48 +02:00
Carlos Garnacho
3af9de08ab Use meta_core_select_events() for input events 2011-07-15 17:58:48 +02:00
Carlos Garnacho
111c23a6e0 core: Add method to select events on a window
This function handles XInput2 vs core in input events.
2011-07-15 17:58:48 +02:00
Carlos Garnacho
db6ddc4a7f devices-xi2: Export function to translate event mask 2011-07-15 17:58:48 +02:00
Carlos Garnacho
884e13474b Add XInput2 input devices implementation 2011-07-15 17:58:45 +02:00
Carlos Garnacho
722420df3a input-events: Add method to get the device for an event 2011-07-15 17:57:24 +02:00
Carlos Garnacho
50cee11c53 core: Add device map object
It will contain the input devices available
2011-07-15 17:57:24 +02:00
Carlos Garnacho
a727114ac2 core: Add core devices implementation 2011-07-15 17:57:24 +02:00
Carlos Garnacho
722d2d6472 device: Add methods to pair devices 2011-07-15 17:57:24 +02:00
Carlos Garnacho
7b9a26fbd8 Add pointer/keyboard abstract classes 2011-07-15 17:57:24 +02:00
Carlos Garnacho
5819e74c22 compositor: Use helper functions for input events 2011-07-15 17:57:24 +02:00
Carlos Garnacho
36e237cf1e keybindings: Use input event helper functions 2011-07-15 17:57:24 +02:00
Carlos Garnacho
3b0aa9f881 window: use input event helper functions on notify_focus() 2011-07-15 17:57:23 +02:00
Carlos Garnacho
e6d09c9d0b window: use input event helper functions in grab operations. 2011-07-15 17:57:23 +02:00
Carlos Garnacho
e26bf9dcef display: get crossing/focus events details via helper functions 2011-07-11 19:00:46 +02:00
Carlos Garnacho
748954a15e display: get button event coordinates with the helper functions 2011-07-11 19:00:46 +02:00
Carlos Garnacho
4c4f21c001 display: get button events state from helper functions 2011-07-11 19:00:46 +02:00
Carlos Garnacho
166559059a display: get button number from helper input event function 2011-07-11 19:00:46 +02:00
Carlos Garnacho
7566b4ea17 display: Use helper function to get input events' timestamp 2011-07-11 19:00:45 +02:00
Carlos Garnacho
1b7a6ce912 display: Use helper functions for getting window/root in input events 2011-07-11 19:00:45 +02:00
Carlos Garnacho
dc4ecdd0d2 display: Get the right window/time for input events 2011-07-11 19:00:45 +02:00
Carlos Garnacho
d381c0465b display: separate input/non-input events handling in the event callback
We now use meta_input_event_get_type() to discern input events from the
others. This commit has involved plenty of indenting changes, so it's
better seen with git diff -b.
2011-07-11 19:00:45 +02:00
Carlos Garnacho
38a0aecf61 core: Add helper code to handle input events
These will be used with every input event out there so they're
dealt with uniformly.
2011-07-11 19:00:45 +02:00
Carlos Garnacho
7573aae855 display: Add XInput2 variables in private struct 2011-07-11 19:00:45 +02: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