Compare commits
19 Commits
wip/fullsc
...
3.18.2
Author | SHA1 | Date | |
---|---|---|---|
c89918a339 | |||
15b5e6717f | |||
3b977f18b3 | |||
233c148c16 | |||
8c561a9075 | |||
eb1df05570 | |||
ffa8c0039d | |||
379044c069 | |||
c5f40f7481 | |||
c9b0d04503 | |||
0d41399fed | |||
5d695c674e | |||
7717725270 | |||
6542ef2970 | |||
83d19c8ae2 | |||
9c81b718f9 | |||
3a63d58d9e | |||
a95ae4d178 | |||
a692fd3808 |
26
NEWS
26
NEWS
@ -1,3 +1,29 @@
|
||||
3.18.2
|
||||
======
|
||||
* Misc. crash fixes [Jonas, Rui; #756675, #756660, #757148, #756796]
|
||||
* Fix modifiers-only input source switching on Ubuntu [Alberts; #756543]
|
||||
* Exit cleanly on initialization errors [Owen; #757311]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Rui Matos, Alberts Muktupāvels, Florian Müllner, Owen W. Taylor
|
||||
|
||||
Translations:
|
||||
Daniel Șerbănescu [ro]
|
||||
|
||||
3.18.1
|
||||
======
|
||||
* Misc. crash fixes [Jonas, Rui, Carlos, Owen, Florian; #755096, #754979,
|
||||
#755490, #754357, #745785, #756642]
|
||||
* Improve HiDPI support on wayland [Jonas; #755097]
|
||||
* Fix doubly-scaled cursor on XWayland HiDPI [Jonas; #755099]
|
||||
* Stop hiding titlebar buttons in dialogs [Florian; #641630]
|
||||
* Add support for fullscreen/unfullscreen animations [Cosimo; #707248]
|
||||
* Misc. bug fixes [Rui, Colin, Florian; #743339, #752047, #756074, #756649]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Cosimo Cecchi, Carlos Garnacho, Rui Matos, Florian Müllner,
|
||||
Jasper St. Pierre, Colin Walters, Owen W. Taylor
|
||||
|
||||
3.18.0
|
||||
======
|
||||
* Misc. fixes [Florian, Jonas; #753434]
|
||||
|
@ -2,7 +2,7 @@ AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [18])
|
||||
m4_define([mutter_micro_version], [0])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
@ -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;
|
||||
}
|
||||
@ -357,69 +349,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 +466,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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -637,6 +637,70 @@ output_get_connector_type (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
return META_CONNECTOR_TYPE_Unknown;
|
||||
}
|
||||
|
||||
static void
|
||||
output_get_modes (MetaMonitorManager *manager,
|
||||
MetaOutput *meta_output,
|
||||
XRROutputInfo *output)
|
||||
{
|
||||
guint j, k;
|
||||
guint n_actual_modes;
|
||||
|
||||
meta_output->modes = g_new0 (MetaMonitorMode *, output->nmode);
|
||||
|
||||
n_actual_modes = 0;
|
||||
for (j = 0; j < (guint)output->nmode; j++)
|
||||
{
|
||||
for (k = 0; k < manager->n_modes; k++)
|
||||
{
|
||||
if (output->modes[j] == (XID)manager->modes[k].mode_id)
|
||||
{
|
||||
meta_output->modes[n_actual_modes] = &manager->modes[k];
|
||||
n_actual_modes += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 *
|
||||
get_xmode_name (XRRModeInfo *xmode)
|
||||
{
|
||||
@ -773,6 +837,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
||||
MetaOutput *meta_output;
|
||||
|
||||
output = XRRGetOutputInfo (manager_xrandr->xdisplay, resources, resources->outputs[i]);
|
||||
if (!output)
|
||||
continue;
|
||||
|
||||
meta_output = &manager->outputs[n_actual_outputs];
|
||||
|
||||
@ -796,44 +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_modes = output->nmode;
|
||||
meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
|
||||
for (j = 0; j < meta_output->n_modes; j++)
|
||||
{
|
||||
for (k = 0; k < manager->n_modes; k++)
|
||||
{
|
||||
if (output->modes[j] == (XID)manager->modes[k].mode_id)
|
||||
{
|
||||
meta_output->modes[j] = &manager->modes[k];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
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_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);
|
||||
@ -857,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);
|
||||
|
@ -3534,10 +3534,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;
|
||||
|
@ -58,7 +58,7 @@ typedef enum {
|
||||
META_SIZE_CHANGE_MAXIMIZE,
|
||||
META_SIZE_CHANGE_UNMAXIMIZE,
|
||||
META_SIZE_CHANGE_FULLSCREEN,
|
||||
META_SIZE_CHANGE_UNFULLSCREEN
|
||||
META_SIZE_CHANGE_UNFULLSCREEN,
|
||||
} MetaSizeChange;
|
||||
|
||||
MetaCompositor *meta_compositor_new (MetaDisplay *display);
|
||||
|
@ -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"/>
|
||||
|
@ -1515,15 +1515,15 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
|
||||
surface,
|
||||
xdg_popup_destructor);
|
||||
|
||||
surface->xdg_popup = popup_resource;
|
||||
surface->xdg_shell_resource = resource;
|
||||
|
||||
if (!meta_wayland_pointer_can_popup (&seat->pointer, serial))
|
||||
{
|
||||
xdg_popup_send_popup_done (popup_resource);
|
||||
return;
|
||||
}
|
||||
|
||||
surface->xdg_popup = popup_resource;
|
||||
surface->xdg_shell_resource = resource;
|
||||
|
||||
surface->popup.parent = parent_surf;
|
||||
surface->popup.parent_destroy_listener.notify = handle_popup_parent_destroyed;
|
||||
wl_resource_add_destroy_listener (parent_surf->resource,
|
||||
|
@ -691,7 +691,8 @@ meta_spew_event_print (MetaDisplay *display,
|
||||
static gboolean
|
||||
handle_window_focus_event (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XIEnterEvent *event)
|
||||
XIEnterEvent *event,
|
||||
unsigned long serial)
|
||||
{
|
||||
MetaWindow *focus_window;
|
||||
#ifdef WITH_VERBOSE_MODE
|
||||
@ -726,7 +727,7 @@ handle_window_focus_event (MetaDisplay *display,
|
||||
event->event, window_type,
|
||||
meta_event_mode_to_string (event->mode),
|
||||
meta_event_detail_to_string (event->mode),
|
||||
event->serial);
|
||||
serial);
|
||||
#endif
|
||||
|
||||
/* FIXME our pointer tracking is broken; see how
|
||||
@ -770,7 +771,7 @@ handle_window_focus_event (MetaDisplay *display,
|
||||
if (event->evtype == XI_FocusIn)
|
||||
{
|
||||
display->server_focus_window = event->event;
|
||||
display->server_focus_serial = event->serial;
|
||||
display->server_focus_serial = serial;
|
||||
focus_window = window;
|
||||
}
|
||||
else if (event->evtype == XI_FocusOut)
|
||||
@ -784,7 +785,7 @@ handle_window_focus_event (MetaDisplay *display,
|
||||
}
|
||||
|
||||
display->server_focus_window = None;
|
||||
display->server_focus_serial = event->serial;
|
||||
display->server_focus_serial = serial;
|
||||
focus_window = NULL;
|
||||
}
|
||||
else
|
||||
@ -829,8 +830,9 @@ crossing_serial_is_ignored (MetaDisplay *display,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_input_xevent (MetaDisplay *display,
|
||||
XIEvent *input_event)
|
||||
handle_input_xevent (MetaDisplay *display,
|
||||
XIEvent *input_event,
|
||||
unsigned long serial)
|
||||
{
|
||||
XIEnterEvent *enter_event = (XIEnterEvent *) input_event;
|
||||
Window modified;
|
||||
@ -867,7 +869,7 @@ handle_input_xevent (MetaDisplay *display,
|
||||
/* Check if we've entered a window; do this even if window->has_focus to
|
||||
* avoid races.
|
||||
*/
|
||||
if (window && !crossing_serial_is_ignored (display, input_event->serial) &&
|
||||
if (window && !crossing_serial_is_ignored (display, serial) &&
|
||||
enter_event->mode != XINotifyGrab &&
|
||||
enter_event->mode != XINotifyUngrab &&
|
||||
enter_event->detail != XINotifyInferior &&
|
||||
@ -892,7 +894,7 @@ handle_input_xevent (MetaDisplay *display,
|
||||
break;
|
||||
case XI_FocusIn:
|
||||
case XI_FocusOut:
|
||||
if (handle_window_focus_event (display, window, enter_event) &&
|
||||
if (handle_window_focus_event (display, window, enter_event, serial) &&
|
||||
enter_event->event == enter_event->root)
|
||||
{
|
||||
if (enter_event->evtype == XI_FocusIn &&
|
||||
@ -1736,7 +1738,7 @@ meta_display_handle_xevent (MetaDisplay *display,
|
||||
}
|
||||
#endif /* HAVE_XI23 */
|
||||
|
||||
if (handle_input_xevent (display, input_event))
|
||||
if (handle_input_xevent (display, input_event, event->xany.serial))
|
||||
{
|
||||
bypass_gtk = bypass_compositor = TRUE;
|
||||
goto out;
|
||||
|
@ -182,6 +182,8 @@ argbdata_to_surface (gulong *argb_data, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_mark_dirty (surface);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
|
@ -946,7 +946,15 @@ save_state (void)
|
||||
|
||||
/* Sticky */
|
||||
if (window->on_all_workspaces_requested)
|
||||
fputs (" <sticky/>\n", outfile);
|
||||
{
|
||||
fputs (" <sticky/>\n", outfile);
|
||||
} else {
|
||||
int n;
|
||||
n = meta_workspace_index (window->workspace);
|
||||
fprintf (outfile,
|
||||
" <workspace index=\"%d\"/>\n", n);
|
||||
}
|
||||
|
||||
|
||||
/* Minimized */
|
||||
if (window->minimized)
|
||||
@ -963,14 +971,6 @@ save_state (void)
|
||||
window->saved_rect.height);
|
||||
}
|
||||
|
||||
/* Workspaces we're on */
|
||||
{
|
||||
int n;
|
||||
n = meta_workspace_index (window->workspace);
|
||||
fprintf (outfile,
|
||||
" <workspace index=\"%d\"/>\n", n);
|
||||
}
|
||||
|
||||
/* Gravity */
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
@ -2000,16 +2000,12 @@ meta_window_move_resize_request (MetaWindow *window,
|
||||
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION))
|
||||
{
|
||||
MetaRectangle rect, monitor_rect;
|
||||
MetaRectangle old_frame_rect, old_buffer_rect;
|
||||
gboolean legacy_fullscreen;
|
||||
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
|
||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||
meta_window_get_buffer_rect (window, &old_buffer_rect);
|
||||
meta_screen_get_monitor_geometry (window->screen, window->monitor->number, &monitor_rect);
|
||||
|
||||
/* Workaround braindead legacy apps that don't know how to
|
||||
@ -2019,14 +2015,12 @@ meta_window_move_resize_request (MetaWindow *window,
|
||||
* if there are no struts making the workarea smaller than
|
||||
* the monitor.
|
||||
*/
|
||||
legacy_fullscreen = (meta_prefs_get_force_fullscreen() &&
|
||||
!window->hide_titlebar_when_maximized &&
|
||||
(window->decorated || !meta_window_is_client_decorated (window)) &&
|
||||
meta_rectangle_equal (&rect, &monitor_rect) &&
|
||||
window->has_fullscreen_func &&
|
||||
!window->fullscreen);
|
||||
|
||||
if (legacy_fullscreen)
|
||||
if (meta_prefs_get_force_fullscreen() &&
|
||||
!window->hide_titlebar_when_maximized &&
|
||||
(window->decorated || !meta_window_is_client_decorated (window)) &&
|
||||
meta_rectangle_equal (&rect, &monitor_rect) &&
|
||||
window->has_fullscreen_func &&
|
||||
!window->fullscreen)
|
||||
{
|
||||
/*
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
@ -2036,17 +2030,11 @@ meta_window_move_resize_request (MetaWindow *window,
|
||||
"fullscreen request\n",
|
||||
window->desc);
|
||||
meta_window_make_fullscreen_internal (window);
|
||||
flags |= META_MOVE_RESIZE_DONT_SYNC_COMPOSITOR;
|
||||
}
|
||||
|
||||
adjust_for_gravity (window, TRUE, gravity, &rect);
|
||||
meta_window_client_rect_to_frame_rect (window, &rect, &rect);
|
||||
meta_window_move_resize_internal (window, flags, gravity, rect);
|
||||
|
||||
if (legacy_fullscreen)
|
||||
meta_compositor_size_change_window (window->display->compositor,
|
||||
window, META_SIZE_CHANGE_FULLSCREEN,
|
||||
&old_frame_rect, &old_buffer_rect);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user