1
0
Fork 0
Commit graph

5409 commits

Author SHA1 Message Date
Rui Matos
dac30a222e input-settings-x11: Honor default value for click method setting
Now that xf86-input-libinput exposes default values we can honor the
gsettings value.

https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-05-08 17:44:59 +02:00
Rui Matos
7d1b593fbd input-settings-x11: Factor out a get_property() helper
We'll need to get the value of some properties. Fail if the number of
items returned is less than we expect and warn if it exceeds it so
that we can easily find out if items are added to a property later and
fix it.
2015-05-08 17:44:57 +02:00
Carlos Garnacho
d6a7559750 wayland: Fix c&p typo in wl_listener notify callback
The corresponding wl_notify field for destroy_data_device_icon()
is drag_grab->drag_icon_listener, otherwise we're fetching a pointer
that's slightly off where we want.
2015-05-01 18:50:06 +02:00
Rui Matos
d478d8f143 core/events: Invalidate monitor cache when we're a wayland compositor
When running as an X11 compositor we do this for every event we see on
the X event stream. As a wayland compositor we don't go through that
code path but since we see all events we can easily do this on motion
events.

In fact, we don't even need this caching when we're a wayland
compositor since we can always find where the pointer is without a
round trip but we're sharing the current monitor logic with the X
path so let's keep it as is for now.

https://bugzilla.gnome.org/show_bug.cgi?id=748478
2015-04-30 14:01:23 +02:00
Rui Matos
7eca43cec9 monitor-manager-kms: Avoid a couple of potential crashes
The drm API can return NULL and we could end up using uninitialized
memory if the driver private struct isn't cleared.
2015-04-28 18:00:45 +02:00
Rui Matos
9060190555 monitor-manager-kms: Read crtc props after determining the crtc ID
Otherwise we can't read the properties.
2015-04-28 18:00:44 +02:00
Jasper St. Pierre
0de3869656 core: Remove unused function 2015-04-27 18:14:15 -07:00
Jasper St. Pierre
9f13033f15 window-wayland.[ch] => meta-window-wayland.[ch]
This finishes off the meta- prefix for wayland/.
2015-04-27 18:09:16 -07:00
Jasper St. Pierre
48bf807430 monitor-manager-kms: Add support for underscan 2015-04-27 17:58:38 -07:00
Jasper St. Pierre
c68e43a97f monitor-manager-xrandr: Set the underscan border properties, too 2015-04-27 17:23:56 -07:00
Tomeu Vizoso
cc53d48fa8 MonitorManager: Add support for overscan compensation
Some DRM drivers have added a consistent set of properties that
allow compensating for the overscan that some TVs do, without the
user being able to disable.
2015-04-27 17:17:15 -07:00
Jasper St. Pierre
ca6e799b97 Move atomnames.h to x11/
This should *not* be part of the public API.
2015-04-27 16:36:56 -07:00
Jasper St. Pierre
0f8e387dc0 monitor-config: Allow loading from a system file 2015-04-27 16:31:11 -07:00
Rui Matos
d62c595e51 events: Ignore some event types when reseting idle time
These events don't result from actual hardware events so we shouldn't
use them to reset idle time.

https://bugzilla.gnome.org/show_bug.cgi?id=748541
2015-04-27 19:44:58 +02:00
Jasper St. Pierre
dd3cf94744 Properly implement wl_shell_surface's poor surface commit semantics 2015-04-25 11:19:25 -07:00
Ray Strode
eb56e0a3d7 xwayland: plug some leaks in stop function
This commit makes sure the lockfile and display
name are freed in meta_xwayland_stop.

https://bugzilla.gnome.org/show_bug.cgi?id=748380
2015-04-23 13:51:11 -04:00
Ray Strode
8937c32cd5 xwayland: rename lockfile to lock_file
The missing underscore is inconsistent with the
coding style of the surrounding code.

https://bugzilla.gnome.org/show_bug.cgi?id=748380
2015-04-23 13:51:11 -04:00
Ray Strode
a8a5da768a xwayland: don't unlink lock file twice in stop function
The stop function currently manually constructs the lock
filename from the display number and also calls unlink
on the same, already known lock filename from the manager
struct.

This commit gets rid fo the manual construction in favor
of the saved lock filename.

https://bugzilla.gnome.org/show_bug.cgi?id=748380
2015-04-23 13:51:11 -04:00
Ray Strode
33bfcf56ce xwayland: free lockfile in start function on error
Right now we just leak the lockfile.

https://bugzilla.gnome.org/show_bug.cgi?id=748380
2015-04-23 13:51:11 -04:00
Ray Strode
40cccb58a5 xwayland: use out label for cleanup in start function
The start function has a few exit paths that need to
perform clean up of the lock file.

This commit consolidates those exit paths at the end
using an out label and gotos.

https://bugzilla.gnome.org/show_bug.cgi?id=748380
2015-04-23 13:51:11 -04:00
Jonas Ådahl
eb6c70137b wayland: Add and implement set/unset_modal for the gtk_surface interface
Add set_modal ond unset_modal to the gtk_surface interface. When a
surface is modal, the compositor can treat it differently from non-modal
dialogs, for example attach it to the parent window if any. There is
currently no changes to input device focus; it is up to the client to
ignore events to the parent surface that is wanted.

This bumps the gtk_shell version to 2.

https://bugzilla.gnome.org/show_bug.cgi?id=745720
2015-04-23 16:02:37 +08:00
Jonas Ådahl
df3b412a25 wayland: Kill clients who try to bind an incompatible gtk_shell version
gtk_shell is not backward compatible, and clients binding to it should
check whether the advertised version is the same as the client supports.

https://bugzilla.gnome.org/show_bug.cgi?id=745720
2015-04-23 16:02:37 +08:00
Jonas Ådahl
cfba0a5dfc wayland: Sync protocol/gtk-shell.xml from GTK+
Had added a new capability enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=745720
2015-04-23 16:02:37 +08:00
Ondrej Holy
3561b46fc6 backends/x11: Fix set_scroll_button
There is copy&pasted code in set_scroll_button, which is apparently
wrong, because it is trying to set scroll method instead of the scroll
button...

https://bugzilla.gnome.org/show_bug.cgi?id=747967
2015-04-17 10:50:33 +02:00
Carlos Garnacho
8dfb88b669 backend: Apply the right settings to the right input devices
Since 8769b3d55, the checks performed on which update_* function was
called for each device got quite more lax, leading to failed asserts
on code that assumed the previous behavior.

Change update_[mouse|touchpad|trackball]_* to bail out early if the
device received has not the right type, and remove the asserts.

https://bugzilla.gnome.org/show_bug.cgi?id=747886
2015-04-15 13:33:12 +02:00
Florian Müllner
2e3086e2aa screen: Add public method to get neighboring monitor
The existing private get_monitor_neighbor() function returns a
MetaMonitorInfo, which is private as well. Add a public wrapper
that returns a monitor index instead, as we do for other public
monitor-related methods.

https://bugzilla.gnome.org/show_bug.cgi?id=633994
2015-04-14 23:13:19 +02:00
Rui Matos
cfb7297cf1 input-settings: Silence a glib critical
The scroll-wheel-emulation-button key is 'i' in the schema but it also
specifies a minimum range of 0 so using get_int() and casting is safe.
2015-04-14 18:27:52 +02:00
Rui Matos
8769b3d554 input-settings: Ensure that we always apply the same set of settings
This makes the hotplug and coldplug paths the same so that we don't
miss out on any setting.

https://bugzilla.gnome.org/show_bug.cgi?id=747434
2015-04-14 16:20:15 +02:00
Jasper St. Pierre
f8b82c376c cursor-tracker: Emit cursor-changed when XFixes tells us about it
Otherwise, we won't update the cursor in the magnifier / screen recorder
under X11.
2015-04-13 16:58:27 -07:00
Jonas Ådahl
868e1427a8 wayland: Rework synchronized state application semantics
When a parent of a subsurface gets it state applied (either by a
wl_surface.commit, wl_subsurface.set_desync or a recursive
wl_surface.commit on a parent surface), the pending position state
of the subsurface should be applied. If the subsurface is in effective
synchronized mode (i.e. if its in explicit synchronized mode or any of
its parent surfaces is a subsurface in explicit synchronized mode), the
cached state should also be applied at this point, including its
subsurface children, recursively.

