Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f3e1964362 | ||
![]() |
9b9083180f | ||
![]() |
7606f79a1e | ||
![]() |
99c0b82b15 | ||
![]() |
ca7c1d5e02 | ||
![]() |
4a770907c1 | ||
![]() |
049f1556dc | ||
![]() |
7b20d151ed | ||
![]() |
8ec0c99ff4 | ||
![]() |
cf3ee327a0 | ||
![]() |
3ec3cc248d | ||
![]() |
7fb3ecc12c | ||
![]() |
4c9af7267d | ||
![]() |
db4355ba1e | ||
![]() |
33150569cd | ||
![]() |
af2a13ded4 | ||
![]() |
8b200de35a | ||
![]() |
57ae203aab | ||
![]() |
bff75b64be |
13
NEWS
13
NEWS
@@ -1,3 +1,16 @@
|
||||
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]
|
||||
|
@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [19])
|
||||
m4_define([mutter_micro_version], [1])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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
|
@@ -1 +1,2 @@
|
||||
data/mutter-wayland.desktop.in
|
||||
# List of source files that should NOT be translated.
|
||||
# Please keep this file sorted alphabetically.
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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 ();
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
|
@@ -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 *
|
||||
@@ -808,15 +846,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
{
|
||||
GBytes *edid;
|
||||
|
||||
/* Get this first so that if there are no valid modes we
|
||||
can immediately skip to the next output without having
|
||||
to unwind all the assignments below. */
|
||||
output_get_modes (manager, meta_output, output);
|
||||
if (meta_output->n_modes == 0)
|
||||
continue;
|
||||
|
||||
meta_output->preferred_mode = meta_output->modes[0];
|
||||
|
||||
meta_output->winsys_id = resources->outputs[i];
|
||||
meta_output->name = g_strdup (output->name);
|
||||
|
||||
@@ -833,30 +862,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
meta_output->connector_type = output_get_connector_type (manager_xrandr, meta_output);
|
||||
|
||||
output_get_tile_info (manager_xrandr, meta_output);
|
||||
|
||||
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_modes (manager, meta_output, output);
|
||||
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);
|
||||
@@ -880,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);
|
||||
|
104
src/core/main.c
104
src/core/main.c
@@ -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)
|
||||
|
@@ -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);
|
||||
|
@@ -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"/>
|
||||
|
@@ -1000,32 +1000,30 @@ meta_theme_create_style_info (GdkScreen *screen,
|
||||
create_style_context (GTK_TYPE_HEADER_BAR,
|
||||
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
||||
provider,
|
||||
NULL,
|
||||
"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,
|
||||
NULL,
|
||||
"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,
|
||||
NULL,
|
||||
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,
|
||||
NULL,
|
||||
"image",
|
||||
NULL);
|
||||
return style_info;
|
||||
}
|
||||
@@ -1132,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)
|
||||
|
@@ -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 },
|
||||
};
|
||||
|
Reference in New Issue
Block a user