1
0
Fork 0
Commit graph

5793 commits

Author SHA1 Message Date
Carlos Garnacho
323c608b0c backends: Export call to retrieve the base GSettings for a tablet 2016-07-22 13:31:09 +02:00
Carlos Garnacho
0efe076a0a backends: Implement "switch monitor" pad button action
This action remaps the tablet to each of the connected monitors,
or to the span of all monitors.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
6f7f98540f core: Add public MetaDisplay functions to get action labels for pad buttons
This API will be used from the gnome-shell pad OSD implementation, in order
to show the actions that currently apply to every button/ring/strip in the
tablet.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
56632d2ef7 backends: Add function to retrieve the label for a pad button action
As those are specified by settings.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
6296d30e1a wayland: Add getters for the current feedback strings in MetaWaylandTabletPad
Each of the buttons/rings/strips may have one such feedback string, this API
makes is meant to make lookups consistent.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
ed16b40c98 meta: Add MetaPadActionType enum
This will be used on lookups to the current action assigned to
any element in a tablet pad.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
7bba20e536 wayland: Hook MetaWaylandTabletPad to pad button actions management
These are handled by the MetaInputSettings, so hook the events emitted
to it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8e6244238d backends: Add API to trigger actions related to pad buttons
It does nothing at the moment, but can be hooked into MetaWaylandTabletPad
now. For X11, we need to trigger these for the pad events we receive from
the passive pad button grabs.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
ba9ec00694 wayland: Add update() phase to MetaWaylandTabletPad
This will be needed to update internal state of pad groups.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
08cda496f8 wayland: Apply pressure settings before sending wp_tablet_tool.pressure 2016-07-22 13:31:09 +02:00
Carlos Garnacho
f9552bb9c0 backends: Add function to apply pressure sensitivity to tablet tools
A bezier curve is created out of the 2 control points in settings, so
the pressure is made to follow the stablished curve between 0 and 1.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
7e267e9b01 wayland: Implement stylus button actions
Those just send different BTN_ keycodes.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
fbb4c0b831 backends: Add function to retrieve the action mapped to an stylus button
This function will be useful for the wayland implementation, because buttons
are mapped at the time of sending those through the wire.
As x11/wayland implementations differ here, this function will be useful for
the wayland implementation, as the action is handled lat
2016-07-22 13:31:09 +02:00
Carlos Garnacho
d7faab76e0 backends: Perform libwacom checks before applying settings
Some settings make no sense on external tablets, and others make
no sense in display/system-integrated tablets. Perform those checks
so we don't end up with possibly broken configuration.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
b7892ba1c5 backends: Disable keep-aspect and output mapping on relative devices
Those settings make no sense there, so should be made ineffective.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
ab2d2af176 backends: Implement set_tablet_mapping() in native backend
We can now just set the mapping through clutter_input_device_set_mapping()
2016-07-22 13:31:09 +02:00
Carlos Garnacho
73958aeb59 backends: Add private getter for the MetaInputSettings
We will need to fetch information from it at certain places.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
77b33a86b8 backends: Fetch libwacom information for tablets in MetaInputSettings
Given that information defines largely how such devices are to be
configured, it makes sense to have that information at hand. A getter
has been also added for the places where it could be useful, although
it will require HAVE_LIBWACOM checks in callers too.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
f3b94d9a78 wayland: Implement wp_tablet.path
Now that we have clutter_input_device_get_device_node(), it is trivial
to implement.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
f6e471fca4 backends: Add function to lookup the mapping for a given tablet
At least for wayland, this needs implementing within mutter. So add
a function to look this setting up.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
1dd121002f backends: Store mappable devices' info in the hashtable
Instead of as closure data. We will need to store (and query) more
per-device info, so access to this struct is necessary.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
526fdca3fb backends: Map tablets/pads, and wire to configuration vfuncs
With this, the left-handed setting works. The other configuration
vfuncs remain empty stubs, but will be correctly applied when those
are handled.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
220ac7c8f2 backends: Add empty stubs for tablet configuration
Those will be called when configuring tablets.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
5ea39e0e77 wayland: Implement wp_tablet_tool.hardware_id_wacom
We can now fetch this info from the ClutterInputDeviceTool, so
use it to implement this event.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
c1d157e136 wayland: Add focus management to pads
All pads will share the same focus than the keyboard, so this means that:
- The focus changes in-sync for keyboard and all pad devices, and
- Newly plugged pads will be immediately focused on that same surface
2016-07-22 13:31:09 +02:00
Carlos Garnacho
2cd21f1b20 wayland: Add MetaWaylandTabletSeat API to correlate pads/tablets
All pads have one tablet, but a tablet may have multiple pads. Add
API to look things up from a MetaWaylandTablet(Pad).
2016-07-22 13:31:09 +02:00
Carlos Garnacho
5ccde659c1 wayland: Add pointer from MetaWaylandTabletSeat to MetaWaylandSeat
It will be useful to backreference to the MetaWaylandSeat from tablet
code.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
fd62a1f6ce wayland: Wire up pad device event management
The tablet manager will now lookup the correct MetaWaylandTabletSeat,
and forward the events through it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
b8808ca24d wayland: Implement pad management in MetaWaylandTabletSeat
Now pads are looked up and notified upon, both on startup and
when plugging a tablet.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
41ff0aaf60 wayland: Implement wp_tablet_pad
This object represents the collection of buttons, strips and rings
in a tablet pad. All the objects created (pad, strips and rings)
share a common focus surface and have the same lifetime.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
c5d0791710 wayland: Implement wp_tablet_pad_group 2016-07-22 13:31:09 +02:00
Carlos Garnacho
828277f5e0 wayland: Implement wp_tablet_pad_strip
This represents pad sliders.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
e56d6b06cf wayland: Implement wp_tablet_pad_ring
This object represents pad "wheels"
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8b769a3412 wayland: Set an specific role on surfaces passed in wp_tablet_tool.set_cursor
This is now separated from the generic cursor one. This means that wl_surfaces
can't be shared across wl_pointer and wp_tablet_tool. This is a change in
tablet protocol v2.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
8d3ac8c3e9 wayland: Add MetaWaylandSurfaceRoleTabletCursor
This is a simple subclass of MetaWaylandSurfaceRoleCursor, mostly
so we can distinguish by GType, the methods in the parent class
still apply and are useful.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
074b0d6b2a wayland: Make MetaWaylandSurfaceRoleCursor derivable 2016-07-22 13:31:09 +02:00
Carlos Garnacho
8e8cdf1873 wayland: Make additional data in MetaWaylandSurfaceRoleCursor private
This will help subclassing it.
2016-07-22 13:31:09 +02:00
Carlos Garnacho
72ee6b8b65 wayland: Use wl_fixed_t for angle arguments in wp_tablet_tool
This is a change in tablet protocol v2
2016-07-22 13:31:09 +02:00
Carlos Garnacho
3d9bb1cc09 wayland: Use tablet protocol v2
This commit merely updates the code generation from the v2 protocol
description.
2016-07-22 13:31:09 +02:00
Jouke Witteveen
4ed59a020d Throw an error in case of unsupported session type
When launching a GNOME session from a text-mode VT, the logind session
type is unlikely to be set to either "wayland" or "x11". We search for a
supported session type first with logind and then with
$XDG_SESSION_TYPE. As a fallback, we also test $DISPLAY in case of a
"tty" logind session to support starting through xinit. Ideally, such
setups should set XDG_SESSION_TYPE=x11.
If no supported session type is found, we throw an error.