https://bugzilla.gnome.org/show_bug.cgi?id=743617
2015-04-10 09:15:12 +08:00
Rui Matos
4aa74af694 wayland-keyboard: Disconnect from backend signals on release
Otherwise we'll access freed memory in the handlers.

The wayland keyboard is released when the seat loses the keyboard
capability which happens when leaving the VT so if there are keymap
changes while switched away from the VT we would crash.

https://bugzilla.gnome.org/show_bug.cgi?id=747263
2015-04-02 23:21:22 +02:00
Jasper St. Pierre
f3fecd478d frame: Always use the client window's visual for our frame
Since the frame is the window that's redirected, there's no reason for
it to match the root window. There *is*, however, a big incentive to
match the window's visual, since not doing so might trigger automatic
redirection.

On a specific platform, we construct a depth-32 root window, and stick a
depth-24 child window inside it. The frame ends up being created
depth-32, not depth-24, so we get automatic redirection.
2015-04-01 15:02:20 -07:00
Ray Strode
a5d1f67c34 wayland: try 50 times to create lock file again for login screen
since commit 8c16ac47c1, we started
creating the login screen on display 1024 instead of display 0.

This defeats this logic in try_display:

    display++;
    /* If display is above 50, then something's wrong. Just
     * abort in this case. */
    if (display > 50)

In practice it doesn't matter much since we only have one login
screen in most setups, but we should still fix the bug.

This commit introduces a separate counter to keep try of 50 tries,
rather than assuming "display number == number of tries".

https://bugzilla.gnome.org/show_bug.cgi?id=746545
2015-04-01 10:30:24 -04:00
Jasper St. Pierre
102fa0e373 xwayland: Don't leak the launcher 2015-03-31 11:47:34 -07:00
Jonas Ådahl
dbca3337b2 wayland: Fix damage of infinite regions
To avoid integer overflow when scaling "infinite" regions (0, 0)
(INT32_MAX, INT32_MAX), intersect with the surface rect before scaling,
instead of intersecting with the buffer rect afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=746510
2015-03-31 15:09:13 +08:00
Rui Matos
939f7ce781 meta-stage: To change the stage state we need to set the event type
https://bugzilla.gnome.org/show_bug.cgi?id=746670
2015-03-30 13:42:56 -04:00
Carlos Garnacho
c6e6ed87c5 backends: Center pointer on primary monitor on startup
This seems nicer/tidier than the current X11 (center on the span of all
monitors) or native (so close to the activities corner it's hard not
to trigger it) platform behaviors.

This code also takes over the native-specific pointer warping that
happens when the pointer was over a removed output.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Carlos Garnacho
8188cddcf7 backends: Add meta_monitor_manager_get_monitor_at_point()
This function returns the monitor_info index corresponding to the given
coordinates, or -1 if none is found at that point. The native backend
has been changed in places where it could make use of this function.

https://bugzilla.gnome.org/show_bug.cgi?id=746896
2015-03-30 14:00:31 +02:00
Ray Strode
9f17c05a15 wayland: manually activate/deactivate stage when taking/dropping grab
clutter currently never emits activated or deactivated signals on
the stage object when using the EGL backend. Since the stage never
gets activated, accessibility tools, like orca, don't work.

This commit makes mutter take on the responsibility, by tracking
when the stage gains/loses focus, and then synthesizing stage
CLUTTER_STAGE_STATE_ACTIVATED state events.

A limitation of this approach is that clutter's own notion of
the stage activeness won't reflect mutter's notion of the
stage activeness.  This isn't a problem, in practice, and can
be addressed in the medium-term after making changes to
clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=746670
2015-03-28 11:20:48 -04:00
Jasper St. Pierre
d4e8d97e58 xwayland: Port to GSubprocess 2015-03-27 13:58:56 -07:00
Jasper St. Pierre
a86368dcb1 xwayland: Prevent some boolean confusion
The original code in Weston that this was ported from returned an errno,
not a boolean, so we were inadvertently returning TRUE here during an
error path. Fix that up.
2015-03-27 13:58:56 -07:00
Giovanni Campagna
a13f906ed1 prefs: connect to changed:: before reading the value of a setting
Otherwise glib might skip registering to change notifications

https://bugzilla.gnome.org/show_bug.cgi?id=746509
2015-03-27 13:15:30 -07:00
Ondrej Holy
f9e91bf007 backends/native: Fix scroll method enums
The enums are swapped currently, because for edge scroll is enabled two finger
scroll and similary for two finger scroll is enabled edge scroll, what is
apparently wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=746870
2015-03-27 13:08:11 +01:00
Rui Matos
7c5fe42835 meta-background: Add a function to refresh all background instances
We need to reload the FBOs under some circumstances, this adds a way
to easily do so.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2015-03-25 11:48:32 +01:00
Jonas Ådahl
aac5a5dcaf MetaMonitorManager: Fix comment
https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-03-25 12:30:11 +08:00
Jonas Ådahl
7b79c44608 wayland: Don't skip notifying about initial maximized size
When a client wants to start initialized it my set the maximized state
before having attached any buffers. Before we'd not notify the client of
the new expected size if the previous size was 0x0 as it would normally
mean we'd resize to 1x1, but since this is not always the case, only
avoid notifying the client if the previous size was 0x0 and the result
is 1x1.

https://bugzilla.gnome.org/show_bug.cgi?id=745303
2015-03-17 13:51:11 -04:00
Florian Müllner
57c1078ee7 theme: Scale window decorations on HiDPI displays
As we opt out of GTK+/Clutter's HiDPI handling, we need to apply the
window scaling factor manually to decorations, both the geometry and
when drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=744354
2015-03-17 17:09:48 +01:00
Carlos Garnacho
3a2920d4bc backends/x11: Implement set_click_method configuration option
https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Carlos Garnacho
ad13fa3bb3 backends/native: Implement set_click_method configuration option
https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Carlos Garnacho
9b50119d31 backend: Add set_click_method MetaInputSettings vfunc
This will configure the libinput_config_click_method for touchpads.

https://bugzilla.gnome.org/show_bug.cgi?id=746290
2015-03-16 18:05:51 +01:00
Carlos Garnacho
3ff6316562 wayland: Protect against unordered destruction of surface resources
If the wl_surface resource happens to be destroyed before any other
role resource, the destructor for the latter will attempt to
access/modify random memory.

Fix this by ensuring the associated resources are destroyed on the
wl_surface destructor, this will free all associated memory and
remove the resources ahead of their imminent destruction.

https://bugzilla.gnome.org/show_bug.cgi?id=745734
2015-03-16 18:02:43 +01:00
Rui Matos
43058a3698 monitor-manager-kms: Tell cogl to ignore CRTCs when DPMS isn't ON
Otherwise cogl will try to page flip and fail.

https://bugzilla.gnome.org/show_bug.cgi?id=746098
2015-03-16 16:32:56 +01:00
Ray Strode
8c16ac47c1 wayland: don't let the login screen steal :0
In 3.16, GDM keeps a login screen running on vt1.
This login screen starts an Xwayland instance.
Since it's the first X server to start, it gets
the prized :0 display number.

This commit works around that problem, for now,
by having GDM's display number start at 1024.

https://bugzilla.gnome.org/show_bug.cgi?id=746295
2015-03-16 11:08:45 -04:00
Jasper St. Pierre
4fc684b2ed window: Don't use C++-style comments 2015-03-14 16:03:44 -07:00
Carlos Garnacho
d63b9a1797 core: Unset all input events on the GDK connection
With all input events being handled through clutter, this only confuses
things, and most nominally, coerces touch events through places we didn't
intend to, like the window frame.

This makes again all touch events only handled in the passive grab on X11,
while the rest stays pointer (emulated) only.

https://bugzilla.gnome.org/show_bug.cgi?id=745335
2015-03-14 16:03:44 -07:00
Jasper St. Pierre
6d72b7c017 ui: Remove device events from X11 mask
These interfere with our touch handling.
2015-03-13 13:28:33 -07:00
Jasper St. Pierre
656fe49dbe ui: Fix undefined variable warning
gcc is super smart and notices that we don't have a default case here.
2015-03-13 13:28:33 -07:00
Carlos Garnacho
3471ef3441 backend: Update cursor visibility based on device availability
On startup, the cursor is kept hidden if there's any touchscreen available.
If the device that was last interacted is removed, we check on available
pointing devices though, so we don't possibly hide the pointer if there are
further mice/touchpads/etc.

