Compare commits
1 Commits
3.19.2
...
wip/garnac
Author | SHA1 | Date | |
---|---|---|---|
![]() |
74be2e9f94 |
27
NEWS
27
NEWS
@@ -1,30 +1,3 @@
|
|||||||
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
|
3.18.1
|
||||||
======
|
======
|
||||||
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,
|
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
AC_PREREQ(2.62)
|
AC_PREREQ(2.62)
|
||||||
|
|
||||||
m4_define([mutter_major_version], [3])
|
m4_define([mutter_major_version], [3])
|
||||||
m4_define([mutter_minor_version], [19])
|
m4_define([mutter_minor_version], [18])
|
||||||
m4_define([mutter_micro_version], [2])
|
m4_define([mutter_micro_version], [1])
|
||||||
|
|
||||||
m4_define([mutter_version],
|
m4_define([mutter_version],
|
||||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||||
@@ -58,7 +58,7 @@ CANBERRA_GTK_VERSION=0.26
|
|||||||
CLUTTER_PACKAGE=clutter-1.0
|
CLUTTER_PACKAGE=clutter-1.0
|
||||||
|
|
||||||
MUTTER_PC_MODULES="
|
MUTTER_PC_MODULES="
|
||||||
gtk+-3.0 >= 3.19.1
|
gtk+-3.0 >= 3.9.11
|
||||||
gio-unix-2.0 >= 2.35.1
|
gio-unix-2.0 >= 2.35.1
|
||||||
pango >= 1.2.0
|
pango >= 1.2.0
|
||||||
cairo >= 1.10.0
|
cairo >= 1.10.0
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
desktopfiles_in_files = \
|
desktopfiles_in_files = \
|
||||||
mutter.desktop.in
|
mutter.desktop.in \
|
||||||
|
mutter-wayland.desktop.in
|
||||||
desktopfilesdir = $(datadir)/applications
|
desktopfilesdir = $(datadir)/applications
|
||||||
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
|
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
|
||||||
|
|
||||||
|
17
data/mutter-wayland.desktop.in
Normal file
17
data/mutter-wayland.desktop.in
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[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,2 +1 @@
|
|||||||
# List of source files that should NOT be translated.
|
data/mutter-wayland.desktop.in
|
||||||
# Please keep this file sorted alphabetically.
|
|
||||||
|
@@ -24,8 +24,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <meta/meta-backend.h>
|
#include <meta/meta-backend.h>
|
||||||
#include "meta-backend-private.h"
|
#include "meta-backend-private.h"
|
||||||
#include "meta-input-settings-private.h"
|
#include "meta-input-settings-private.h"
|
||||||
@@ -628,10 +626,7 @@ meta_clutter_init (void)
|
|||||||
meta_create_backend ();
|
meta_create_backend ();
|
||||||
|
|
||||||
if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
|
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
|
* XXX: We cannot handle high dpi scaling yet, so fix the scale to 1
|
||||||
|
@@ -414,10 +414,6 @@ gint meta_monitor_manager_get_monitor_at_point (MetaMonitorManager
|
|||||||
gfloat x,
|
gfloat x,
|
||||||
gfloat y);
|
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
|
/* Returns true if transform causes width and height to be inverted
|
||||||
This is true for the odd transforms in the enum */
|
This is true for the odd transforms in the enum */
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
|
@@ -346,23 +346,6 @@ meta_monitor_manager_constructed (GObject *object)
|
|||||||
manager->in_init = FALSE;
|
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
|
static void
|
||||||
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
|
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
|
||||||
int n_old_outputs)
|
int n_old_outputs)
|
||||||
@@ -370,22 +353,22 @@ meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n_old_outputs; i++)
|
for (i = 0; i < n_old_outputs; i++)
|
||||||
meta_monitor_manager_clear_output (&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]);
|
||||||
|
}
|
||||||
|
|
||||||
g_free (old_outputs);
|
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
|
static void
|
||||||
meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
|
meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
|
||||||
int n_old_modes)
|
int n_old_modes)
|
||||||
@@ -393,20 +376,16 @@ meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n_old_modes; i++)
|
for (i = 0; i < n_old_modes; i++)
|
||||||
meta_monitor_manager_clear_mode (&old_modes[i]);
|
{
|
||||||
|
g_free (old_modes[i].name);
|
||||||
|
|
||||||
|
if (old_modes[i].driver_notify)
|
||||||
|
old_modes[i].driver_notify (&old_modes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
g_free (old_modes);
|
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
|
static void
|
||||||
meta_monitor_manager_free_crtc_array (MetaCRTC *old_crtcs,
|
meta_monitor_manager_free_crtc_array (MetaCRTC *old_crtcs,
|
||||||
int n_old_crtcs)
|
int n_old_crtcs)
|
||||||
@@ -414,7 +393,10 @@ meta_monitor_manager_free_crtc_array (MetaCRTC *old_crtcs,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n_old_crtcs; i++)
|
for (i = 0; i < n_old_crtcs; i++)
|
||||||
meta_monitor_manager_clear_crtc (&old_crtcs[i]);
|
{
|
||||||
|
if (old_crtcs[i].driver_notify)
|
||||||
|
old_crtcs[i].driver_notify (&old_crtcs[i]);
|
||||||
|
}
|
||||||
|
|
||||||
g_free (old_crtcs);
|
g_free (old_crtcs);
|
||||||
}
|
}
|
||||||
|
@@ -37,8 +37,6 @@
|
|||||||
#include "meta-cursor-renderer-native.h"
|
#include "meta-cursor-renderer-native.h"
|
||||||
#include "meta-launcher.h"
|
#include "meta-launcher.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
struct _MetaBackendNativePrivate
|
struct _MetaBackendNativePrivate
|
||||||
{
|
{
|
||||||
MetaLauncher *launcher;
|
MetaLauncher *launcher;
|
||||||
@@ -329,15 +327,8 @@ static void
|
|||||||
meta_backend_native_init (MetaBackendNative *native)
|
meta_backend_native_init (MetaBackendNative *native)
|
||||||
{
|
{
|
||||||
MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (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->barrier_manager = meta_barrier_manager_native_new ();
|
||||||
|
|
||||||
priv->up_client = up_client_new ();
|
priv->up_client = up_client_new ();
|
||||||
|
@@ -54,22 +54,30 @@ struct _MetaLauncher
|
|||||||
gboolean session_active;
|
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 *
|
static Login1Session *
|
||||||
get_session_proxy (GCancellable *cancellable,
|
get_session_proxy (GCancellable *cancellable)
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
char *proxy_path;
|
char *proxy_path;
|
||||||
char *session_id;
|
char *session_id;
|
||||||
Login1Session *session_proxy;
|
Login1Session *session_proxy;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
if (sd_pid_get_session (getpid (), &session_id) < 0)
|
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);
|
proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session", session_id);
|
||||||
|
|
||||||
@@ -77,9 +85,9 @@ get_session_proxy (GCancellable *cancellable,
|
|||||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||||
"org.freedesktop.login1",
|
"org.freedesktop.login1",
|
||||||
proxy_path,
|
proxy_path,
|
||||||
cancellable, error);
|
cancellable, &error);
|
||||||
if (!session_proxy)
|
if (!session_proxy)
|
||||||
g_prefix_error(error, "Could not get session proxy: ");
|
report_error_and_die ("Failed getting session proxy", error);
|
||||||
|
|
||||||
free (proxy_path);
|
free (proxy_path);
|
||||||
|
|
||||||
@@ -87,16 +95,16 @@ get_session_proxy (GCancellable *cancellable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Login1Seat *
|
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,
|
Login1Seat *seat = login1_seat_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
||||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||||
"org.freedesktop.login1",
|
"org.freedesktop.login1",
|
||||||
"/org/freedesktop/login1/seat/self",
|
"/org/freedesktop/login1/seat/self",
|
||||||
cancellable, error);
|
cancellable, &error);
|
||||||
if (!seat)
|
if (!seat)
|
||||||
g_prefix_error(error, "Could not get seat proxy: ");
|
report_error_and_die ("Could not get seat proxy", error);
|
||||||
|
|
||||||
return seat;
|
return seat;
|
||||||
}
|
}
|
||||||
@@ -295,9 +303,9 @@ get_primary_gpu_path (const gchar *seat_name)
|
|||||||
if (!devices)
|
if (!devices)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
for (tmp = devices; tmp != NULL && path == NULL; tmp = tmp->next)
|
for (tmp = devices; tmp != NULL; tmp = tmp->next)
|
||||||
{
|
{
|
||||||
GUdevDevice *platform_device = NULL, *pci_device = NULL;
|
GUdevDevice *pci_device;
|
||||||
GUdevDevice *dev = tmp->data;
|
GUdevDevice *dev = tmp->data;
|
||||||
gint boot_vga;
|
gint boot_vga;
|
||||||
const gchar *device_seat;
|
const gchar *device_seat;
|
||||||
@@ -324,26 +332,20 @@ get_primary_gpu_path (const gchar *seat_name)
|
|||||||
if (g_strcmp0 (seat_name, device_seat))
|
if (g_strcmp0 (seat_name, device_seat))
|
||||||
continue;
|
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);
|
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
|
||||||
|
if (!pci_device)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (platform_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");
|
||||||
path = g_strdup (g_udev_device_get_device_file (dev));
|
|
||||||
}
|
|
||||||
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_object_unref (pci_device);
|
||||||
|
|
||||||
|
if (boot_vga == 1)
|
||||||
|
{
|
||||||
|
/* found the boot_vga device */
|
||||||
|
path = g_strdup (g_udev_device_get_device_file (dev));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free_full (devices, g_object_unref);
|
g_list_free_full (devices, g_object_unref);
|
||||||
@@ -355,114 +357,69 @@ out:
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
get_kms_fd (Login1Session *session_proxy,
|
get_kms_fd (Login1Session *session_proxy,
|
||||||
const gchar *seat_id,
|
const gchar *seat_id,
|
||||||
int *fd_out,
|
int *fd_out)
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
int major, minor;
|
int major, minor;
|
||||||
int fd;
|
int fd;
|
||||||
|
gchar *path;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
g_autofree gchar *path = get_primary_gpu_path (seat_id);
|
path = get_primary_gpu_path (seat_id);
|
||||||
if (!path)
|
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))
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!take_device (session_proxy, major, minor, &fd, NULL, error))
|
g_free (path);
|
||||||
{
|
|
||||||
g_prefix_error (error, "Could not open DRM device: ");
|
if (!take_device (session_proxy, major, minor, &fd, NULL, &error))
|
||||||
return FALSE;
|
report_error_and_die ("Could not open DRM device", error);
|
||||||
}
|
|
||||||
|
|
||||||
*fd_out = fd;
|
*fd_out = fd;
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
get_seat_id (GError **error)
|
get_seat_id (void)
|
||||||
{
|
{
|
||||||
char *session_id, *seat_id;
|
char *session_id, *seat_id = NULL;
|
||||||
int r;
|
|
||||||
|
|
||||||
r = sd_pid_get_session (0, &session_id);
|
if (sd_pid_get_session (0, &session_id) < 0)
|
||||||
if (r < 0)
|
return NULL;
|
||||||
{
|
|
||||||
g_set_error (error,
|
|
||||||
G_IO_ERROR,
|
|
||||||
G_IO_ERROR_NOT_FOUND,
|
|
||||||
"Could not get session for PID: %s", g_strerror (-r));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = sd_session_get_seat (session_id, &seat_id);
|
/* on error the seat_id will remain NULL */
|
||||||
|
sd_session_get_seat (session_id, &seat_id);
|
||||||
free (session_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;
|
return seat_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaLauncher *
|
MetaLauncher *
|
||||||
meta_launcher_new (GError **error)
|
meta_launcher_new (void)
|
||||||
{
|
{
|
||||||
MetaLauncher *self = NULL;
|
MetaLauncher *self = NULL;
|
||||||
Login1Session *session_proxy = NULL;
|
Login1Session *session_proxy;
|
||||||
Login1Seat *seat_proxy = NULL;
|
char *seat_id;
|
||||||
char *seat_id = NULL;
|
GError *error = NULL;
|
||||||
gboolean have_control = FALSE;
|
|
||||||
int kms_fd;
|
int kms_fd;
|
||||||
|
|
||||||
session_proxy = get_session_proxy (NULL, error);
|
session_proxy = get_session_proxy (NULL);
|
||||||
if (!session_proxy)
|
if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, &error))
|
||||||
goto fail;
|
report_error_and_die ("Could not take control", error);
|
||||||
|
|
||||||
if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, error))
|
seat_id = get_seat_id ();
|
||||||
{
|
|
||||||
g_prefix_error (error, "Could not take control: ");
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
have_control = TRUE;
|
|
||||||
|
|
||||||
seat_id = get_seat_id (error);
|
|
||||||
if (!seat_id)
|
if (!seat_id)
|
||||||
goto fail;
|
g_error ("Failed getting seat id");
|
||||||
|
|
||||||
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);
|
free (seat_id);
|
||||||
|
|
||||||
self = g_slice_new0 (MetaLauncher);
|
self = g_slice_new0 (MetaLauncher);
|
||||||
self->session_proxy = session_proxy;
|
self->session_proxy = session_proxy;
|
||||||
self->seat_proxy = seat_proxy;
|
self->seat_proxy = get_seat_proxy (NULL);
|
||||||
|
|
||||||
self->session_active = TRUE;
|
self->session_active = TRUE;
|
||||||
|
|
||||||
@@ -472,16 +429,8 @@ meta_launcher_new (GError **error)
|
|||||||
self);
|
self);
|
||||||
|
|
||||||
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
|
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
|
||||||
|
|
||||||
return 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
|
void
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
typedef struct _MetaLauncher MetaLauncher;
|
typedef struct _MetaLauncher MetaLauncher;
|
||||||
|
|
||||||
MetaLauncher *meta_launcher_new (GError **error);
|
MetaLauncher *meta_launcher_new (void);
|
||||||
void meta_launcher_free (MetaLauncher *self);
|
void meta_launcher_free (MetaLauncher *self);
|
||||||
|
|
||||||
gboolean meta_launcher_activate_session (MetaLauncher *self,
|
gboolean meta_launcher_activate_session (MetaLauncher *self,
|
||||||
|
@@ -82,7 +82,6 @@ struct _MetaBackendX11Private
|
|||||||
gchar *keymap_layouts;
|
gchar *keymap_layouts;
|
||||||
gchar *keymap_variants;
|
gchar *keymap_variants;
|
||||||
gchar *keymap_options;
|
gchar *keymap_options;
|
||||||
int locked_group;
|
|
||||||
};
|
};
|
||||||
typedef struct _MetaBackendX11Private MetaBackendX11Private;
|
typedef struct _MetaBackendX11Private MetaBackendX11Private;
|
||||||
|
|
||||||
@@ -298,23 +297,15 @@ handle_host_xevent (MetaBackend *backend,
|
|||||||
|
|
||||||
if (event->type == priv->xkb_event_base)
|
if (event->type == priv->xkb_event_base)
|
||||||
{
|
{
|
||||||
XkbEvent *xkb_ev = (XkbEvent *) event;
|
XkbAnyEvent *xkb_ev = (XkbAnyEvent *) event;
|
||||||
|
|
||||||
if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
|
if (xkb_ev->device == META_VIRTUAL_CORE_KEYBOARD_ID)
|
||||||
{
|
{
|
||||||
switch (xkb_ev->any.xkb_type)
|
switch (xkb_ev->xkb_type)
|
||||||
{
|
{
|
||||||
case XkbNewKeyboardNotify:
|
case XkbNewKeyboardNotify:
|
||||||
case XkbMapNotify:
|
case XkbMapNotify:
|
||||||
keymap_changed (backend);
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -785,7 +776,6 @@ meta_backend_x11_lock_layout_group (MetaBackend *backend,
|
|||||||
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
|
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
|
||||||
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
||||||
|
|
||||||
priv->locked_group = idx;
|
|
||||||
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, idx);
|
XkbLockGroup (priv->xdisplay, XkbUseCoreKbd, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -661,44 +661,6 @@ output_get_modes (MetaMonitorManager *manager,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
meta_output->n_modes = n_actual_modes;
|
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 *
|
static char *
|
||||||
@@ -863,7 +825,31 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
|||||||
|
|
||||||
output_get_tile_info (manager_xrandr, meta_output);
|
output_get_tile_info (manager_xrandr, meta_output);
|
||||||
output_get_modes (manager, meta_output, output);
|
output_get_modes (manager, meta_output, output);
|
||||||
output_get_crtcs (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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meta_output->n_possible_clones = output->nclone;
|
meta_output->n_possible_clones = output->nclone;
|
||||||
meta_output->possible_clones = g_new0 (MetaOutput *, meta_output->n_possible_clones);
|
meta_output->possible_clones = g_new0 (MetaOutput *, meta_output->n_possible_clones);
|
||||||
@@ -887,10 +873,7 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
|||||||
else
|
else
|
||||||
meta_output->backlight = -1;
|
meta_output->backlight = -1;
|
||||||
|
|
||||||
if (meta_output->n_modes == 0 || meta_output->n_possible_crtcs == 0)
|
n_actual_outputs++;
|
||||||
meta_monitor_manager_clear_output (meta_output);
|
|
||||||
else
|
|
||||||
n_actual_outputs++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XRRFreeOutputInfo (output);
|
XRRFreeOutputInfo (output);
|
||||||
|
104
src/core/main.c
104
src/core/main.c
@@ -80,10 +80,6 @@
|
|||||||
|
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
#include "wayland/meta-wayland.h"
|
#include "wayland/meta-wayland.h"
|
||||||
# endif
|
|
||||||
|
|
||||||
#if defined(HAVE_NATIVE_BACKEND) && defined(HAVE_WAYLAND)
|
|
||||||
#include <systemd/sd-login.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -295,95 +291,6 @@ on_sigterm (gpointer user_data)
|
|||||||
return G_SOURCE_REMOVE;
|
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)
|
* meta_init: (skip)
|
||||||
*
|
*
|
||||||
@@ -416,7 +323,16 @@ meta_init (void)
|
|||||||
if (g_getenv ("MUTTER_DEBUG"))
|
if (g_getenv ("MUTTER_DEBUG"))
|
||||||
meta_set_debugging (TRUE);
|
meta_set_debugging (TRUE);
|
||||||
|
|
||||||
init_backend ();
|
#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
|
||||||
|
|
||||||
if (g_get_home_dir ())
|
if (g_get_home_dir ())
|
||||||
if (chdir (g_get_home_dir ()) < 0)
|
if (chdir (g_get_home_dir ()) < 0)
|
||||||
|
@@ -1579,10 +1579,8 @@ implement_showing (MetaWindow *window,
|
|||||||
* windows we might want to know where they are on the screen,
|
* 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
|
* so we should place the window even if we're hiding it rather
|
||||||
* than showing it.
|
* than showing it.
|
||||||
* Force placing windows only when they should be already mapped,
|
|
||||||
* see #751887
|
|
||||||
*/
|
*/
|
||||||
if (!window->placed && client_window_should_be_mapped (window))
|
if (!window->placed)
|
||||||
meta_window_force_placement (window);
|
meta_window_force_placement (window);
|
||||||
|
|
||||||
meta_window_hide (window);
|
meta_window_hide (window);
|
||||||
@@ -3536,7 +3534,10 @@ meta_window_update_for_monitors_changed (MetaWindow *window)
|
|||||||
{
|
{
|
||||||
const MetaMonitorInfo *old, *new;
|
const MetaMonitorInfo *old, *new;
|
||||||
|
|
||||||
if (window->override_redirect || window->type == META_WINDOW_DESKTOP)
|
if (window->type == META_WINDOW_DESKTOP)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (window->override_redirect)
|
||||||
{
|
{
|
||||||
meta_window_update_monitor (window, FALSE);
|
meta_window_update_monitor (window, FALSE);
|
||||||
return;
|
return;
|
||||||
|
@@ -9,8 +9,6 @@
|
|||||||
<method name="TakeControl">
|
<method name="TakeControl">
|
||||||
<arg name="force" type="b"/>
|
<arg name="force" type="b"/>
|
||||||
</method>
|
</method>
|
||||||
<method name="ReleaseControl">
|
|
||||||
</method>
|
|
||||||
<method name="TakeDevice">
|
<method name="TakeDevice">
|
||||||
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
|
<annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
|
||||||
<arg name="major" type="u" direction="in"/>
|
<arg name="major" type="u" direction="in"/>
|
||||||
|
@@ -929,7 +929,6 @@ static GtkStyleContext *
|
|||||||
create_style_context (GType widget_type,
|
create_style_context (GType widget_type,
|
||||||
GtkStyleContext *parent_style,
|
GtkStyleContext *parent_style,
|
||||||
GtkCssProvider *provider,
|
GtkCssProvider *provider,
|
||||||
const char *object_name,
|
|
||||||
const char *first_class,
|
const char *first_class,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
@@ -949,9 +948,6 @@ create_style_context (GType widget_type,
|
|||||||
|
|
||||||
gtk_widget_path_append_type (path, 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);
|
va_start (ap, first_class);
|
||||||
for (name = first_class; name; name = va_arg (ap, const char *))
|
for (name = first_class; name; name = va_arg (ap, const char *))
|
||||||
gtk_widget_path_iter_add_class (path, -1, name);
|
gtk_widget_path_iter_add_class (path, -1, name);
|
||||||
@@ -991,7 +987,6 @@ meta_theme_create_style_info (GdkScreen *screen,
|
|||||||
create_style_context (META_TYPE_FRAMES,
|
create_style_context (META_TYPE_FRAMES,
|
||||||
NULL,
|
NULL,
|
||||||
provider,
|
provider,
|
||||||
"decoration",
|
|
||||||
GTK_STYLE_CLASS_BACKGROUND,
|
GTK_STYLE_CLASS_BACKGROUND,
|
||||||
"window-frame",
|
"window-frame",
|
||||||
"ssd",
|
"ssd",
|
||||||
@@ -1000,30 +995,28 @@ meta_theme_create_style_info (GdkScreen *screen,
|
|||||||
create_style_context (GTK_TYPE_HEADER_BAR,
|
create_style_context (GTK_TYPE_HEADER_BAR,
|
||||||
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
style_info->styles[META_STYLE_ELEMENT_FRAME],
|
||||||
provider,
|
provider,
|
||||||
"headerbar",
|
|
||||||
GTK_STYLE_CLASS_TITLEBAR,
|
GTK_STYLE_CLASS_TITLEBAR,
|
||||||
GTK_STYLE_CLASS_HORIZONTAL,
|
GTK_STYLE_CLASS_HORIZONTAL,
|
||||||
"default-decoration",
|
"default-decoration",
|
||||||
|
"header-bar",
|
||||||
NULL);
|
NULL);
|
||||||
style_info->styles[META_STYLE_ELEMENT_TITLE] =
|
style_info->styles[META_STYLE_ELEMENT_TITLE] =
|
||||||
create_style_context (GTK_TYPE_LABEL,
|
create_style_context (GTK_TYPE_LABEL,
|
||||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||||
provider,
|
provider,
|
||||||
"label",
|
|
||||||
GTK_STYLE_CLASS_TITLE,
|
GTK_STYLE_CLASS_TITLE,
|
||||||
NULL);
|
NULL);
|
||||||
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
|
style_info->styles[META_STYLE_ELEMENT_BUTTON] =
|
||||||
create_style_context (GTK_TYPE_BUTTON,
|
create_style_context (GTK_TYPE_BUTTON,
|
||||||
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
|
||||||
provider,
|
provider,
|
||||||
"button",
|
GTK_STYLE_CLASS_BUTTON,
|
||||||
"titlebutton",
|
"titlebutton",
|
||||||
NULL);
|
NULL);
|
||||||
style_info->styles[META_STYLE_ELEMENT_IMAGE] =
|
style_info->styles[META_STYLE_ELEMENT_IMAGE] =
|
||||||
create_style_context (GTK_TYPE_IMAGE,
|
create_style_context (GTK_TYPE_IMAGE,
|
||||||
style_info->styles[META_STYLE_ELEMENT_BUTTON],
|
style_info->styles[META_STYLE_ELEMENT_BUTTON],
|
||||||
provider,
|
provider,
|
||||||
"image",
|
|
||||||
NULL);
|
NULL);
|
||||||
return style_info;
|
return style_info;
|
||||||
}
|
}
|
||||||
@@ -1130,10 +1123,9 @@ meta_style_info_create_font_desc (MetaStyleInfo *style_info)
|
|||||||
{
|
{
|
||||||
PangoFontDescription *font_desc;
|
PangoFontDescription *font_desc;
|
||||||
const PangoFontDescription *override = meta_prefs_get_titlebar_font ();
|
const PangoFontDescription *override = meta_prefs_get_titlebar_font ();
|
||||||
GtkStyleContext *context = style_info->styles[META_STYLE_ELEMENT_TITLE];
|
|
||||||
|
|
||||||
gtk_style_context_get (context,
|
gtk_style_context_get (style_info->styles[META_STYLE_ELEMENT_TITLE],
|
||||||
gtk_style_context_get_state (context),
|
GTK_STATE_FLAG_NORMAL,
|
||||||
"font", &font_desc, NULL);
|
"font", &font_desc, NULL);
|
||||||
|
|
||||||
if (override)
|
if (override)
|
||||||
|
@@ -494,10 +494,27 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|||||||
{
|
{
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
wl_fixed_t x_value = 0, y_value = 0;
|
wl_fixed_t x_value = 0, y_value = 0;
|
||||||
|
enum wl_pointer_axis_source source = -1;
|
||||||
|
|
||||||
if (clutter_event_is_pointer_emulated (event))
|
if (clutter_event_is_pointer_emulated (event))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
switch (event->scroll.scroll_source)
|
||||||
|
{
|
||||||
|
case CLUTTER_SCROLL_SOURCE_WHEEL:
|
||||||
|
source = WL_POINTER_AXIS_SOURCE_WHEEL;
|
||||||
|
break;
|
||||||
|
case CLUTTER_SCROLL_SOURCE_FINGER:
|
||||||
|
source = WL_POINTER_AXIS_SOURCE_FINGER;
|
||||||
|
break;
|
||||||
|
case CLUTTER_SCROLL_SOURCE_CONTINUOUS:
|
||||||
|
source = WL_POINTER_AXIS_SOURCE_CONTINUOUS;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
source = WL_POINTER_AXIS_SOURCE_WHEEL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (clutter_event_get_scroll_direction (event))
|
switch (clutter_event_get_scroll_direction (event))
|
||||||
{
|
{
|
||||||
case CLUTTER_SCROLL_UP:
|
case CLUTTER_SCROLL_UP:
|
||||||
@@ -537,12 +554,31 @@ handle_scroll_event (MetaWaylandPointer *pointer,
|
|||||||
{
|
{
|
||||||
wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
|
wl_resource_for_each (resource, &pointer->focus_client->pointer_resources)
|
||||||
{
|
{
|
||||||
|
if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
|
||||||
|
wl_pointer_send_axis_source (resource, source);
|
||||||
|
|
||||||
if (x_value)
|
if (x_value)
|
||||||
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
||||||
WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
|
WL_POINTER_AXIS_HORIZONTAL_SCROLL, x_value);
|
||||||
|
|
||||||
|
if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_HORIZONTAL) &&
|
||||||
|
wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
|
||||||
|
wl_pointer_send_axis_stop (resource,
|
||||||
|
clutter_event_get_time (event),
|
||||||
|
WL_POINTER_AXIS_HORIZONTAL_SCROLL);
|
||||||
|
|
||||||
if (y_value)
|
if (y_value)
|
||||||
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
wl_pointer_send_axis (resource, clutter_event_get_time (event),
|
||||||
WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
|
WL_POINTER_AXIS_VERTICAL_SCROLL, y_value);
|
||||||
|
|
||||||
|
if ((event->scroll.finish_flags & CLUTTER_SCROLL_FINISHED_VERTICAL) &&
|
||||||
|
wl_resource_get_version (resource) >= WL_POINTER_AXIS_STOP_SINCE_VERSION)
|
||||||
|
wl_pointer_send_axis_stop (resource,
|
||||||
|
clutter_event_get_time (event),
|
||||||
|
WL_POINTER_AXIS_VERTICAL_SCROLL);
|
||||||
|
|
||||||
|
if (wl_resource_get_version (resource) >= WL_POINTER_AXIS_SOURCE_SINCE_VERSION)
|
||||||
|
wl_pointer_send_axis_frame (resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -933,26 +933,22 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
|
|||||||
MetaWaylandOutput *wayland_output,
|
MetaWaylandOutput *wayland_output,
|
||||||
gboolean is_on_output)
|
gboolean is_on_output)
|
||||||
{
|
{
|
||||||
gpointer orig_id;
|
gboolean was_on_output = g_hash_table_contains (surface->outputs,
|
||||||
gboolean was_on_output = g_hash_table_lookup_extended (surface->outputs_to_destroy_notify_id,
|
wayland_output);
|
||||||
wayland_output,
|
|
||||||
NULL, &orig_id);
|
|
||||||
|
|
||||||
if (!was_on_output && is_on_output)
|
if (!was_on_output && is_on_output)
|
||||||
{
|
{
|
||||||
gulong id;
|
g_signal_connect (wayland_output, "output-destroyed",
|
||||||
|
G_CALLBACK (surface_handle_output_destroy),
|
||||||
id = g_signal_connect (wayland_output, "output-destroyed",
|
surface);
|
||||||
G_CALLBACK (surface_handle_output_destroy),
|
g_hash_table_add (surface->outputs, wayland_output);
|
||||||
surface);
|
|
||||||
g_hash_table_insert (surface->outputs_to_destroy_notify_id, wayland_output,
|
|
||||||
GSIZE_TO_POINTER ((gsize)id));
|
|
||||||
surface_entered_output (surface, wayland_output);
|
surface_entered_output (surface, wayland_output);
|
||||||
}
|
}
|
||||||
else if (was_on_output && !is_on_output)
|
else if (was_on_output && !is_on_output)
|
||||||
{
|
{
|
||||||
g_hash_table_remove (surface->outputs_to_destroy_notify_id, wayland_output);
|
g_hash_table_remove (surface->outputs, wayland_output);
|
||||||
g_signal_handler_disconnect (wayland_output, (gulong) GPOINTER_TO_SIZE (orig_id));
|
g_signal_handlers_disconnect_by_func (
|
||||||
|
wayland_output, (gpointer)surface_handle_output_destroy, surface);
|
||||||
surface_left_output (surface, wayland_output);
|
surface_left_output (surface, wayland_output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -990,12 +986,6 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
|
|||||||
set_surface_is_on_output (surface, wayland_output, is_on_output);
|
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
|
void
|
||||||
meta_wayland_surface_update_outputs (MetaWaylandSurface *surface)
|
meta_wayland_surface_update_outputs (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
@@ -1046,8 +1036,7 @@ wl_surface_destructor (struct wl_resource *resource)
|
|||||||
|
|
||||||
meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
|
meta_wayland_compositor_destroy_frame_callbacks (compositor, surface);
|
||||||
|
|
||||||
g_hash_table_foreach (surface->outputs_to_destroy_notify_id, surface_output_disconnect_signal, surface);
|
g_hash_table_unref (surface->outputs);
|
||||||
g_hash_table_unref (surface->outputs_to_destroy_notify_id);
|
|
||||||
|
|
||||||
wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
|
wl_list_for_each_safe (cb, next, &surface->pending_frame_callback_list, link)
|
||||||
wl_resource_destroy (cb->resource);
|
wl_resource_destroy (cb->resource);
|
||||||
@@ -1092,7 +1081,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
|||||||
|
|
||||||
sync_drag_dest_funcs (surface);
|
sync_drag_dest_funcs (surface);
|
||||||
|
|
||||||
surface->outputs_to_destroy_notify_id = g_hash_table_new (NULL, NULL);
|
surface->outputs = g_hash_table_new (NULL, NULL);
|
||||||
|
|
||||||
pending_state_init (&surface->pending);
|
pending_state_init (&surface->pending);
|
||||||
return surface;
|
return surface;
|
||||||
|
@@ -147,7 +147,7 @@ struct _MetaWaylandSurface
|
|||||||
int scale;
|
int scale;
|
||||||
int32_t offset_x, offset_y;
|
int32_t offset_x, offset_y;
|
||||||
GList *subsurfaces;
|
GList *subsurfaces;
|
||||||
GHashTable *outputs_to_destroy_notify_id;
|
GHashTable *outputs;
|
||||||
|
|
||||||
/* List of pending frame callbacks that needs to stay queued longer than one
|
/* 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.
|
* commit sequence, such as when it has not yet been assigned a role.
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#define META_WL_DATA_DEVICE_MANAGER_VERSION 2
|
#define META_WL_DATA_DEVICE_MANAGER_VERSION 2
|
||||||
#define META_XDG_SHELL_VERSION 1
|
#define META_XDG_SHELL_VERSION 1
|
||||||
#define META_WL_SHELL_VERSION 1
|
#define META_WL_SHELL_VERSION 1
|
||||||
#define META_WL_SEAT_VERSION 4
|
#define META_WL_SEAT_VERSION 5
|
||||||
#define META_WL_OUTPUT_VERSION 2
|
#define META_WL_OUTPUT_VERSION 2
|
||||||
#define META_XSERVER_VERSION 1
|
#define META_XSERVER_VERSION 1
|
||||||
#define META_GTK_SHELL_VERSION 2
|
#define META_GTK_SHELL_VERSION 2
|
||||||
|
@@ -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_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, META_PROP_VALUE_INVALID, reload_struts, NONE },
|
||||||
{ display->atom__NET_WM_STRUT_PARTIAL, 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, LOAD_INIT | INCLUDE_OR },
|
{ display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL, reload_bypass_compositor, NONE },
|
||||||
{ display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | INCLUDE_OR },
|
{ display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity, LOAD_INIT | INCLUDE_OR },
|
||||||
{ 0 },
|
{ 0 },
|
||||||
};
|
};
|
||||||
|
@@ -863,7 +863,7 @@ meta_window_x11_grab_op_began (MetaWindow *window,
|
|||||||
if (window->sync_request_counter != None)
|
if (window->sync_request_counter != None)
|
||||||
meta_window_x11_create_sync_request_alarm (window);
|
meta_window_x11_create_sync_request_alarm (window);
|
||||||
|
|
||||||
if (window->size_hints.width_inc > 2 || window->size_hints.height_inc > 2)
|
if (window->size_hints.width_inc > 1 || window->size_hints.height_inc > 1)
|
||||||
{
|
{
|
||||||
priv->showing_resize_popup = TRUE;
|
priv->showing_resize_popup = TRUE;
|
||||||
meta_window_refresh_resize_popup (window);
|
meta_window_refresh_resize_popup (window);
|
||||||
|
Reference in New Issue
Block a user