https://bugzilla.gnome.org/show_bug.cgi?id=759388
2016-07-22 10:52:04 +08:00
Thomas Hindoe Paaboel Andersen
b5e797f453 MetaSurfaceActorWayland: clean up var assigned to self
https://bugzilla.gnome.org/show_bug.cgi?id=769054
2016-07-22 10:44:19 +08:00
Thomas Hindoe Paaboel Andersen
125cba7100 backend: simplify assert
We already checked that constraint is non-null.

https://bugzilla.gnome.org/show_bug.cgi?id=769054
2016-07-22 10:44:19 +08:00
Jonas Ådahl
ad7ec6b979 main: Fix compilation with wayland disabled
https://bugzilla.gnome.org/show_bug.cgi?id=769024
2016-07-21 20:34:28 +08:00
Florian Müllner
de1464f88f renderer-native: Adjust to StageView memory handling changes
ClutterStageView now takes ownership of the :framebuffer property,
so we need to release our own reference.
2016-07-20 20:58:20 +02:00
Rui Matos
daf5a112fb meta/boxes: typedef cairo_rectangle_int_t MetaRectangle
They are already effectively interchangeable so this should reduce
pointless casts.

Just like in GDK though, we need to keep the old definition for
instrospection to be able to include the struct's fields.
2016-07-20 14:11:25 +02:00
Jonas Ådahl
a75e2ace82 Revert "main: Add --x11 command line argument"
This reverts commit feb4c36659.
2016-07-20 17:45:18 +08:00
Jonas Ådahl
f18e2a8c31 Fix out-of-tree building
We included generated cogl headers and non-generated clutter headers
from mutter, while only having added include paths for the opposite.
2016-07-20 16:17:22 +08:00
Jonas Ådahl
e891a8b628 renderer-native: Resize legacy onscreen before panting
By creating a pending gbm/EGL surface pair, only setting it on
swap-buffers, we would draw onto a buffer on the old surface, then swap
the buffer from the new surface, causing the first frame after a
hot-plug always having no content.