Devices being added don't update cursor visibility, we wait for the user
interacting with those instead.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:04:01 +01:00
Carlos Garnacho
af9d8f1931 backends/x11: Call meta_backend_update_last_device() from XI_DeviceChanged
On X11, calling this function on meta_display_handle_events() will not catch
mouse events happening over clients, so poke directly in the backend for
XI_DeviceChanged events, which mutter will get on device switches.

The code has been slightly refactored so we deal with XIEvents at a single
handle_input_event() function.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Carlos Garnacho
a30ca3e62f core: Update cursor visibility on display events
https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Carlos Garnacho
9e3bac0237 backend: Add meta_backend_update_last_device()
This function can be used to trigger changes depending on the device type
that is currently emitting the events. So far, it is used to switch cursor
visibility on/off on touchscreen interaction.

A "last-device-updated" signal has also been added, in order allow hooking
other behavior changes (eg. OSK) when the last device changes.

https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Florian Müllner
67a30b7a89 window-x11: Fix height computation of shaded windows
Since commit 6e06648f7, we start out with the invisible frame parts
only, and then add the unconstrained rect's height (which consists of
the visible parts of both frame and client window) *unless* the window
is shaded. While we indeed don't want to add the client height in that
case, we need to explicitly include the visible frame parts now.

https://bugzilla.gnome.org/show_bug.cgi?id=746145
2015-03-13 14:08:12 +01:00
Carlos Garnacho
68ba45bcb2 Revert "x11: Cut some slack to clients doing slow draws/resizes"
As per https://bugzilla.gnome.org/show_bug.cgi?id=740424#c12

This reverts commit 94c3c8f412.
2015-03-12 18:41:57 +01:00
Florian Müllner
6bacbac656 theme: Stop clipping titlebar buttons
There is no good reason to do so, besides a nice way to check whether
a particular button is enabled. However there are legitimate reasons
for overdrawing like box-shadows or outlines, so remove the clip.
2015-03-11 15:26:06 +01:00
Marek Chalupa
5636784604 native: make sure the pointer is in the visible area after init
The initial pointer position is set by clutter. At the moment it
is the point 16x16 on the screen. But this point is not always
in the visible area on monitors (the monotors can be arranged in
many different ways).

https://bugzilla.gnome.org/show_bug.cgi?id=745752
2015-03-09 14:26:34 +01:00
Rui Matos
9a3b178da1 backend-native: Ensure the pointer is visible on monitors-changed
Otherwise the pointer might be "lost" outside the visible area. Note
that the constraining code only ensures the pointer doesn't leave the
visible area but if the pointer is already outside because the rug was
pulled under it then it doesn't do anything.

https://bugzilla.gnome.org/show_bug.cgi?id=745121
2015-03-09 14:26:17 +01:00
Jasper St. Pierre
cca68b31b1 frames: Refactor out another inner switch 2015-03-08 20:38:30 -07:00
Jasper St. Pierre
85452aff4f frames: Refactor control handling with a switch statement 2015-03-08 20:38:30 -07:00
Jasper St. Pierre
d9d83abae2 frames: Refactor frame button click handling code a title bit 2015-03-08 20:38:30 -07:00
Jasper St. Pierre
0bc6cb2aeb window: Remove the legacy get_outer_rect
It's unused in gnome-shell, and we don't care about compatibility in the
API. Don't expose it.
2015-03-08 20:38:30 -07:00
Carlos Garnacho
94c3c8f412 x11: Cut some slack to clients doing slow draws/resizes
The timer to blacklist the window from frame sync is set at the time of
issuing the sync request, but not removed until the client replies to
the most recent wait serial.

This means that if the client is slowly catching up, the timeout would
fire up regardless of the client slowly updating the alarm to older
values.

Fix this by ensuring the timeout is reset everytime the sync request
counter is updated, to acknowledge the client is not irresponsive,
just slow.

https://bugzilla.gnome.org/show_bug.cgi?id=740424
2015-03-05 17:07:32 +01:00
Carlos Garnacho
d3988c04d6 wayland: Destroy pending frame callbacks when destroying a surface
MetaWaylandFrameCallback has been added a surface field, which is then
checked when destroying the surfaces. This prevents unintended callbacks
to run after a surface has been destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=745163
2015-03-05 17:07:32 +01:00
Horst3180
e5d97666af Add style classes to the titlebuttons
https://bugzilla.gnome.org/show_bug.cgi?id=745108
2015-03-04 20:58:27 +01:00
Alban Browaeys
f858f66fe0 MetaBackgroundActor: glsl: do not mix int and float.
Implicit conversion from int to float is not supported by
GLSL ES.

Fixes:
(gnome-shell:8954): Cogl-WARNING **: Shader compilation failed:
1:2: P0004: High precision not supported, instead compiling high precision as medium precision
4:17: S0001: Type mismatch in arithmetic operation between 'int' and 'float'
when one trigger the overview mode on Mali 400 r1p1 GPU.

https://bugzilla.gnome.org/show_bug.cgi?id=745442
2015-03-03 22:09:35 +01:00
Jonas Ådahl
fffb863f37 wayland: Sync surface actor state when changing main monitor
In order to switch to the correct surface actor scale given the monitor
the surface is on, without relying on the client committing a new state
given some other side effect, sync the surface actor state when the main
monitor associated with the corresponding window changed.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Jonas Ådahl
adf7c0e730 wayland: Fix surface damage region scales
Use the correct scale when processing damage from the client.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Jonas Ådahl
bbcee174ce wayland: Make the surface actor set its own state
Since the surface actor knows more about how it draws itself, instead of
pushing texture state (buffer and scale), input region and opaque region
from MetaWaylandSurface after having transformed into what the surface
actor expects, make the surface actor set its own state given what state
the Wayland surface is in.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Rui Matos
9c6e6ea381 monitor-manager-kms: Fix a crash getting a crtc-less output's scale
https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:56 +01:00
Rui Matos
db9645fcb3 monitor-manager-kms: Cope with non-existent connectors and encoders
DRM objects like connectors and encoders might change at any time, in
particular they might become invalid between drmModeGetResources() and
getting the actual objects in which case they'll be NULL. Be defensive
against that.

Note that, if this happens, we should get another udev event soon
which will cause us to update our state.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:55 +01:00
Rui Matos
6af48d75a4 monitor-manager-kms: Don't store a list of encoders
It's not needed outside of read_current() and current_encoder is
totally unused.

https://bugzilla.gnome.org/show_bug.cgi?id=745476
2015-03-02 18:48:53 +01:00
Marek Chalupa
6234f7d1db native: fix pointer constraining
fix copy-paste mistake in computing bottom constrain.
Also save few instructions by moving setting of
always-the-same value off loop.

https://bugzilla.gnome.org/show_bug.cgi?id=727337
2015-03-02 16:00:49 +01:00
Jonas Ådahl
301a65e05a backends/dummy: Set scale of dummy output
To make the nested compositor mode work again after "backends/native:
Calculate the output scale in here", set the scale when creating the
dummy output.

https://bugzilla.gnome.org/show_bug.cgi?id=745401
2015-03-02 10:58:16 +08:00
Jasper St. Pierre
78d8525699 backends/native: Calculate the output scale in here
It makes more sense as a backend thing, not a frontend thing.
2015-02-26 00:13:28 -08:00
Jasper St. Pierre
23c00688b4 launcher: Fix a gcc warning
self could be returned uninitialized.
2015-02-26 00:13:16 -08:00
Rui Matos
438410c22c window-wayland: Set transient and window type on manage() for popups
Doing this on manage() allows the common MetaWindow initialization to
do the right thing for popups like setting skip_taskbar and
skip_pager.

In particular this avoids gnome-shell's app tracker to create a new
ShellApp instance for every popup.

https://bugzilla.gnome.org/show_bug.cgi?id=745118
2015-02-25 18:25:42 +01:00
Rui Matos
59f348eb11 wayland-surface: Keep a reference to a popup's parent surface
This will allows us to access the parent while constructing the
MetaWindow.

