Compare commits

...

27 Commits

Author SHA1 Message Date
f3e1964362 Bump version to 3.19.2
Update NEWS.
2015-11-25 00:34:28 +01:00
9b9083180f theme: Shut up some GTK+ warnings
GTK+ started to complain when the state parameter passed to any
gtk_style_context_get*() method mismatches the context's current
state a while ago.
2015-11-24 23:46:14 +01:00
7606f79a1e x11/window-props: Initialize bypass compositor hint
If a client only ever sets the hint on window creation we'd never pick
the value. Also, include override redirect windows since the hint is
relevant to them too.

https://bugzilla.gnome.org/show_bug.cgi?id=758544
2015-11-23 19:54:48 +01:00
99c0b82b15 window: do not force placing window if it is not mapped
When managing window, we queue showing the window.
Under wayland, if we commit surface quickly enough,
the showing is unqueued and commit procedure takes care
of mapping and placing the window. In the oposite case,
queue is processed before client sets all we need and
then we have wrong size of window, which leads to broken placement.
Therefore force placement in queue only if the window should already
be mapped. If it is not mapped, we don't care where it is anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=751887
2015-11-16 10:21:09 +08:00
ca7c1d5e02 launcher: Fix drm device detection for non pci devices
On Odroid U2 (exynos4412) the drm device is not bound to pci.
Open the detection to platform device of the drm subsystem, exclusive of
control devices.

https://bugzilla.gnome.org/show_bug.cgi?id=754911
2015-11-12 14:09:02 -05:00
4a770907c1 theme: Update style hierarchy (again)
GTK+ has updated some more widgets to use element names, so do some
catching up again ...
2015-11-12 01:04:24 +01:00
049f1556dc Updated POTFILES.skip 2015-11-10 01:18:27 +01:00
7b20d151ed data: drop mutter-wayland.desktop
It's not needed since we can automatically figure things out
based on logind.

https://bugzilla.gnome.org/show_bug.cgi?id=741666
2015-11-09 10:25:40 -05:00
8ec0c99ff4 core: start as wayland display server when XDG_SESSION_TYPE=wayland
This commit gets rid of the need for --display-server and
--wayland when mutter detects that a wayland session is registered.

https://bugzilla.gnome.org/show_bug.cgi?id=741666
2015-11-09 10:25:11 -05:00
cf3ee327a0 meta-backend: include stdlib.h
Otherwise build fails with missing declaration
warning for exit().
2015-11-06 23:10:41 -05:00
3ec3cc248d Exit, not abort, when we fail to initialize Clutter
Failing to initialize Clutter isn't something it's useful to report
into automatic bug tracking systems or get a backtrace for - in fact,
the most common case is that DISPLAY is unset or points to a
non-existent X server. So simply exit rather than calling g_error().

https://bugzilla.gnome.org/show_bug.cgi?id=757311
2015-11-06 17:03:59 -05:00
7fb3ecc12c MetaLauncher: Don't g_error() on failure
g_error() is the wrong thing to do when, for example, we can't find the
DRM device, since Mutter should just fail to start rather than reporting
a bug into automatic bug tracking systems. Rather than trying to decipher
which errors are "expected" and which not, just make all failure paths
in meta_launcher_new() return a GError out to the caller - which we make
exit(1).

https://bugzilla.gnome.org/show_bug.cgi?id=757311
2015-11-06 17:03:59 -05:00
4c9af7267d Revert "Force cursor update after applying configuration"
This reverts commit 33150569cd.

This was a stow-a-away sitting in my local tree.
2015-11-06 16:24:34 -05:00
db4355ba1e core: move backend setting to helper function
This paves the way for making the backend setting
be more automatic.

https://bugzilla.gnome.org/show_bug.cgi?id=741666
2015-11-06 16:22:40 -05:00
33150569cd Force cursor update after applying configuration
The qxl kms driver has a bug where the cursor gets hidden
implicitly after a drmModeSetCrtc call.

This commit works around the bug by forcing a drmModeSetCursor2
call after the drmModeSetCrtc calls.