This was in the past not very noticable since some non-deterministic but
frequent side effect in gnome-shell caused hot-plugging to always render
two new frames, but after "Introduce regional stage rendering", this
side effect did not occur as often, thus making it more visible.

This commit updates the current gbm/EGL surface pair before painting a
frame, so that when the frame is painted, the surface with the correct
size is used and the buffer from correct surface is swapped.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
aecd98b847 backends/native: Support drawing onto multiple onscreen framebuffers
Add support for drawing the stage using multiple stage views, where
each stage view has its own onscreen framebuffer.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
d7b87799c8 backend: Ensure the backend gets notified of monitor state having changed
Being a listener to a signal, it is inconvenient to enforce order of
execution between different signal listeners. If there are things in
the backend that should be updated before various other signal
handlers, make sure so is done by emitting the signal after having
explicitly notified the backend.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
28a898a22f Use signals instead of onscreen framebuffer frame callbacks
CoglFrameInfo is a frame info container associated with a single
onscreen framebuffer. The clutter stage will eventually support drawing
a stage frame with multiple onscreen framebuffers, thus needs its own
frame info container.

This patch introduces a new stage signal 'presented' and a accompaning
ClutterFrameInfo and adapts the stage windows and past onscreen frame
callbacks users to use the signal and new info container.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
92341e7c30 MetaRendererNative: Make cogl variables obvious via their names
Call a CoglContext "cogl_context", CoglDisplay "cogl_display" and
CoglRenderer "cogl_renderer" so that they won't be confused with
ClutterContext, MetaDisplay and MetaRenderer etc.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
2eb843268a renderer-native: Rename cogl vfunc implementations
Make the cogl vfunc functions have names that are globally
discoverable. Calling the same function in every backend the same name
causes code navigation tools to not function properly. Rename the
affected functions to closer correspond to the style mutter uses.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
44b163e39b renderer-native: Meta:ify a struct
Rename a struct from the old Cogl style to mutter style naming and
conventions.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
566c28bdaf Introduce regional stage rendering
Add support for drawing a stage using multiple framebuffers each making
up one part of the stage. This works by the stage backend
(ClutterStageWindow) providing a list of views which will be for
splitting up the stage in different regions.