https://bugzilla.gnome.org/show_bug.cgi?id=745118
2015-02-25 18:25:42 +01:00
Ray Strode
cbad65f657 native: don't leak logind session proxy
It's currently getting leaked in error paths

https://bugzilla.gnome.org/show_bug.cgi?id=745141
2015-02-25 10:56:50 -05:00
Jasper St. Pierre
adccbc9b7b wayland-outputs: Respect the scaling-factor override
This allows someone to explicitly set a scaling factor that overrides
the computed scale for all outputs.
2015-02-22 11:09:27 -08:00
Jasper St. Pierre
94b111cf6c wayland-outputs: Use the wrappers for post_event 2015-02-22 11:09:27 -08:00
Ray Strode
96b202c80d wayland: add keybindings for VT8-VT12
We currently only support switching to 1-7.
This commit brings us parity with X, and let's
us switch to all 12.

https://bugzilla.gnome.org/show_bug.cgi?id=744800
2015-02-19 16:42:58 -05:00
Jasper St. Pierre
0ac2f61a2c screen: Don't map the COW on Wayland
This is unnecessary, and since we don't shape it, we get a giant input
window covering the rest of our windows.
2015-02-18 12:42:32 -08:00
Ray Strode
2aa6dcd9d8 wayland: don't try to use seat devices that aren't (yet) present
Before commit ac448bd42b the pointer,
keyboard, and touch objects were initialized when the seat was created.
Now they're initialized later, when the clutter device manager finds and
loads them.

This commit makes sure we don't try to access those objects if they
aren't initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=744640
2015-02-18 11:52:13 -05:00
Carlos Garnacho
469b85eb7c data-device: Set "dnd" role on the icon surface, not the source one
The DnD source surface evidently has other role assigned, it's the
icon surface which is supposed to be a fresh one.
2015-02-18 17:32:38 +01:00
Ray Strode
673ddfde04 wayland: discard non-seat events sent to the seat
The wayland seat event handlers get sent events that
aren't strictly interesting to them (such as events for
hardware devices the seat doesn't support and events for
virtual devices that the seat needs to ignore).

This commit makes sure all uninteresting events get ignored.
2015-02-18 11:20:36 -05:00
Ray Strode
56ca7eeb65 wayland: treat touchpads like mouse devices
They both serve the same purpose of moving
the pointer around, so they both should be
considered pointer devices on the seat.
2015-02-18 11:19:17 -05:00
Jasper St. Pierre
af9072e725 backend: Add a hack to force the dummy monitor manager
This is helpful when testing mutter under Xephyr.
2015-02-17 23:45:02 -08:00
Jasper St. Pierre
9b903e93e3 iconcache: Fix the icon of Kerbel Space Program
Kerbel Space Program, and perhaps some other SDL-based programs, use
a really dumb way of specifying icons, which is totally
non-standards-compliant.

The ICCCM specifies that the icon_pixmap field of WM_HINTS should be a
1-bit-deep Pixmap, but we've seen applications set it to a pixmap of the
root depth as well, so we support that.

Kerbel Space Program seems to use it with a 32-bit depth Pixmap,
signifying ARGB32 (which it is), along with a 1-bit icon_mask, which
crashes us.

Keep in mind that Pixmaps, by definition, have no Visual attached, so
we simply have to make a guess at the correct visual based on the
depth. Do that by assuming that a depth-32 visual always means ARGB32,
which is a pretty safe bet.
2015-02-17 23:45:02 -08:00
Jasper St. Pierre
7966f00a18 iconcache: Fix a dumb thinko
This is an xlib surface, not an image surface.
2015-02-17 23:45:02 -08:00
Jonas Ådahl
9a99a80710 wayland: Fail clients who try to create or destroy a not-top-most popup
If a client creates an xdg_popup given a parent that is a xdg_popup that
is not the most top one in the grab chain, send the
not_the_topmost_popup error.

Also fail a client who destroys a popup that is not the top most one.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
be77874ec9 wayland: Unmap popup windows when a popup chain is dismissed
When dismissing a popup grab, always unmap every popup window in the
chain, instead of relying on the surfaces and xdg_popups being
destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
768286bffb wayland: Move out popup logic to its own file
We'll want to expose popup logic outside of meta-wayland-pointer.c and
one day we'll also probably want to add touch support for popups, so
lets move it to its own file. There are no significant semantical
changes, only refactoring.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
f5c65d9ea1 wayland: Check the serial when creating popups
Send popup_done immediately if the serial is incorrect so the client can
destroy its resources.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
f328890ed1 wayland: Fail when popup parent does not have an allowed role
An xdg_popup may only have another xdg_popup or xdg_surface as a parent,
so send an error if it provides an invalid parent.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
945bf626c6 wayland: Introduce MetaWaylandSurfaceRole
Introduce surface roles and use it to ensure a surface never changes
role.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Jonas Ådahl
f6869bbbc2 wayland: Update to xdg-shell unstable version 5
Updates the function type signatures and version number. The rest will
come as separate commits.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
2015-02-17 22:14:47 +08:00
Cosimo Cecchi
11a9b4baa0 window-props: use memcmp() to compare GtkBorder structs
Saves some code.

https://bugzilla.gnome.org/show_bug.cgi?id=744500
2015-02-13 15:49:03 -08:00
Jasper St. Pierre
de71fd0941 theme: Remove old metacity theme-format version macros 2015-02-11 17:56:02 -08:00
Jasper St. Pierre
87c973c260 theme: Make certain MetaFrameLayout functions static 2015-02-11 17:50:29 -08:00
Jasper St. Pierre
644ab0e270 theme: Remove unused memory management functions 2015-02-11 17:49:38 -08:00
Jasper St. Pierre
3142220443 theme: Remove old comment about metacity themes
These are obviously no longer supported.
2015-02-08 13:06:23 -08:00
Jasper St. Pierre
1f0ed5483a Revert "Revert "wayland-pointer: Just use the pointer actor instead of doing a full repick""
The Clutter bug has now been fixed.

This reverts commit ead79f834c.
2015-02-06 09:45:34 -08:00
Chris Wilson
72f5a36522 compositor: Update composite overlay window before unredirecting
The current ordering updates the clip shape of the composite overlay
window after unredirecting the target window. This has the effect of
forcing X to clear the target window and sending an expose to the
application to repaint - causing an unsightly flash. If we update the
shape first, then unredirect, X restores the background of the root
window (sending no expose events as no one is interested) and the
background is typically NONE for the root window. Then the unredirect
paints the contents of the composite backing pixmap over top without
requiring a round trip and waiting for the client to repaint - thus no
flashing.

Fixes regression from

commit d6282716b2
Author: Jasper St. Pierre <jstpierre@mecheye.net>
Date:   Fri Dec 6 17:10:44 2013 -0500

    compositor: Simplify the unredirected window management code

Cc: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=743858
2015-02-02 15:41:24 +01:00
Rui Matos
7f19db1f7b monitor-manager: Expose a method to get a monitor from an output
This method will be used by gnome-shell to resolve an output ID
(exposed from the org.gnome.Mutter.DisplayConfig DBus API) to a
logical monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Jasper St. Pierre
05353c1f7e frame: Don't redraw immediately when we resize
We're locked to frame sync anyway, so it doesn't make sense to try to
redraw early. In casual testing, this seems to actually make things
faster, as well.
2015-01-30 13:13:49 -05:00
Jonas Ådahl
4d23e7c202 wayland: Fix caching of surface state
The commit 97a69cee5a broke the caching of
the surface state when because the frame_callback_list target state was
overwritten after the content had been moved to it.

This commit fixes it by moving the frame list addition after the copy. We
also need to initialize the list since the plain copy put garbage in it.

https://bugzilla.gnome.org/show_bug.cgi?id=743678
2015-01-29 15:48:46 +08:00
Rui Matos
ad90b7dd2f monitor-manager: Initialize MetaOutput even when we can't get the EDID
Otherwise we'll crash later when building a MetaConfiguration.

https://bugzilla.gnome.org/show_bug.cgi?id=743412
2015-01-27 14:42:45 +01:00
Florian Müllner
a2ff8f4e1e stack: Fix a leak 2015-01-21 14:52:55 +01:00
Florian Müllner
e294f6df8c window-x11: Fix typo 2015-01-21 13:27:09 +01:00
Florian Müllner
422ddeddb9 window-x11: Remove duplicated condition
The outer block already checks for window->frame, so don't repeat
it.
2015-01-21 13:27:09 +01:00
Rui Matos
764c3dd137 display: Fix moving grab op check
We were regarding META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN as a move.