This is pretty hacky and won't ever go upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=746078
2015-11-06 14:26:46 -05:00
af2a13ded4 monitor-manager-xrandr: Skip outputs with no crtcs
Outputs with no crtcs shouldn't happen, but if it does we should
ignore them, instead of possibly crashing later.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-30 17:47:00 +01:00
8b200de35a monitor-manager-xrandr: Skip outputs with no modes
If we can't find any valid modes for an output we need to unwind and
skip the output because trying to use a modeless output later will
crash us.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-30 17:47:00 +01:00
57ae203aab Revert "monitor-manager-xrandr: Ignore outputs without modes"
This reverts commit 86a913d37a. It
introduced a memory leak, so we'll go for a cleaner approach.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-30 17:47:00 +01:00
bff75b64be monitor-manager: Expose a few helpers to clear structs
These are useful for child classes to unwind cleanly when constructing
their structures.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-30 17:47:00 +01:00
8899b9da01 Bump version to 3.19.1
Update NEWS.
2015-10-29 14:56:06 +01:00
76e816a14f window: Properly update window->monitor for the desktop window
We don't want to move the desktop window but we still need to update
window->monitor or otherwise we'll be left with a pointer to invalid
memory.

https://bugzilla.gnome.org/show_bug.cgi?id=757148
2015-10-27 14:33:34 +01:00
2750db2a89 theme: Set object-name on style contexts
The default theme started to use them in GTK+ commit 371f50, so
we need to update the style contexts to keep matching the style
of client-side decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=757101
2015-10-27 09:42:49 +01:00
86a913d37a monitor-manager-xrandr: Ignore outputs without modes
In some cases we get outputs without any valid mode. We need to ignore
them or we'll crash later.

https://bugzilla.gnome.org/show_bug.cgi?id=756796
2015-10-23 14:13:26 +02:00
2857fdbdb8 backend-x11: Ensure the Xkb group index remains properly set
Ubuntu ships a patch in the X server that makes the group switch
keybindings only work on key release, i.e. the X server internal group
locking happens on key release which means that mutter gets the
XKB_KEY_ISO_Next_Group key press event, does its XLockGroup() call
with a new index and then, on key release, the X server moves the
index further again.

We can work around this without affecting our behavior in unpatched X
servers by doing a XLockGroup() every time we're notified of the
locked group changing if it doesn't match what we requested.

https://bugzilla.gnome.org/show_bug.cgi?id=756543
2015-10-23 14:13:26 +02:00
69a7d5ff02 Updated Romanian Translation 2015-10-22 19:15:59 +02:00
a4f763ac3b wayland-surface: disconnect signals on destroy
Otherwise signal handlers will be called on garbage

https://bugzilla.gnome.org/show_bug.cgi?id=756548
2015-10-19 17:21:59 -07:00
f2afa7aa6c mutter: don't show the resize popup for 2 x 2 size increments
In a HiDPI environment, all gtk+ apps will report a 2 x 2 size
increment to avoid odd size. But that does not mean they are
resizing in cells like terminals, so they resize popup should
not be shown.

Ideally, we should ignore <= scale x scale increments, but in
practice scale is 1 or 2, and even in a lo-dpi setting a 2 x 2
increment makes little sense so let's keep the patch simple.

https://bugzilla.gnome.org/show_bug.cgi?id=746420
2015-10-19 17:21:59 -07:00
22 changed files with 1949 additions and 2022 deletions

27
NEWS
View File