A view layout, for now, is a set of rectangles. The stage window (i.e.
stage "backend" will use this information when drawing a frame, using
one framebuffer for each view. The scene graph is adapted to explictly
take a view when painting the stage. It will use this view, its
assigned framebuffer and layout to offset and clip the drawing
accordingly.

This effectively removes any notion of "stage framebuffer", since each
stage now may consist of multiple framebuffers. Therefore, API
involving this has been deprecated and made no-ops; namely
clutter_stage_ensure_context(). Callers are now assumed to either
always use a framebuffer reference explicitly, or push/pop the
framebuffer of a given view where the code has not yet changed to use
the explicit-buffer-using cogl API.

Currently only the nested X11 backend supports this mode fully, and the
per view framebuffers are all offscreen. Upon frame completion, it'll
blit each view's framebuffer onto the onscreen framebuffer before
swapping.

Other backends (X11 CM and native/KMS) are adapted to manage a
full-stage view. The X11 CM backend will continue to use this method,
while the native/KMS backend will be adopted to use multiple view
drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
749237a28e MetaWindowGroup: Only compensate for transforms when in clone paint
We were compensating for a clone paint viewport offset even when we
were not in clone paniting mode. This would break painting if we offset
the viewport for some other reason for example as in the future stage
view painting.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
7f0e6b9b4b compositor: Don't access use the onscreen framebuffer directly
Instead of assuming there is a single onscreen framebuffer, use the
helper functions for setting the frame callback and getting the frame
counter.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
a465e4c5b8 compositor: Initiate cogl context field on creation
There will only ever be one context; just get it from clutter instead
of waiting for we interact with a framebuffer.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
767e12125b ClutterStageCogl: Let the sub-classes handle the onscreen
In preperation for having allowing drawing onto multiple onscreen
framebuffers, move the onscreen framebuffer handling to the
corresponding winsys dependent backends.

Currently the onscreen framebuffer is still accessed, but, as can seen
by the usage of "legacy" in the accessor name, it should be considered
the legacy method. Eventually only the X11 Compositing Manager backend
will make use of the legacy single onscreen framebuffer API.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
14dbdfe483 Get rid of ClutterStageEglNative
The functionality from ClutterStageEglNative (one function returning
TRUE) was moved to MetaStageWindowNative.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
c3d2352a9e Explicitly create per backend stage windows
Split the stage window implementations into three separate objects: one
for X11 as a compositing manager, one for X11 running as a nested
Wayland compositor, and one for running with the native backend.

The new stage window implementations are only thin shells; this is in
preparation for making the stage windows behave more differently.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
55726e787b backends: Make clutter stage resizing more explicit
The stage resizing was placed in the generic backend, which was only
run on certain configurations (when running nested or using the native
backend). This commits makes the resizing more explicit thus more
obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
085df1170e plugins/default: Make the background a vignette
Make the default plugin background a vignette in order to see that it
properly draws using the correct scale.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
8bebb8126c Let MetaMonitorManagerKms handle page flips
This commit completes the move of monitor logic to the monitor
mangager. The renderer now only deals with framebuffers, asking the
monitor manager to do the crtc flip tracking.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
12ef1a5e4b backends/native: Let the monitor manager manage KMS modes
Let MetaMonitorManagerKms manage KMS modes. This lets us pass less
state to MetaRendererNative. Instead let MetaMonitorManager tell the
monitor manager when it should set the mode and with what framebuffer.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
ec1da588cf MetaRendererNative: glib:ify a couple of struct fields
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
44628bf224 MetaRendererNative: Absorb CoglDisplayKMS
Absorb the CoglDisplayKMS struct into MetaRendererNative. This makes
t so that all KMS interaction and fields are in the same place.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
27ac0b7f27 MetaRendererNative: Absorb CoglRendererKMS
Absorb the CoglRendererKMS struct into MetaRendererNative. The gbm
device initialization is moved earlier so that the renderer fails to
initialize if the gbm device creation failed.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
e420f386d2 Move cogl KMS winsys into the native backend
Move the KMS interaction from cogl into mutter, where most of the other
KMS interaction already takes place. This also removes dead code which
were only excercised when non-mutter callers used the cogl KMS backend.

The cogl KMS API was updated to pass via MetaRendererNative instead of
via the different cogl objects.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
2ceff4ee9b Create cogl renderer in MetaRenderer
Instead of passing around the KMS file descriptor via clutter to cogl,
just make our own clutter backend create the cogl renderer and set the
KSM fd.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
b2a62e6d5a native: Pass KMS fd to renderer
Will be used in a later commit.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
a54042e938 Introduce MetaRenderer
MetaRenderer is meant to be the object responsible for rendering the
scene graph. It will contain the logic related to the cogl winsys
backend, the clutter backend, and the clutter stage window.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
feb4c36659 main: Add --x11 command line argument
Make it possible to force mutter to start as a X11 compositing/window
manager. This is needed when intending to start mutter as an X11 window
manager while running inside a Wayland session, for example when
intending to debug it in Xephyr.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
dd1eaeb262 Use correct cogl object types
Use the correct pointer types for cogl objects. This avoids warnings
when including the cogl headers doesn't result in all the cogl types
being typedefs to void.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
f096cc327d launcher: Expose KMS fd
https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
e05f48fc53 Make it possible to include private cogl API from mutter
If we want to put a cogl winsys backend in mutter, that backend need to
have access to the internal workings of cogl.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
95a68854ad configure.ac: Add AC_GNU_SOURCE
We define it here and there already, and if we are to include private
cogl files, we need it in more places. Lets just add it everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
90de521799 Make mutter manage its own clutter backends
Introduce two new clutter backends: MetaClutterBackendX11 and
MetaClutterBackendNative. They are so far only wrap ClutterBackendX11
and ClutterBackendEglNative respectively, but the aim is to move things
from the original clutter backends when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Rui Matos
b281f9566d wayland-surface: Make get_relative_coordinates() accurate for X apps
Using clutter API to transform coordinates is only accurate right
after a clutter layout pass but this function is used e.g. to deliver
pointer motion events which can happen at any time. This isn't a
problem for wayland clients since they don't control their position,
but X clients do and we'd be sending outdated coordinates if a client
is moving a window in response to motion events.

https://bugzilla.gnome.org/show_bug.cgi?id=768039
2016-07-15 14:27:16 +02:00
Rui Matos
5ee0f24ab9 window: Stop updating layers on focus changes
Commit 3a4ae679ea removed the
FOCUSED_WINDOW layer definition but it was already unused for a long
time. There's no layers to update on focus changes.

https://bugzilla.gnome.org/show_bug.cgi?id=768221
2016-07-06 19:11:30 +02:00
Rui Matos
fcc7501eb8 core: Remove META_LAYER_FULLSCREEN
This layer isn't really being used and in fact, it causes
meta_stack_get_default_focus_window() to return a fullscreen window
even if the naturally topmost window in the stack isn't a fullscreen
one.

Note that commit a3bf9b01aa changed how
we choose the default focus window from the MRU to the topmost in the
stack.

https://bugzilla.gnome.org/show_bug.cgi?id=768221
2016-07-06 19:11:30 +02:00
Olivier Fourdan
492854e14d window: Do not try to focus O-R windows in focus-follow-mouse
Doing so would raise a critical warning.

https://bugzilla.gnome.org/show_bug.cgi?id=767997
2016-07-06 09:14:56 +02:00
Luca Bruno
c325a0bebf Fix string format in startup notification to be a gint64
https://bugzilla.gnome.org/show_bug.cgi?id=762407
2016-07-04 22:34:31 +02:00
Owen W. Taylor
b112d98278 Improve handling of tracking the old focused window during restart
When restarting (X compositor only, obviously), we want to keep
the same window focused. There is code that tries to do this by
calling XGetInputFocus() but the previously focused window will
almost certainly not still be focused by the time we get to the
point where we call XGetInputFocus(), and in fact, probably was
no longer correct after the previous window manager exited, so
the net result is that we tend to focus no window on restart.

A better approach is to leave the _NET_ACTIVE_WINDOW property
set on the root window during exit, and if we find it set when
starting, use that to initialize focus.

https://bugzilla.gnome.org/show_bug.cgi?id=766243
2016-06-29 10:22:55 -04:00
Rui Matos
cc6efeb14f MetaSurfaceActorX11: invalidate the stex on video memory purged errors
MetaShapedTexture uses FBOs when mipmapping so we need to cause them
to be recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Rui Matos
53993ba4d2 MetaBackground: invalidate contents on video memory purged errors
We use FBOs so we need to cause them to be recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Rui Matos
7f6bcea331 compositor: Handle GL video memory purged errors
Emit a signal so that interested parties can recreate their FBOs and
queue a full scene graph redraw to ensure we don't end up showing
graphical artifacts.

This relies on the GL driver supporting the
NV_robustness_video_memory_purge extension and cogl creating a
suitable GL context. For now we only make use of it with the X backend
since the only driver with which this is useful is NVIDIA.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Rui Matos
7ed14e0ee8 restart: Make meta_restart() work without a message
In some cases there's no meaningful message to show.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:49 +02:00
Carlos Garnacho
21fd87c4af xwayland: Use CurrentTime on all XConvertSelection calls
The call fetching the targets mistakenly used the timestamp meant
to back up the TIMESTAMP atom (hence, it's the timestamp at which
the selection is *owned* by the compositor, on behalf of a wayland
client).

This timestamp is actually only updated when the compositor gets
to own the selection, so it's a randomly late timestamp to retrieve
the TARGETS atom content, which certain clients might end up
ignoring.

https://bugzilla.gnome.org/show_bug.cgi?id=768007
2016-06-27 11:42:26 +02:00
Rui Matos
1d2bead358 ui/frames: Drop the current grab info on button release
This was added in commit d05b750b8d and
later removed inadvertently in commit
d561b3b18f .

https://bugzilla.gnome.org/show_bug.cgi?id=767969
2016-06-23 18:45:53 +02:00
Florian Müllner
a174c18fb5 frames: "Initialize" frame background
Frames are painted on the frame window according to the GTK+ theme.
Depending on the target's visual, this means either drawing over
a black destination or a fully transparent one. So in cases where
the theme doesn't paint decorations with full opacity, decorations
for windows with an rgba visual look different from those with a
non-rgba visual. Using an rgba visual for all frames independent
from the client's visual can potentially break clients, so our
only option for a consistent appearance is to explicitly initialize
the frame background to black before painting the theme's decoration
on top.

https://bugzilla.gnome.org/show_bug.cgi?id=745060
2016-06-23 16:47:51 +02:00
Florian Müllner
c61dfa71ed frames: Don't clip out "invisible" parts of frames
The GTK+ theme may draw parts of the decorations outside the actual
frame. Since commit f9db65f47f we make sure that the frame is big
enough to account for any overdrawing, however as we still clip the
cairo context to the actual frame before drawing the decorations,
those parts aren't actually painted.
This issue is not very obvious for most frames, as they use a non-rgba
visual where the unpainted parts appear black, which gives the expected
result with many themes once the shape mask is applied (as the mask does
include any overdrawn parts). For frames using an rgba visual however,
unpainted parts are transparent, so any overdrawn decorations are clearly
missing.
Fix this by only clipping out the client area when drawing decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=745060
2016-06-23 16:47:51 +02:00
Florian Müllner
53a9411255 surface-actor: Keep track of ignored damage
We ignore all damage while a surface is frozen and queue a full
update instead once it's thawed. While not super efficient, this
isn't overly bad for the intended case of catching up with any
updates that happened during a compositor effect. However when
extended frame sync is used, surfaces are also frozen while the
client is drawing a frame, in which case the current behavior is
pretty damaging (pun intended), as we end up redrawing the entire
window each frame. To address this, keep track of the actual damage
we ignore and apply it when the surface is thawed.

https://bugzilla.gnome.org/show_bug.cgi?id=767798
2016-06-17 21:39:06 +02:00
Olivier Fourdan
989ec7fc60 wayland: Mark pending moved as moved
The result flag needs to be marked as moved even for pending moves,
otherwise the window's unconstrained_rect doesn't get updated in
meta_window_move_resize_internal() and the anchor grab is wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=764180
2016-06-13 17:31:35 +02:00
Olivier Fourdan
c72efc90cb wayland: Implement force-quit using kill()
The X11 backend uses EWMH's _NET_WM_PID to get the PID of an offending
client and kill its PID to force the client to terminate.

The Wayland backend is using a Wayland protocol error, but if the client
is hung, that will not be sufficient to kill the client.

Retrieve the client PID under Wayland using the Wayland client API
wl_client_get_credentials() and kill() the client the same way the X11
backend does.

https://bugzilla.gnome.org/show_bug.cgi?id=767464
2016-06-10 09:55:19 +02:00
Olivier Fourdan
e7430a4535 wayland: add extended state for tiled
xdg-shell allows desktop environments to extend the list of states
within a given range.

Use this possibility to add a new state for tiled so that gtk+ can
benefit from this.

https://bugzilla.gnome.org/show_bug.cgi?id=766860
2016-06-08 14:54:41 +02:00
Rui Matos
2292458f5e wayland/*-shell: UTF-8 validate title, class and app ID strings
The protocol says these must be UTF-8 so let's ensure they are.

https://bugzilla.gnome.org/show_bug.cgi?id=752788
2016-06-07 20:17:39 +02:00
Rui Matos
d62491f46e x11/window-props: Convert WM_NAME and WM_CLASS to UTF-8
gjs throws exceptions on non UTF-8 strings which, in some cases, crash
gnome-shell. ICCCM string properties are defined to be Latin-1 encoded
so we can try to convert them to avoid it.

Note that _NET_WM_NAME is defined to be UTF-8 and we already validate
it in utf8_string_from_results() .

https://bugzilla.gnome.org/show_bug.cgi?id=752788
2016-06-07 20:17:38 +02:00
Rui Matos
8f7a36c53f window: Don't create invalid UTF-8 window description strings
printf string precision counts bytes so we may end up creating invalid
UTF-8 strings here. Instead, use glib's unicode aware methods to clip
the title.

https://bugzilla.gnome.org/show_bug.cgi?id=765535
2016-06-07 20:17:37 +02:00
Florian Müllner
8d7ae52565 stage: Fix function definition 2016-06-02 16:10:42 +02:00