https://bugzilla.gnome.org/show_bug.cgi?id=743254
2015-01-20 17:49:27 +01:00
Jasper St. Pierre
7e7c8ecbd4 backend-x11: Also spoof Enter/Leave notifies as well
So that we track when the user enters/exits the frame window
appropriately. This fixes a rogue cursor appearing when the window
doesn't define one.
2015-01-19 21:56:32 -08:00
Jasper St. Pierre
d561b3b18f frames: Clutterify frame event handling
This lets us remove our horrible X11-based, GDK-based hacky frame event
handling in favor of a more sane one in Clutter.
2015-01-19 21:56:08 -08:00
Jasper St. Pierre
ce14bde08d frames: Remove the destroy_event handler
It does nothing.
2015-01-19 21:52:41 -08:00
Florian Müllner
b91461ee39 place: Fix workspace check when collecting relevant windows
When looking for space to place a new window, other non-minimized
windows on the same workspace should be taken into account. However
the current check does not work correctly when the placed window is
located on all workspaces, so handle that case explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=743217
2015-01-20 00:00:32 +01:00
Jonas Ådahl
22c13b3144 plugins/Makefile.am: Don't fail when trying to remove nonexisting file
https://bugzilla.gnome.org/show_bug.cgi?id=743189
2015-01-19 09:37:54 -08:00
Jonas Ådahl
db384a656c backends/native: Implement support for pointer barriers
When running as a dispay server pointer barriers are a server side
feature and requires no client interaction of any sort. This patch
implements pointer barriers that can be used when running as a display
server on the native backend. Running as a display server using the X11
backend is currently not supported.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-19 02:27:59 -08:00
Carlos Garnacho
1dea1813b1 input-settings: Handle device-to-output mapping
For each device that can be mapped (touchscreens, tablets), the output
will be fetched from settings and matched with the currently connected
ones. If a match is found, the device matrix will be found out from the
output configuration and set on the device.

This is also updated both individually for newly connected devices, and
collectively on output configuration changes.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
71c4138933 monitor-manager: Add method to find an output matrix
This will be useful to determine input device matrices for touchscreens
and tablets.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
9d73b4efbb wayland: Use the new keyboard settings location for repeat settings
This makes keyboard repeat in clients in-sync with the input config changes.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
049f67df0a native: Remove previous listener for keyboard settings
The settings-daemon peripherals schemas are going away, and this is
now handled through MetaInputSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
2d878d3f55 backends/native: Add libinput-based MetaInputSettings implementation
The libinput_device is fetched from the ClutterInputDevice, and configured
through the libinput_device_*config* API.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
3c06f2dc90 backends/x11: Implement X11-specific MetaInputSettings
This goes through modifying XI2 device properties, either common ones (eg.
set on every device) or those specific to the libinput X11 driver. Keyboard
repeat/rate are set through core and XKB APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Carlos Garnacho
460e1fd7ca backends: Add MetaInputSettings
This object internally keeps track of the relevant input configuration,
and goes through its vmethods in order to apply the configuration on the
backend-specific devices.

So far, only mouse/touchpad settings are actually attached to GSettings
changes. ::set_matrix(), meant for tablets/touchscreens, is not hooked
yet.

One caveat is that meta_input_settings_create() may return NULL if the
backend does not own the windowing system (wayland nested on X11 being
the one case), and thus device settings can't be changed freely.

https://bugzilla.gnome.org/show_bug.cgi?id=739397
2015-01-18 13:32:28 -08:00
Jasper St. Pierre
f083935c6e barrier: Fix type cast macros 2015-01-18 13:32:28 -08:00
Jasper St. Pierre
5c66bee84b display: Remove ungrab_should_not_cause_focus_window
It's been unused ever since we removed tabpopup.c
2015-01-17 17:55:36 -08:00
Jasper St. Pierre
ef32bbdc99 x11/barrier: Fix build
We were missing the get_type() function.
2015-01-17 17:42:48 -08:00
Jonas Ådahl
5f91a62f6f barriers: Separate implementation from public API
This patch removes the X11 specific code from MetaBarrier and creates an
abstraction layer MetaBarrierImpl. The existing X11 implementation is
moved to a new GObject MetaBarrierImplX11 implementing the abstract
interface MetaBarrierImpl which is instantiated by MetaBarrier when
supported.

While at it, move it to backends/ and properly name the files.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-17 17:22:57 -08:00
Jonas Ådahl
152b2dab59 barrier: Make X related hook more clearly named
https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-17 17:22:56 -08:00
Carlos Garnacho
625d3de2ee backends: Make KMS EDID information equal to X11's
EDID parsing has been refactored to a common meta_output_parse_edid()
function, which ensures the extracted information is the same on both KMS
and X11 backend, so it can be used consistently on eg. settings values.

https://bugzilla.gnome.org/show_bug.cgi?id=742882
2015-01-14 12:16:18 +01:00
Florian Müllner
f71315eb1e frames: Fix window-type/frame-type mix-up
Commit 7e66d2a484 killed off META_CORE_GET_FRAME_TYPE, but got
the replacement wrong - MetaWindowType is an enum like MetaFrameType,
but the two are not interchangeable.

https://bugzilla.gnome.org/show_bug.cgi?id=742841
2015-01-13 18:14:26 +01:00
Rui Matos
0484ef142d MetaWindow: Change icon properties to be of pointer type
Follow up to commit af7f51b992 .

https://bugzilla.gnome.org/show_bug.cgi?id=742824
2015-01-13 16:01:13 +01:00
Rui Matos
6609d9c6a4 iconcache: Fix icon data copy into cairo surface
The stride is in bytes but we're copying ints.

https://bugzilla.gnome.org/show_bug.cgi?id=742825
2015-01-13 16:01:13 +01:00
Marek Chalupa
b6d070b06f wayland: Seal SHM buffers before access
If wayland client lies about size of given buffer, compositor could touch bad
memory and get SIGBUS. Wayland provides simple API to fix it - so fix it!