@ -1,3 +1,30 @@
3.19.2
======
* Fix crash on monitor unplug [Rui; #756796]
* Exit cleanly on initialization errors [Owen; #757311]
* Allow to determine backend setting from session type [Ray; #741666]
* Fix DRM device detection for non-PCI devices [Alban; #754911]
* Don't force placement of windows without buffer on wayland [Marek; #751887]
* Fix initialization of bypass compositor hint [Rui; #758544]
Contributors:
Alban Browaeys, Marek Chalupa, Rui Matos, Florian Müllner, Ray Strode,
Owen W. Taylor
3.19.1
======
* wayland: Allow to trigger popups through keyboard/touch [Carlos; #756296]
* Fix modifiers-only input source switching on Ubuntu [Alberts; #756543]
* Misc. bug fixes [Jonas, Rui, Giovanni, Florian; #756675, #756660, #746420,
#756548, #756796, #757101, #757148]
Contributors:
Jonas Ådahl, Giovanni Campagna, Carlos Garnacho, Rui Matos,
Alberts Muktupāvels, Florian Müllner
Translations:
Daniel Șerbănescu [ro]
3.18.1
======
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,

View File

@ -1,8 +1,8 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [18])
m4_define([mutter_micro_version], [1])
m4_define([mutter_minor_version], [19])
m4_define([mutter_micro_version], [2])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
@ -58,7 +58,7 @@ CANBERRA_GTK_VERSION=0.26
CLUTTER_PACKAGE=clutter-1.0
MUTTER_PC_MODULES="
gtk+-3.0 >= 3.9.11
gtk+-3.0 >= 3.19.1
gio-unix-2.0 >= 2.35.1
pango >= 1.2.0
cairo >= 1.10.0

View File

@ -1,6 +1,5 @@
desktopfiles_in_files = \
mutter.desktop.in \
mutter-wayland.desktop.in
mutter.desktop.in
desktopfilesdir = $(datadir)/applications
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)

View File

@ -1,17 +0,0 @@
[Desktop Entry]
Type=Application
_Name=Mutter (wayland compositor)
Exec=mutter --wayland --display-server
NoDisplay=true
# name of loadable control center module
X-GNOME-WMSettingsModule=metacity
# name we put on the WM spec check window
X-GNOME-WMName=Mutter
# back compat only
X-GnomeWMSettingsLibrary=metacity
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=mutter
X-GNOME-Bugzilla-Component=general
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=true

View File

@ -1 +1,2 @@
data/mutter-wayland.desktop.in
# List of source files that should NOT be translated.
# Please keep this file sorted alphabetically.

3395
po/ro.po

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,8 @@
#include "config.h"
#include <stdlib.h>
#include <meta/meta-backend.h>
#include "meta-backend-private.h"
#include "meta-input-settings-private.h"
@ -626,7 +628,10 @@ meta_clutter_init (void)
meta_create_backend ();
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
g_error ("Unable to initialize Clutter.\n");
{
g_warning ("Unable to initialize Clutter.\n");
exit (1);
}
/*
* XXX: We cannot handle high dpi scaling yet, so fix the scale to 1

View File

@ -414,6 +414,10 @@ gint meta_monitor_manager_get_monitor_at_point (MetaMonitorManager
gfloat x,
gfloat y);
void meta_monitor_manager_clear_output (MetaOutput *output);
void meta_monitor_manager_clear_mode (MetaMonitorMode *mode);
void meta_monitor_manager_clear_crtc (MetaCRTC *crtc);
/* Returns true if transform causes width and height to be inverted
This is true for the odd transforms in the enum */
static inline gboolean

View File

@ -346,6 +346,23 @@ meta_monitor_manager_constructed (GObject *object)
manager->in_init = FALSE;
}
void
meta_monitor_manager_clear_output (MetaOutput *output)
{
g_free (output->name);
g_free (output->vendor);
g_free (output->product);
g_free (output->serial);
g_free (output->modes);
g_free (output->possible_crtcs);
g_free (output->possible_clones);
if (output->driver_notify)
output->driver_notify (output);
memset (output, 0, sizeof (*output));
}
static void
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
int n_old_outputs)
@ -353,22 +370,22 @@ meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
int i;
for (i = 0; i < n_old_outputs; i++)
{
g_free (old_outputs[i].name);
g_free (old_outputs[i].vendor);
g_free (old_outputs[i].product);
g_free (old_outputs[i].serial);
g_free (old_outputs[i].modes);
g_free (old_outputs[i].possible_crtcs);
g_free (old_outputs[i].possible_clones);
if (old_outputs[i].driver_notify)
old_outputs[i].driver_notify (&old_outputs[i]);
}
meta_monitor_manager_clear_output (&old_outputs[i]);
g_free (old_outputs);
}
void
meta_monitor_manager_clear_mode (MetaMonitorMode *mode)
{
g_free (mode->name);
if (mode->driver_notify)
mode->driver_notify (mode);
memset (mode, 0, sizeof (*mode));
}
static void
meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
int n_old_modes)
@ -376,16 +393,20 @@ meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
int i;
for (i = 0; i < n_old_modes; i++)
{
g_free (old_modes[i].name);
if (old_modes[i].driver_notify)
old_modes[i].driver_notify (&old_modes[i]);
}
meta_monitor_manager_clear_mode (&old_modes[i]);
g_free (old_modes);
}
void
meta_monitor_manager_clear_crtc (MetaCRTC *crtc)
{
if (crtc->driver_notify)
crtc->driver_notify (crtc);
memset (crtc, 0, sizeof (*crtc));
}
static void
meta_monitor_manager_free_crtc_array (MetaCRTC *old_crtcs,
int n_old_crtcs)
@ -393,10 +414,7 @@ meta_monitor_manager_free_crtc_array (MetaCRTC *old_crtcs,
int i;
for (i = 0; i < n_old_crtcs; i++)
{
if (old_crtcs[i].driver_notify)
old_crtcs[i].driver_notify (&old_crtcs[i]);
}
meta_monitor_manager_clear_crtc (&old_crtcs[i]);
g_free (old_crtcs);
}

View File

@ -37,6 +37,8 @@
#include "meta-cursor-renderer-native.h"
#include "meta-launcher.h"
#include <stdlib.h>
struct _MetaBackendNativePrivate
{
MetaLauncher *launcher;
@ -327,8 +329,15 @@ static void
meta_backend_native_init (MetaBackendNative *native)
{
MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
GError *error = NULL;
priv->launcher = meta_launcher_new (&error);
if (priv->launcher == NULL)
{
g_warning ("Can't initialize KMS backend: %s\n", error->message);
exit (1);
}
priv->launcher = meta_launcher_new ();
priv->barrier_manager = meta_barrier_manager_native_new ();
priv->up_client = up_client_new ();

View File

@ -54,30 +54,22 @@ struct _MetaLauncher
gboolean session_active;
};
static void
report_error_and_die (const char *prefix,
GError *error)
{
/* if a function returns due to g_return_val_if_fail,
* then the error may not be set */
if (error)
g_error ("%s: %s", prefix, error->message);
else
g_error ("%s", prefix);
/* the error is not freed, but it is ok as g_error aborts the process */
}
static Login1Session *
get_session_proxy (GCancellable *cancellable)
get_session_proxy (GCancellable *cancellable,
GError **error)
{
char *proxy_path;
char *session_id;
Login1Session *session_proxy;
GError *error = NULL;
if (sd_pid_get_session (getpid (), &session_id) < 0)
return NULL;
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session ID: %m");
return NULL;
}
proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session", session_id);
@ -85,9 +77,9 @@ get_session_proxy (GCancellable *cancellable)
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
"org.freedesktop.login1",
proxy_path,
cancellable, &error);
cancellable, error);
if (!session_proxy)
report_error_and_die ("Failed getting session proxy", error);
g_prefix_error(error, "Could not get session proxy: ");
free (proxy_path);
@ -95,16 +87,16 @@ get_session_proxy (GCancellable *cancellable)
}
static Login1Seat *
get_seat_proxy (GCancellable *cancellable)
get_seat_proxy (GCancellable *cancellable,
GError **error)
{
GError *error = NULL;
Login1Seat *seat = login1_seat_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
"org.freedesktop.login1",
"/org/freedesktop/login1/seat/self",
cancellable, &error);
cancellable, error);
if (!seat)
report_error_and_die ("Could not get seat proxy", error);
g_prefix_error(error, "Could not get seat proxy: ");
return seat;
}
@ -303,9 +295,9 @@ get_primary_gpu_path (const gchar *seat_name)
if (!devices)
goto out;
for (tmp = devices; tmp != NULL; tmp = tmp->next)
for (tmp = devices; tmp != NULL && path == NULL; tmp = tmp->next)
{
GUdevDevice *pci_device;
GUdevDevice *platform_device = NULL, *pci_device = NULL;
GUdevDevice *dev = tmp->data;
gint boot_vga;
const gchar *device_seat;
@ -332,20 +324,26 @@ get_primary_gpu_path (const gchar *seat_name)
if (g_strcmp0 (seat_name, device_seat))
continue;
platform_device = g_udev_device_get_parent_with_subsystem (dev, "platform", NULL);
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
if (!pci_device)
continue;
/* get value of boot_vga attribute or 0 if the device has no boot_vga */
boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga");
g_object_unref (pci_device);
if (boot_vga == 1)
if (platform_device != NULL)
{
/* found the boot_vga device */
path = g_strdup (g_udev_device_get_device_file (dev));
break;
}
else if (pci_device != NULL)
{
/* get value of boot_vga attribute or 0 if the device has no boot_vga */
boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga");
if (boot_vga == 1)
{
/* found the boot_vga device */
path = g_strdup (g_udev_device_get_device_file (dev));
}
}
g_object_unref (platform_device);
g_object_unref (pci_device);
}
g_list_free_full (devices, g_object_unref);
@ -357,69 +355,114 @@ out:
return path;
}
static void
static gboolean
get_kms_fd (Login1Session *session_proxy,
const gchar *seat_id,
int *fd_out)
const gchar *seat_id,
int *fd_out,
GError **error)
{
int major, minor;
int fd;
gchar *path;
GError *error = NULL;
path = get_primary_gpu_path (seat_id);
g_autofree gchar *path = get_primary_gpu_path (seat_id);
if (!path)
g_error ("could not find drm kms device");
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"could not find drm kms device");
return FALSE;
}
if (!get_device_info_from_path (path, &major, &minor))
g_error ("Could not stat %s: %m", path);
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get device info for path %s: %m", path);
return FALSE;
}
g_free (path);
if (!take_device (session_proxy, major, minor, &fd, NULL, &error))
report_error_and_die ("Could not open DRM device", error);
if (!take_device (session_proxy, major, minor, &fd, NULL, error))
{
g_prefix_error (error, "Could not open DRM device: ");
return FALSE;
}
*fd_out = fd;
return TRUE;
}
static gchar *
get_seat_id (void)
get_seat_id (GError **error)
{
char *session_id, *seat_id = NULL;
char *session_id, *seat_id;
int r;
if (sd_pid_get_session (0, &session_id) < 0)
return NULL;
r = sd_pid_get_session (0, &session_id);
if (r < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session for PID: %s", g_strerror (-r));
return NULL;
}
/* on error the seat_id will remain NULL */
sd_session_get_seat (session_id, &seat_id);
r = sd_session_get_seat (session_id, &seat_id);
free (session_id);
if (r < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get seat for session: %s", g_strerror (-r));
return NULL;
}
return seat_id;
}
MetaLauncher *
meta_launcher_new (void)
meta_launcher_new (GError **error)
{
MetaLauncher *self = NULL;
Login1Session *session_proxy;
char *seat_id;
GError *error = NULL;
Login1Session *session_proxy = NULL;
Login1Seat *seat_proxy = NULL;
char *seat_id = NULL;
gboolean have_control = FALSE;
int kms_fd;
session_proxy = get_session_proxy (NULL);
if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, &error))
report_error_and_die ("Could not take control", error);
session_proxy = get_session_proxy (NULL, error);
if (!session_proxy)
goto fail;
seat_id = get_seat_id ();
if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, error))
{
g_prefix_error (error, "Could not take control: ");
goto fail;
}
have_control = TRUE;
seat_id = get_seat_id (error);
if (!seat_id)
g_error ("Failed getting seat id");
goto fail;
seat_proxy = get_seat_proxy (NULL, error);
if (!seat_proxy)
goto fail;
if (!get_kms_fd (session_proxy, seat_id, &kms_fd, error))
goto fail;
get_kms_fd (session_proxy, seat_id, &kms_fd);
free (seat_id);
self = g_slice_new0 (MetaLauncher);
self->session_proxy = session_proxy;
self->seat_proxy = get_seat_proxy (NULL);
self->seat_proxy = seat_proxy;
self->session_active = TRUE;
@ -429,8 +472,16 @@ meta_launcher_new (void)
self);
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
return self;
fail:
if (have_control)
login1_session_call_release_control_sync (session_proxy, NULL, NULL);
g_clear_object (&session_proxy);
g_clear_object (&seat_proxy);
free (seat_id);
return NULL;
}
void

View File

@ -24,7 +24,7 @@
typedef struct _MetaLauncher MetaLauncher;
MetaLauncher *meta_launcher_new (void);
MetaLauncher *meta_launcher_new (GError **error);
void meta_launcher_free (MetaLauncher *self);
gboolean meta_launcher_activate_session (MetaLauncher *self,

View File

@ -82,6 +82,7 @@ struct _MetaBackendX11Private
gchar *keymap_layouts;
gchar *keymap_variants;
gchar *keymap_options;
int locked_group;
};
typedef struct _MetaBackendX11Private MetaBackendX11Private;
@ -297,15 +298,23 @@ handle_host_xevent (MetaBackend *backend,
if (event->type == priv->xkb_event_base)
{
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
XkbEvent *xkb_ev = (XkbEvent *) event;
if (xkb_ev->device == META_VIRTUAL_CORE_KEYBOARD_ID)
if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
{
switch (xkb_ev->xkb_type)
switch (xkb_ev->any.xkb_type)
{
case XkbNewKeyboardNotify:
case XkbMapNotify:
keymap_changed (backend);
break;
case XkbStateNotify:
if (xkb_ev->state.changed & XkbGroupLockMask)
{
if (priv->locked_group != xkb_ev->state.locked_group)
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, priv->locked_group);
}
break;
default:
break;
}
@ -776,6 +785,7 @@ meta_backend_x11_lock_layout_group (MetaBackend *backend,
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
priv->locked_group = idx;
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, idx);
}

View File

@ -661,6 +661,44 @@ output_get_modes (MetaMonitorManager *manager,
}
}
meta_output->n_modes = n_actual_modes;
if (n_actual_modes > 0)
meta_output->preferred_mode = meta_output->modes[0];
}
static void
output_get_crtcs (MetaMonitorManager *manager,
MetaOutput *meta_output,
XRROutputInfo *output)
{
guint j, k;
guint n_actual_crtcs;
meta_output->possible_crtcs = g_new0 (MetaCRTC *, output->ncrtc);
n_actual_crtcs = 0;
for (j = 0; j < (unsigned)output->ncrtc; j++)
{
for (k = 0; k < manager->n_crtcs; k++)
{
if ((XID)manager->crtcs[k].crtc_id == output->crtcs[j])
{
meta_output->possible_crtcs[n_actual_crtcs] = &manager->crtcs[k];
n_actual_crtcs += 1;
break;
}
}
}
meta_output->n_possible_crtcs = n_actual_crtcs;
meta_output->crtc = NULL;
for (j = 0; j < manager->n_crtcs; j++)
{
if ((XID)manager->crtcs[j].crtc_id == output->crtc)
{
meta_output->crtc = &manager->crtcs[j];
break;
}
}
}
static char *
@ -825,31 +863,7 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
output_get_tile_info (manager_xrandr, meta_output);
output_get_modes (manager, meta_output, output);
meta_output->preferred_mode = meta_output->modes[0];
meta_output->n_possible_crtcs = output->ncrtc;
meta_output->possible_crtcs = g_new0 (MetaCRTC *, meta_output->n_possible_crtcs);
for (j = 0; j < (unsigned)output->ncrtc; j++)
{
for (k = 0; k < manager->n_crtcs; k++)
{
if ((XID)manager->crtcs[k].crtc_id == output->crtcs[j])
{
meta_output->possible_crtcs[j] = &manager->crtcs[k];
break;
}
}
}
meta_output->crtc = NULL;
for (j = 0; j < manager->n_crtcs; j++)
{
if ((XID)manager->crtcs[j].crtc_id == output->crtc)
{
meta_output->crtc = &manager->crtcs[j];
break;
}
}
output_get_crtcs (manager, meta_output, output);
meta_output->n_possible_clones = output->nclone;
meta_output->possible_clones = g_new0 (MetaOutput *, meta_output->n_possible_clones);
@ -873,7 +887,10 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
else
meta_output->backlight = -1;
n_actual_outputs++;
if (meta_output->n_modes == 0 || meta_output->n_possible_crtcs == 0)
meta_monitor_manager_clear_output (meta_output);
else
n_actual_outputs++;
}
XRRFreeOutputInfo (output);