[1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-server.h#n416
[2] http://lists.freedesktop.org/archives/wayland-devel/2013-November/012159.html

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=727893
2015-01-09 16:39:37 -08:00
Jasper St. Pierre
87eb5f8632 frames: Simplify our frame title management
This fixes a number of crashers when they try to change their dialog
layout at runtime because we're too tricksy with the frame title.
2015-01-09 16:35:30 -08:00
Jasper St. Pierre
5c60ea6635 keybindings: Consistently use slice allocation for MetaKeyBinding 2015-01-09 14:15:17 -08:00
Jasper St. Pierre
9abcf424b8 prefs: Remove per_window flag from MetaKeyPref
It's unused.
2015-01-09 14:15:17 -08:00
Jasper St. Pierre
cc7af83f8a prefs: Correct the MetaPreference value for workspace names 2015-01-09 14:15:17 -08:00
Jasper St. Pierre
9c73e21113 xrandr: Remove mode fudge code for HSkew
This was part of a downstream patch that Endless has where we hid some
secret parameters inside the HSkew field. It wasn't meant as upstream
logic.
2015-01-08 15:04:50 -08:00
Jasper St. Pierre
a1d8110221 keybindings: Merge rebuild_binding_index into reload_combos
The two are always called at the same time.
2015-01-08 14:36:47 -08:00
Jasper St. Pierre
9d6357f05a keybindings: Rename MetaKeyDevirtCombo to MetaResolvedKeyCombo
rtcm thought this was less awkward of a name.
2015-01-08 14:36:47 -08:00
Adel Gadllah
fea7ac84ee ui: Disable gdk's gl support
This fixes a deadlock on wayland.
2015-01-08 11:15:51 +01:00
Jasper St. Pierre
5bc2bcd109 keybindings: Simplify our keycode/mask pairs with MetaKeyDevirtCombo 2015-01-06 19:24:29 -08:00
Jasper St. Pierre
d12390002a keybindings: Have meta_change_keygrab take a MetaKeyDevirtCombo 2015-01-06 19:13:03 -08:00
Jasper St. Pierre
13acf9e35d keybindings: Have meta_accelerator_parse take a MetaKeyCombo 2015-01-06 19:11:57 -08:00
Jasper St. Pierre
3beb187cac keybindings: Split the resolved keybinding out from MetaKeyCombo
MetaKeyCombo is about the *unresolved* keybinding, which can either be a
"keysym" (<Ctrl>F) or a "keycode" (<Ctrl>0x21). When we resolved the
keysym to a keycode, we stuffed it back in the same MetaKeyCombo, which
confused about what the "keycode" field was for. Thus, we often stomped
on the user's explicit choice if they chose a keycode binding value.

To solve this, create a separate structure, the "devirtualized key combo"
or MetaKeyDevirtCombo, which contains a resolved keycode from the
keysym, and a devirtualized modifier mask. The MetaKeyCombo is now
always a "source" value, and the MetaKeyDevirtCombo is now always what
the user chose.

This also lets us significantly clean up the overlay and ISO key binding
paths.
2015-01-06 19:03:11 -08:00
Jasper St. Pierre
a3b8dcbd04 keybindings: Apply the same fix for keycodes to the GrabAccelerator API 2015-01-06 18:50:30 -08:00
Jasper St. Pierre
3ff8b0051d keybindings: Allow using keycodes directly for overlay-key
The reason MetaKeyCombo has a keycode value at all is *not* to store the
devirtualized keycode from the keysym, but instead to allow people that
type in "0x55" into the preference. Everything except the overlay-key
respected this. Make the overlay-key binding respect this.
2015-01-06 18:50:30 -08:00
Jasper St. Pierre
a8bf7934fb keybindings: Use one path to reload binding combos
Rather than one for modifiers and one for keycodes.
2015-01-06 18:50:29 -08:00
Jasper St. Pierre
7159845c6e keybindings: Embed MetaKeyCombo into MetaKeyGrab directly
A simple cleanup
2015-01-06 18:46:35 -08:00
Jasper St. Pierre
7bccd4f22f prefs: Don't parse modifiers for the overlay-key
We don't actually accept modifiers for the overlay key.
2015-01-06 18:46:32 -08:00
Jasper St. Pierre
e4e00b383e keybindings: Remove keysym argument from meta_change_keygrab
It's only used for a debug statement.
2015-01-06 18:46:24 -08:00
Jasper St. Pierre
36454542ae prefs: Fix minor code style issues 2015-01-06 17:58:42 -08:00
Jasper St. Pierre
34ba868b4c monitor-manager-xrandr: Fix a minor typo in an error message 2015-01-05 15:23:17 -08:00
Jasper St. Pierre
274ea76eea frames: Force on dark theme for all apps if the user requested it
If the user requested a dark theme for all apps through GNOME Tweak
Tool, go ahead and force it for all apps, not only GTK+3 apps.

Thanks to MaTachi on reddit who suggested the idea:

http://www.reddit.com/r/linux/comments/2r1zwj/linus_i_dont_know_who_thought_it_was_a_good_idea/cnc10ui
2015-01-02 09:21:14 -08:00
Jasper St. Pierre
34fbca0181 frames: Remove the easy one-liner meta_core_* wrappers 2015-01-01 12:02:53 -08:00
Jasper St. Pierre
4496fb4447 frames: Remove all other uses of meta_core_get
RIP.
2015-01-01 11:56:14 -08:00
Jasper St. Pierre
7e66d2a484 frames: Punch down META_CORE_GET_FRAME_FLAGS / TYPE
These can be fetched directly off of the MetaWindow.
2015-01-01 11:48:55 -08:00
Jasper St. Pierre
12135afa5e frames: Give Havoc and Owen a heart attack
Break down the beautiful core/ui abstraction barrier by inserting
a pointer to MetaWindow into a MetaUIFrame. I'm a scoundrel, I know.
We'll use this very soon to destroy meta_core_get.
2015-01-01 11:42:25 -08:00
Jasper St. Pierre
cac660a5bc frames: Remove shape_applied
It's also unused.
2015-01-01 11:42:20 -08:00
Jasper St. Pierre
dcce4e64bc frames: We don't need to pass in the frame rect to get_bounds either
The MetaFrameGeometry already has this information.
2015-01-01 11:42:13 -08:00
Jasper St. Pierre
4d3511649b frames: Don't pass the frame rect into get_mask
We can query it directly.
2015-01-01 11:19:35 -08:00
Jasper St. Pierre
d4ea2bbd9c frames: Don't pass the width/height as separate args to get_client_rect
We already have them in the fgeom.
2015-01-01 11:04:11 -08:00
Jasper St. Pierre
f303ec2eaa core: Remove META_CORE_GET_FRAME_WIDTH / HEIGHT from documentation
It messes up my autocomplete.
2015-01-01 09:23:03 -08:00
Jasper St. Pierre
2ca4ed6b04 frames: Rename meta_frames_* to meta_ui_frame_* where appropriate 2014-12-31 22:52:50 -08:00
Jasper St. Pierre
a5ad89dd65 frames: Remove last_motion_frame
Nothing cares about it.
2014-12-31 22:46:48 -08:00
Jasper St. Pierre
4a4d724e59 frames: Remove dead declaration 2014-12-31 22:46:06 -08:00
Jasper St. Pierre
8fdbae192a frame: Start converting over to direct usage of MetaUIFrame 2014-12-31 22:44:20 -08:00
Jasper St. Pierre
2413e672c8 frame: Put a MetaUIFrame* in our MetaFrame
This is a small start, but it lets us start to clean up this
UI split mess.
2014-12-31 22:43:00 -08:00
Jasper St. Pierre
c8432cc430 frames: Use an early return
To be more consistent with the rest of the code.
2014-12-31 22:43:00 -08:00
Jasper St. Pierre
015864da09 frames: Embed a pointer to MetaFrames inside MetaUIFrame
This removes the MetaFrames argument from our internal APIs.
2014-12-31 22:35:35 -08:00
Jasper St. Pierre
669c9da2a4 frames: Fix astonishing accidental pointer trickery
Whenever we added a frame to the GHashTable, we added the frame itself
as the value, and a pointer to its storage of the frame window XID,
as the key.

When we iterated over the hash table, we actually looked up the
MetaUIFrame in the key, which might seem extraordinarily wrong, but
eagle-eyed viewers might notice that the XID is the first field in
MetaUIFrame, so the key and value are actually the same pointer.

Changing the layout of MetaUIFrame at all causes this to go haywire,
so let's not do this and simply put the MetaUIFrame in the value,
as expected.
2014-12-31 22:35:35 -08:00
Jasper St. Pierre
4d1d8e831e frames: Revert the logic here when the frame type updates
When the frame type updates, we were doing something funky that
caused us to reset the title used for the text layout here. I can't
really think of any place that it would trigger, and in testing I
haven't hit this either, so let's just remove the fancy logic and
assert this.
2014-12-31 22:35:30 -08:00
Jasper St. Pierre
9e199e6350 frames: Pass MetaFrameType into ensure_layout
All the callers already have it, so don't make us fetch it again.
2014-12-31 22:35:29 -08:00
Jasper St. Pierre
4673d8f245 theme: Remove flags argument from get_frame_layout
It's unused.
2014-12-31 22:35:29 -08:00
Jasper St. Pierre
90111c03a1 Only poke the frames UI code from inside frame.c
Add frame.c wrappers for the missing calls, then adapt.
2014-12-31 22:35:29 -08:00
Jasper St. Pierre
23681800d9 frame: Remove extra argument from sync_to_window 2014-12-31 22:35:29 -08:00
Jasper St. Pierre
b47afe89d3 ui: We now always have a theme 2014-12-31 22:35:29 -08:00
Jasper St. Pierre
af7f51b992 x11: Change the iconcache / window icons to being cairo surfaces
This simplifies the drawing codepath and makes us able to delete
a bunch of GdkPixbuf manipulation.
2014-12-31 21:11:21 -08:00
Jasper St. Pierre
f3d30d897f window: Refactor the default image lookup 2014-12-31 20:48:32 -08:00
Jasper St. Pierre
dcc4ce4ff4 core: Remove META_CORE_GET_ICON
It's unused.
2014-12-31 20:06:17 -08:00
Jasper St. Pierre
b9fb4a5887 backend: Use a GHashTable for device monitors
The array code has been tricky to maintain and leaky. Let's just use a
GHashTable to simplify our lives.
2014-12-31 08:53:57 -08:00
Jasper St. Pierre
d9985cd9bc libmutter: Only export meta_* symbols in the library
We also need ag_* symbols for testasyncgetprop.
2014-12-29 17:59:37 -08:00
Jasper St. Pierre
2dd1f37820 Move the resizepopup to a compositor-side feature
This is the last big feature that requires X11 on Wayland, so let's just
trash it and make GNOME Shell reimplement it.
2014-12-29 17:44:41 -08:00
Jasper St. Pierre
57af975154 monitor-manager-dummy: Fill in connector_type 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
c5940580ed monitor-manager: Use connector_type instead of name sniffing 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
8296d4cdce monitor-config: Fix build 2014-12-29 17:15:23 -08:00
Jasper St. Pierre
c1db9d9181 monitor-config: Replace output name heuristics with connector_type
It's more difficult to replace the MetaOutputKey usage, so just
do this for now.
2014-12-29 16:46:06 -08:00
Jasper St. Pierre
9d2cd8ff87 monitor-config: Use existing key_is_laptop
We already have this code elsewhere.
2014-12-29 16:41:13 -08:00
Jasper St. Pierre
d514e8ab41 monitor-manager: Add a connector-type property
This is so gnome-settings-daemon
2014-12-29 16:30:54 -08:00
Florian Müllner
6b92b45021 theme: Move the layout we save closer to GTK+'s model
With support for the old metacity theme format gone, there's no
reason to keep storing theme information in terms of the old theme
properties. Just store the padding/border information for each
element directly.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:55:08 -08:00
Florian Müllner
ee461b5495 theme: Remove MetaFrameStyle/MetaFrameStyleSet
MetaFrameStyle now only holds a MetaFrameLayout, so we can cut out
the middle man and use the layout directly. And as we are already
using a single style/layout per frame set and handle frame state
and focus by setting appropriate style flags, MetaFrameStyleSet
is pointless too - just store one MetaFrameLayout per frame type
directly in the theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:55:08 -08:00
Florian Müllner
46f3eb0b71 theme: Remove MetaFrameResize
Really, styling windows differently based on how they can be resized
is over the top ...

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:54:57 -08:00
Florian Müllner
ef32899b4d frames: Rename layout to text_layout
... to differentiate PangoLayout from MetaFrameLayout.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
5e9db422c9 Remove all support for the metacity format
Rest in peace you magnificent format, love-child of arcane X11 drawing
API and markup craze, you will not be missed.
We do remember however the bravery of a many men and women, who fearlessly
descended into the guts of your intrinsics and turned ugliness into beauty;
their work will still be spoken of when you will long have been forgotten.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
662dd6a289 theme: Use a singleton theme
Different themes don't make sense when we are always using the current
GTK+ theme for everything, so adapt the MetaTheme API to use a singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
d5e6177900 theme: Don't load metacity themes
All geometry/drawing information is now picked up from the GTK+ theme,
so replace the remaining bits (hide_buttons + title_scale) with
hardcoded values from the default Adwaita theme and stop loading
the metacity theme altogether.
If there is a need to theme those constants again in the future,
we should make them available from GTK+ where they are available
for client-side decorations as well. They certainly don't justify
maintaining support for a complex theme format.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
34ac80348c theme: Disable support for fringe buttons
Few themes ever had support for those in the first place, and even
less supported them properly; in particular support in the default
theme has been broken for a while now.
With this in mind (and considering that not even the tweak tool exposes
any UI to configure them), let's (try to) remove support altogether - the
corresponding rects are still kept around, so it's easy to add back in
case we reconsider (and get the necessary artwork).

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
8a7a01b0cf theme: Scale whitespace from theme with title_scale factor
GTK+ doesn't deal with different frame types for its client-side
decorations - it just treats dialogs the same as normal windows
and ignores the odder frame types like UTILITY and MENU. That's
fine as those have largely gone out of fashion anyway, but it's a
different case for the WM - we still have to support them somehow.
For now, just apply the existing title_scale factor to the geometry
information picked up from the theme in addition to the title font.
If it turns out that there's demand for something more sophisticated,
we can still consider adding wm-only style information to the GTK+
theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
2cabc067d1 frames: Adapt frame mask/bounds
The frame shape is relevant in three places:
 - the window decoration we draw
 - the frame mask (used for the shape region)
 - the frame bounds (used for clipping)

All three should match, so make sure to use the same GTK+ method for
the first two, and bring the (non-antialiased) third closer to the
other two by removing an obscure modifier from the corner radius.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
26c4c21e13 Properly update on GTK+ theme changes
With geometry information picked up from GTK+, we need to queue a
resize on GTK+ theme changes to correctly update to the new geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
6eda784cf0 theme: Use style information from GTK+
We now have everything in place to pick up geometry and drawing
information from GTK+ rather than the metacity theme, so do just
that; the metacity theme is now only used for some constants
(title_scale, hide_buttons, ...), which we will replace soon.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
fb1459062f theme: Add function to fill geometry information from GTK+ theme
We want to eventually pick up all theme information from GTK+ instead
of our own theme format; to prepare for this, add another helper method
to fill in geometry information from the GTK+ theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
bc9547f29e theme: Add method to adjust styles for frame state
GTK+ expresses the window state as style classes and widget state for
client-side decorations. Add a helper method to translate our own frame
state to the corresponding changes to the style context hierarchy.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
89a371ec98 frames: Use title style to set up title layout
Sounds obvious, doesn't it?

After this change when titlebar-uses-system-font is set, the "system
font" used will not be a generic one, but match what GTK+ uses in
client-side decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
2db71e73b4 theme: Build a StyleContext hierarchy that matches GTK+'s CSD
In order to pick up all theme information from GTK+, a single style
context is not enough; a style hierarchy that closely matches the widget
hierarchy by GTK+'s client-side decorations will allow this soon.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
472f2a4b8e theme: Add MetaStyleInfo for wrapping frame style context
Our current use of style contexts is fairly limited - we don't
use them for much more than picking up some color information.
We will soon start to make more elaborate use of GTK style
information, but a single context will no longer be enough
to draw a frame then.
To prepare for this, add a simple ref-counted type to wrap
style information.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
db04ac9eb7 theme: Add titlebar_spacing
Rather than defining the space to the left and right of buttons, add a
simple spacing property that defines the space between buttons, which is
what GTK+ does for client-side decorations (e.g. GtkButtons in a GtkBox).
Unfortunately the value is hardcoded in GTK+; if it is exposed in the
theme in the future, we should pick it up from there, but for now we
just use the same value as GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Florian Müllner
75105e254f theme: Rename button_rect() to get_button_rect()
Basically it's odd to have "button_rect" be a function with all the
foo_rect GdkRectangles around - renaming to get_button_rect() will
free the name for the generically named "rect" once buttons are the
only movable pieces in the frame.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 16:25:19 +01:00
Rico Tzschichholz
ab6c4c82f6 screen: Use meta_fatal to fx build
Fixing 5ad15bb5e5
2014-12-29 09:46:19 +01:00
Jasper St. Pierre
4450b5bb14 Revert "backends: Include Xfixes for cursor events and manipulation"
This reverts commit 34421e90c3.

These aren't needed at all.
2014-12-28 22:41:42 -08:00
Ikey Doherty
34421e90c3 backends: Include Xfixes for cursor events and manipulation
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=737463
2014-12-28 22:40:39 -08:00
Jasper St. Pierre
93b7137c62 Allow raise_on_click to be set independent of focus_mode
Based on a patch by Thomas Jaeger <ThJaeger@gmail.com>
2014-12-28 22:36:27 -08:00
Jasper St. Pierre
5ad15bb5e5 screen: Crash when we can't load a cursor
To make it easier for users to understand why their cursor disappeared.
2014-12-28 22:13:44 -08:00
Jasper St. Pierre
cd4206764e Remove a few more guards for frees 2014-12-28 19:51:22 -08:00
Jasper St. Pierre
b10a017446 events: Don't bother free-guarding
free already takes NULL just fine.
2014-12-28 19:51:22 -08:00
Jasper St. Pierre
d393cba39e events: Add a quick method to return a spewed event
For easy gcc debugging
2014-12-28 19:51:21 -08:00
Jasper St. Pierre
578f593d56 events: Remove unnecessary G_GNUC_UNUSED from spew subfunctions
Being used by an unused function is good enough for gcc to not complain.
2014-12-28 19:43:11 -08:00
Jasper St. Pierre
55df99447a window-private: Remove duplicate definition
We already publicly expose meta_window_change_workspace, but it's still
listed in window-private.h. Remove the duplicate definition.
2014-12-28 19:36:35 -08:00
Jasper St. Pierre
d45080d32e screen: Fix build
Forgot to squash again...
2014-12-28 19:36:29 -08:00
Jasper St. Pierre
fa97364fa8 screen: Behave better about CM selections 2014-12-28 19:20:00 -08:00
Rui Matos
68542ae1ef Revert "monitor-manager-xrandr: Don't do extra work on RRScreenChangeNotify"
This reverts commit 47e339b46e. The
approach that was used to reduce the amount of work we do on RR events
to the necessary minimum is flawed. It assumes that, when the first
event we see where the retrieved XRRScreenResources.timestamp is
bigger than the previous, we already have all the data we need to
rebuild our view of the world.

That isn't true however, because the X server sends
RRScreenChangeNotify events for every step of the configuration
change, i.e. it lacks an atomic reconfiguration API. In particular, if
the X screen size is one of the changes, when we rebuild our state and
emit monitors-changed, the X screen size might still be the previous
one and since we stop updating ourselves until another reconfiguration
happens (noticed by looking at XRRScreenResources.timestamp) we end up
with the wrong idea of the X screen size.

https://bugzilla.gnome.org/show_bug.cgi?id=738630
2014-12-28 17:21:50 -08:00
Ting-Wei Lan
aeef98fd19 Add a missing #ifdef and remove a left-over include to make gbm optional
https://bugzilla.gnome.org/show_bug.cgi?id=741829
2014-12-21 17:44:12 +08:00
Jasper St. Pierre
ad7292faef wayland: Use g_source_add_unix_fd instead of g_source_add_poll
g_source_add_poll is deprecated.
2014-12-15 14:44:00 -08:00
Jasper St. Pierre
2f7843b295 monitor-manager-kms: Fix some minor style issues
Spotted by Dave Airlie <airlied@redhat.com>
2014-12-15 14:15:46 -08:00
Jasper St. Pierre
b24cd5ae08 window: Force state changes on maximized / fullscreen 2014-12-15 13:52:40 -08:00
Jasper St. Pierre
c782078e00 Rename MetaMoveResizeFlags items to fit with the theme
Use a proper prefix, even if more wordy, instead of META_IS.
2014-12-15 13:30:39 -08:00
Rui Matos
5a86286aba monitor-manager-xrandr: Set CRTC config even if it might be redundant
This optimization breaks our use of XRRScreenResources' timestamps to
detect hotplugs in case one of the outputs is disconnected and the
remaining ones don't need any mode, position or transform adjustments.

In that scenario, when applying the new configuration, we resize the X
screen but never call XRRSetCrtcConfig() and since XRRSetScreenSize()
doesn't take a timestamp and the X server doesn't update its last set
timestamp, when we next get a RRScreenChangeNotify and update
ourselves, XRRScreenResources.timestamp will still be smaller than
XRRScreenResources.configTimestamp which makes us think we're seeing a
new hotplug. We just don't enter an endless loop because the screen
size that we keep applying is always the same and the X server
short-circuits and stops sending us RRScreenChangeNotifys.

Always calling XRRSetCrtcConfig() ensures that the last set timestamp
will be bigger than configTimestamp in the next event and thus making
us trigger the monitors-changed signal properly.

Note that the X server already does basically the same checks that
we're removing here, so doing this shouldn't be a significant
efficiency loss. See

http://cgit.freedesktop.org/xorg/xserver/tree/randr/rrcrtc.c?h=server-1.16-branch#n539
2014-12-11 13:42:44 +01:00
Jasper St. Pierre
593b417e5e cursor: Don't free the image if it hasn't loaded
Otherwise, we'll try to free a null image and crash.
2014-12-04 16:46:30 -08:00
Owen W. Taylor
5e84c8f20b MetaWindowActor: don't overwrite send_frame_messages_timer
If the app finished multiple frames before we sent _NET_WM_FRAME_DRAWN,
we could add the send_frame_messages_timer multiple times. In the rare
case that the app immediately closed the window, the older timeout
could potentially then run on the freed actor.

https://bugzilla.gnome.org/show_bug.cgi?id=738686
2014-12-02 11:47:13 -05:00
Owen W. Taylor
9745f9f8ce Fix problems resulting in left-over queued frames
* Use -1 rather than 0 as a flag for pending queue entries; 0 is
  a valid frame_counter value from Cogl.
* Consistently handle the fact we can have more than one pending
  entry. It's app misbehavior to submit a new frame before
  _NET_WM_FRAME_DRAWN is received; but we accept such frame messages,
  so we can't just leak them.
* If we remove send_frame_message_timer, assign the current frame counter
  to pending entries.
* To try to avoid regressing on this, when sending _NET_WM_FRAME_TIMINGS
  messages, if we have stale messages, or messages with no frame drawn
  time, warn and remove them from the queue rather than just accumulating.
* Improve commenting.

https://bugzilla.gnome.org/show_bug.cgi?id=738686
2014-12-02 11:47:13 -05:00
Jasper St. Pierre
6492845f27 display: Unknown keyboard resize ops are resizing ops
This fixes the resize popup not showing up when doing a keyboard
resize.
2014-12-01 08:31:49 -08:00
Jasper St. Pierre
fd1243d881 cursor: Load cursor images lazily
It doesn't make sense to load cursor textures that we might not ever
use. Since the code here also uses CoglTexture2D, and cursors tend
to be NPOT textures, then we won't crash users of cards without
NPOT support. At least until they open the magnifier. :)
2014-11-27 14:38:07 -08:00
Jasper St. Pierre
a2b2a7a26f display: Call grab_op_ended after actually ending the grab op
Otherwise, we'll still think we're resizing the window when we
send out the configure, causing apps that care about that to get
stuck in that state.
2014-11-26 15:43:32 -08:00
Jasper St. Pierre
9fdf487da1 pointer: Actually do change the focus during window ops
Whenever the compositor takes a grab, we're supposed send leave/enter
events to the current surface, which makes sense, as the compositor
has stolen the pointer from the client.