View File

@ -80,6 +80,10 @@
#ifdef HAVE_WAYLAND
#include "wayland/meta-wayland.h"
# endif
#if defined(HAVE_NATIVE_BACKEND) && defined(HAVE_WAYLAND)
#include <systemd/sd-login.h>
#endif
/*
@ -291,6 +295,95 @@ on_sigterm (gpointer user_data)
return G_SOURCE_REMOVE;
}
#if defined(HAVE_WAYLAND) && defined(HAVE_NATIVE_BACKEND)
static char *
find_logind_session_type (void)
{
char **sessions;
char *session_id;
char *session_type;
int ret, i;
ret = sd_pid_get_session (0, &session_id);
if (ret == 0 && session_id != NULL)
{
ret = sd_session_get_type (session_id, &session_type);
free (session_id);
if (ret < 0)
session_type = NULL;
goto out;
}
session_type = NULL;
ret = sd_uid_get_sessions (getuid (), TRUE, &sessions);
if (ret < 0 || sessions == NULL)
goto out;
for (i = 0; sessions[i] != NULL; i++)
{
ret = sd_session_get_type (sessions[i], &session_type);
if (ret < 0)
continue;
if (g_strcmp0 (session_type, "x11") == 0||
g_strcmp0 (session_type, "wayland") == 0)
break;
g_clear_pointer (&session_type, (GDestroyNotify) free);
}
for (i = 0; sessions[i] != NULL; i++)
free (sessions[i]);
free (sessions);
out:
return session_type;
}
static gboolean
check_for_wayland_session_type (void)
{
char *session_type = NULL;
gboolean is_wayland = FALSE;
session_type = find_logind_session_type ();
if (session_type != NULL)
{
is_wayland = g_strcmp0 (session_type, "wayland") == 0;
free (session_type);
}
return is_wayland;
}
#endif
static void
init_backend (void)
{
gboolean session_type_is_wayland = FALSE;
#if defined(HAVE_WAYLAND) && defined(HAVE_NATIVE_BACKEND)
session_type_is_wayland = check_for_wayland_session_type ();
#endif
#if defined(CLUTTER_WINDOWING_EGL) && defined(HAVE_NATIVE_BACKEND)
if (opt_display_server || session_type_is_wayland)
clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL);
else
#endif
clutter_set_windowing_backend (CLUTTER_WINDOWING_X11);
#ifdef HAVE_WAYLAND
meta_set_is_wayland_compositor (opt_wayland || session_type_is_wayland);
#endif
}
/**
* meta_init: (skip)
*
@ -323,16 +416,7 @@ meta_init (void)
if (g_getenv ("MUTTER_DEBUG"))
meta_set_debugging (TRUE);
#if defined(CLUTTER_WINDOWING_EGL) && defined(HAVE_NATIVE_BACKEND)
if (opt_display_server)
clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL);
else
#endif
clutter_set_windowing_backend (CLUTTER_WINDOWING_X11);
#ifdef HAVE_WAYLAND
meta_set_is_wayland_compositor (opt_wayland);
#endif
init_backend ();
if (g_get_home_dir ())
if (chdir (g_get_home_dir ()) < 0)

View File

@ -1579,8 +1579,10 @@ implement_showing (MetaWindow *window,
* windows we might want to know where they are on the screen,
* so we should place the window even if we're hiding it rather
* than showing it.
* Force placing windows only when they should be already mapped,
* see #751887
*/
if (!window->placed)
if (!window->placed && client_window_should_be_mapped (window))
meta_window_force_placement (window);
meta_window_hide (window);
@ -3534,10 +3536,7 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
{
const MetaMonitorInfo *old, *new;
if (window->type == META_WINDOW_DESKTOP)
return;
if (window->override_redirect)
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
{
meta_window_update_monitor (window, FALSE);
return;

View File

@ -9,6 +9,8 @@
<method name="TakeControl">
<arg name="force" type="b"/>
</method>
<method name="ReleaseControl">
</method>
<method name="TakeDevice">
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
<arg name="major" type="u" direction="in"/>

View File

@ -929,6 +929,7 @@ static GtkStyleContext *
create_style_context (GType widget_type,
GtkStyleContext *parent_style,
GtkCssProvider *provider,
const char *object_name,
const char *first_class,
...)
{
@ -948,6 +949,9 @@ create_style_context (GType widget_type,
gtk_widget_path_append_type (path, widget_type);
if (object_name)
gtk_widget_path_iter_set_object_name (path, -1, object_name);
va_start (ap, first_class);
for (name = first_class; name; name = va_arg (ap, const char *))
gtk_widget_path_iter_add_class (path, -1, name);
@ -987,6 +991,7 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (META_TYPE_FRAMES,
NULL,
provider,
"decoration",
GTK_STYLE_CLASS_BACKGROUND,
"window-frame",
"ssd",
@ -995,28 +1000,30 @@ meta_theme_create_style_info (GdkScreen *screen,
create_style_context (GTK_TYPE_HEADER_BAR,
style_info->styles[META_STYLE_ELEMENT_FRAME],
provider,
"headerbar",
GTK_STYLE_CLASS_TITLEBAR,
GTK_STYLE_CLASS_HORIZONTAL,
"default-decoration",
"header-bar",
NULL);
style_info->styles[META_STYLE_ELEMENT_TITLE] =
create_style_context (GTK_TYPE_LABEL,
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
provider,
"label",
GTK_STYLE_CLASS_TITLE,
NULL);
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
create_style_context (GTK_TYPE_BUTTON,
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
provider,
GTK_STYLE_CLASS_BUTTON,
"button",
"titlebutton",
NULL);
style_info->styles[META_STYLE_ELEMENT_IMAGE] =
create_style_context (GTK_TYPE_IMAGE,
style_info->styles[META_STYLE_ELEMENT_BUTTON],
provider,
"image",
NULL);
return style_info;
}
@ -1123,9 +1130,10 @@ meta_style_info_create_font_desc (MetaStyleInfo *style_info)
{
PangoFontDescription *font_desc;
const PangoFontDescription *override = meta_prefs_get_titlebar_font ();
GtkStyleContext *context = style_info->styles[META_STYLE_ELEMENT_TITLE];
gtk_style_context_get (style_info->styles[META_STYLE_ELEMENT_TITLE],
GTK_STATE_FLAG_NORMAL,
gtk_style_context_get (context,
gtk_style_context_get_state (context),
"font", &font_desc, NULL);
if (override)

View File

@ -933,22 +933,26 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
MetaWaylandOutput *wayland_output,
gboolean is_on_output)
{
gboolean was_on_output = g_hash_table_contains (surface->outputs,
wayland_output);
gpointer orig_id;
gboolean was_on_output = g_hash_table_lookup_extended (surface->outputs_to_destroy_notify_id,
wayland_output,
NULL, &orig_id);
if (!was_on_output && is_on_output)
{
g_signal_connect (wayland_output, "output-destroyed",
G_CALLBACK (surface_handle_output_destroy),
surface);
g_hash_table_add (surface->outputs, wayland_output);
gulong id;
id = g_signal_connect (wayland_output, "output-destroyed",
G_CALLBACK (surface_handle_output_destroy),
surface);
g_hash_table_insert (surface->outputs_to_destroy_notify_id, wayland_output,
GSIZE_TO_POINTER ((gsize)id));
surface_entered_output (surface, wayland_output);
}
else if (was_on_output && !is_on_output)
{
g_hash_table_remove (surface->outputs, wayland_output);
g_signal_handlers_disconnect_by_func (
wayland_output, (gpointer)surface_handle_output_destroy, surface);
g_hash_table_remove (surface->outputs_to_destroy_notify_id, wayland_output);
g_signal_handler_disconnect (wayland_output, (gulong) GPOINTER_TO_SIZE (orig_id));
surface_left_output (surface, wayland_output);
}
}
@ -986,6 +990,12 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
set_surface_is_on_output (surface, wayland_output, is_on_output);
}
static void
surface_output_disconnect_signal (gpointer key, gpointer value, gpointer user_data)
{
g_signal_handler_disconnect (key, (gulong) GPOINTER_TO_SIZE (value));
}
void
meta_wayland_surface_update_outputs (MetaWaylandSurface *surface)
{
@ -1036,7 +1046,8 @@ wl_surface_destructor (struct wl_resource *resource)
meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
g_hash_table_unref (surface->outputs);
g_hash_table_foreach (surface->outputs_to_destroy_notify_id, surface_output_disconnect_signal, surface);
g_hash_table_unref (surface->outputs_to_destroy_notify_id);
wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
wl_resource_destroy (cb->resource);
@ -1081,7 +1092,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
sync_drag_dest_funcs (surface);
surface->outputs = g_hash_table_new (NULL, NULL);
surface->outputs_to_destroy_notify_id = g_hash_table_new (NULL, NULL);
pending_state_init (&surface->pending);
return surface;

View File

@ -147,7 +147,7 @@ struct _MetaWaylandSurface
int scale;
int32_t offset_x, offset_y;
GList *subsurfaces;
GHashTable *outputs;
GHashTable *outputs_to_destroy_notify_id;
/* List of pending frame callbacks that needs to stay queued longer than one
* commit sequence, such as when it has not yet been assigned a role.

View File

@ -1843,7 +1843,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_window_type, LOAD_INIT | INCLUDE_OR | FORCE_INIT },
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts, NONE },
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts, NONE },
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, NONE },
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, LOAD_INIT | INCLUDE_OR },
{ display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | INCLUDE_OR },
{ 0 },
};

View File

@ -863,7 +863,7 @@ meta_window_x11_grab_op_began (MetaWindow *window,
if (window->sync_request_counter != None)
meta_window_x11_create_sync_request_alarm (window);
if (window->size_hints.width_inc > 1 || window->size_hints.height_inc > 1)
if (window->size_hints.width_inc > 2 || window->size_hints.height_inc > 2)
{
priv->showing_resize_popup = TRUE;
meta_window_refresh_resize_popup (window);