I forget why I added the special case in the first place, but it's
likely a bug that's since been fixed.

This actually fixes a bug: it prevents the need to double-click on
X11 application titlebars when grabbing them.
2014-11-26 15:32:18 -08:00
Jasper St. Pierre
c5033616e9 pointer: Sync the focus surface instead of calling set_focus directly
set_focus is really meant to be an internal function, and
sync_focus_surface should be able to be called at any time and get
things right.
2014-11-26 15:29:42 -08:00
Jasper St. Pierre
a0e038f34b pointer: Forcibly steal pointer focus when the compositor has a grab 2014-11-26 15:29:25 -08:00
Jasper St. Pierre
71dab32769 launcher: Fix a crash that happens when TakeDevice has an error 2014-11-26 13:28:47 -08:00
Jasper St. Pierre
c408cf7aac window-x11: Fix windows that set empty input shapes
Windows that set empty input shapes get n_rects of 0 when querying them
later, which makes sense, but the code that interpreted the result
translated it into a NULL input shape, which meant it was the same as
the bounding region. As such, an empty input shape would actually get
interpreted as a full input shape!

We, ourselves, set an empty input shape on tray icon windows in
gnome-shell since we would handle the picking ourselves. This meant that
we'd actually get the MetaSurfaceActorX11 when hovering over the tray
icon, instead of the ShellGTKEmbed that we capture events on and react
to.

This fixes weird tray icon behavior in gnome-shell.
2014-11-26 12:51:35 -08:00
Carlos Garnacho
e96eb0e82e compositor: Always recurse over surface children actors when picking
The parent pick() implementation in ClutterActor only recurses if the
vfunc is untouched, which means it's up to the MetaWaylandSurface
implementation to actually recurse, just the same as if an input mask
applied.

https://bugzilla.gnome.org/show_bug.cgi?id=738890
2014-11-24 14:44:11 +01:00