Compare commits
11 Commits
3.9.91
...
wip/new-ap
Author | SHA1 | Date | |
---|---|---|---|
![]() |
940c6e7069 | ||
![]() |
40163c737c | ||
![]() |
6327b8d15a | ||
![]() |
3053cc0de4 | ||
![]() |
0b89e34439 | ||
![]() |
c5bf60eab4 | ||
![]() |
bdbb852163 | ||
![]() |
4a11f126cd | ||
![]() |
03f736607b | ||
![]() |
5aa3a288dc | ||
![]() |
ddf566a3c4 |
@@ -50,7 +50,7 @@ meta_create_color_texture_4ub (guint8 red,
|
||||
CoglColor color;
|
||||
guint8 pixel[4];
|
||||
|
||||
cogl_color_set_from_4ub (&color, red, green, blue, alpha);
|
||||
cogl_color_init_from_4ub (&color, red, green, blue, alpha);
|
||||
cogl_color_premultiply (&color);
|
||||
|
||||
pixel[0] = cogl_color_get_red_byte (&color);
|
||||
@@ -73,10 +73,8 @@ meta_create_color_texture_4ub (guint8 red,
|
||||
* @src_texture: (allow-none): texture to use initially for the layer
|
||||
*
|
||||
* Creates a pipeline with a single layer. Using a common template
|
||||
* allows sharing a shader for different uses in Mutter. To share the same
|
||||
* shader with all other pipelines that are just texture plus opacity
|
||||
* would require Cogl fixes.
|
||||
* (See http://bugzilla.clutter-project.org/show_bug.cgi?id=2425)
|
||||
* makes it easier for Cogl to share a shader for different uses in
|
||||
* Mutter.
|
||||
*
|
||||
* Return value: (transfer full): a newly created #CoglPipeline
|
||||
*/
|
||||
@@ -86,22 +84,21 @@ meta_create_texture_pipeline (CoglTexture *src_texture)
|
||||
static CoglPipeline *texture_pipeline_template = NULL;
|
||||
CoglPipeline *pipeline;
|
||||
|
||||
/* We use a pipeline that has a dummy texture as a base for all
|
||||
texture pipelines. The idea is that only the Cogl texture object
|
||||
would be different in the children so it is likely that Cogl will
|
||||
be able to share GL programs between all the textures. */
|
||||
/* The only state used in the pipeline that would affect the shader
|
||||
generation is the texture type on the layer. Therefore we create
|
||||
a template pipeline which sets this state and all texture
|
||||
pipelines are created as a copy of this. That way Cogl can find
|
||||
the shader state for the pipeline more quickly by looking at the
|
||||
pipeline ancestry instead of resorting to the shader cache. */
|
||||
if (G_UNLIKELY (texture_pipeline_template == NULL))
|
||||
{
|
||||
CoglTexture *dummy_texture;
|
||||
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
dummy_texture = meta_create_color_texture_4ub (0xff, 0xff, 0xff, 0xff,
|
||||
COGL_TEXTURE_NONE);
|
||||
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
texture_pipeline_template = cogl_pipeline_new (ctx);
|
||||
cogl_pipeline_set_layer_texture (texture_pipeline_template, 0, dummy_texture);
|
||||
cogl_object_unref (dummy_texture);
|
||||
cogl_pipeline_set_layer_null_texture (texture_pipeline_template,
|
||||
0, /* layer */
|
||||
COGL_TEXTURE_TYPE_2D);
|
||||
}
|
||||
|
||||
pipeline = cogl_pipeline_copy (texture_pipeline_template);
|
||||
|
@@ -944,10 +944,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
||||
{
|
||||
if (compositor->modal_plugin && is_grabbed_event (compositor->display, event))
|
||||
{
|
||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (compositor->modal_plugin);
|
||||
|
||||
if (klass->xevent_filter)
|
||||
klass->xevent_filter (compositor->modal_plugin, event);
|
||||
_meta_plugin_xevent_filter (compositor->modal_plugin, event);
|
||||
|
||||
/* We always consume events even if the plugin says it didn't handle them;
|
||||
* exclusive is exclusive */
|
||||
@@ -1152,6 +1149,7 @@ sync_actor_stacking (MetaCompScreen *info)
|
||||
* we go ahead and do it */
|
||||
|
||||
children = clutter_actor_get_children (info->window_group);
|
||||
has_windows = FALSE;
|
||||
reordered = FALSE;
|
||||
|
||||
/* We allow for actors in the window group other than the actors we
|
||||
|
@@ -192,10 +192,7 @@ meta_module_class_init (MetaModuleClass *klass)
|
||||
static void
|
||||
meta_module_init (MetaModule *self)
|
||||
{
|
||||
MetaModulePrivate *priv;
|
||||
|
||||
self->priv = priv = META_MODULE_GET_PRIVATE (self);
|
||||
|
||||
self->priv = META_MODULE_GET_PRIVATE (self);
|
||||
}
|
||||
|
||||
GType
|
||||
|
@@ -306,31 +306,13 @@ meta_plugin_manager_filter_keybinding (MetaPluginManager *plugin_mgr,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* The public method that the compositor hooks into for desktop switching.
|
||||
*
|
||||
* Returns TRUE if the plugin handled the event type (i.e.,
|
||||
* if the return value is FALSE, there will be no subsequent call to the
|
||||
* manager completed() callback, and the compositor must ensure that any
|
||||
* appropriate post-effect cleanup is carried out.
|
||||
*/
|
||||
gboolean
|
||||
meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
|
||||
XEvent *xev)
|
||||
{
|
||||
MetaPlugin *plugin = plugin_mgr->plugin;
|
||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||
|
||||
/* We need to make sure that clutter gets certain events, like
|
||||
* ConfigureNotify on the stage window. If there is a plugin that
|
||||
* provides an xevent_filter function, then it's the responsibility
|
||||
* of that plugin to pass events to Clutter. Otherwise, we send the
|
||||
* event directly to Clutter ourselves.
|
||||
*/
|
||||
if (klass->xevent_filter)
|
||||
return klass->xevent_filter (plugin, xev);
|
||||
else
|
||||
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
|
||||
return _meta_plugin_xevent_filter (plugin, xev);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -72,6 +72,8 @@ gboolean meta_plugin_manager_filter_keybinding (MetaPluginManager *mgr,
|
||||
|
||||
gboolean meta_plugin_manager_xevent_filter (MetaPluginManager *mgr,
|
||||
XEvent *xev);
|
||||
gboolean _meta_plugin_xevent_filter (MetaPlugin *plugin,
|
||||
XEvent *xev);
|
||||
|
||||
void meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr);
|
||||
|
||||
|
@@ -138,9 +138,7 @@ meta_plugin_class_init (MetaPluginClass *klass)
|
||||
static void
|
||||
meta_plugin_init (MetaPlugin *self)
|
||||
{
|
||||
MetaPluginPrivate *priv;
|
||||
|
||||
self->priv = priv = META_PLUGIN_GET_PRIVATE (self);
|
||||
self->priv = META_PLUGIN_GET_PRIVATE (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -185,6 +183,18 @@ _meta_plugin_effect_started (MetaPlugin *plugin)
|
||||
priv->running++;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_meta_plugin_xevent_filter (MetaPlugin *plugin,
|
||||
XEvent *xev)
|
||||
{
|
||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||
|
||||
if (klass->xevent_filter && klass->xevent_filter (plugin, xev))
|
||||
return TRUE;
|
||||
else
|
||||
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_plugin_switch_workspace_completed (MetaPlugin *plugin)
|
||||
{
|
||||
|
@@ -89,7 +89,7 @@ meta_core_get (Display *xdisplay,
|
||||
if (request != META_CORE_WINDOW_HAS_FRAME &&
|
||||
(window == NULL || window->frame == NULL)) {
|
||||
meta_bug ("No such frame window 0x%lx!\n", xwindow);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
|
||||
while (request != META_CORE_GET_END) {
|
||||
@@ -99,7 +99,7 @@ meta_core_get (Display *xdisplay,
|
||||
switch (request) {
|
||||
case META_CORE_WINDOW_HAS_FRAME:
|
||||
*((gboolean*)answer) = window != NULL && window->frame != NULL;
|
||||
if (!*((gboolean*)answer)) return; /* see above */
|
||||
if (!*((gboolean*)answer)) goto out; /* see above */
|
||||
break;
|
||||
case META_CORE_GET_CLIENT_WIDTH:
|
||||
*((gint*)answer) = window->rect.width;
|
||||
@@ -160,6 +160,7 @@ meta_core_get (Display *xdisplay,
|
||||
request = va_arg (args, MetaCoreGetType);
|
||||
}
|
||||
|
||||
out:
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
|
@@ -1855,14 +1855,17 @@ get_input_event (MetaDisplay *display,
|
||||
case XI_ButtonRelease:
|
||||
if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
|
||||
return input_event;
|
||||
break;
|
||||
case XI_KeyPress:
|
||||
case XI_KeyRelease:
|
||||
if (((XIDeviceEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
|
||||
return input_event;
|
||||
break;
|
||||
case XI_FocusIn:
|
||||
case XI_FocusOut:
|
||||
if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_KEYBOARD_ID)
|
||||
return input_event;
|
||||
break;
|
||||
case XI_Enter:
|
||||
case XI_Leave:
|
||||
if (((XIEnterEvent *) input_event)->deviceid == META_VIRTUAL_CORE_POINTER_ID)
|
||||
|
@@ -35,6 +35,8 @@
|
||||
#include <cogl/cogl.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include "meta-cursor-tracker-private.h"
|
||||
@@ -273,3 +275,38 @@ meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
|
||||
XFlush (display->xdisplay);
|
||||
XFreeCursor (display->xdisplay, xcursor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
int *x,
|
||||
int *y,
|
||||
ClutterModifierType *mods)
|
||||
{
|
||||
GdkDeviceManager *gmanager;
|
||||
GdkDevice *gdevice;
|
||||
GdkScreen *gscreen;
|
||||
|
||||
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
|
||||
gdevice = gdk_device_manager_get_client_pointer (gmanager);
|
||||
|
||||
gdk_device_get_position (gdevice, &gscreen, x, y);
|
||||
gdk_device_get_state (gdevice,
|
||||
gdk_screen_get_root_window (gscreen),
|
||||
NULL, (GdkModifierType*)mods);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
gboolean visible)
|
||||
{
|
||||
if (visible == tracker->is_showing)
|
||||
return;
|
||||
tracker->is_showing = visible;
|
||||
|
||||
if (visible)
|
||||
XFixesShowCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
else
|
||||
XFixesHideCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
}
|
||||
|
@@ -911,6 +911,8 @@ make_laptop_lid_config (MetaConfiguration *reference)
|
||||
MetaConfiguration *new;
|
||||
unsigned int i;
|
||||
gboolean has_primary;
|
||||
int x_after, y_after;
|
||||
int x_offset, y_offset;
|
||||
|
||||
g_assert (reference->n_outputs > 1);
|
||||
|
||||
@@ -919,6 +921,8 @@ make_laptop_lid_config (MetaConfiguration *reference)
|
||||
new->keys = g_new0 (MetaOutputKey, reference->n_outputs);
|
||||
new->outputs = g_new0 (MetaOutputConfig, reference->n_outputs);
|
||||
|
||||
x_after = G_MAXINT; y_after = G_MAXINT;
|
||||
x_offset = 0; y_offset = 0;
|
||||
for (i = 0; i < new->n_outputs; i++)
|
||||
{
|
||||
MetaOutputKey *current_key = &reference->keys[i];
|
||||
@@ -931,13 +935,22 @@ make_laptop_lid_config (MetaConfiguration *reference)
|
||||
|
||||
if (g_str_has_prefix (current_key->connector, "LVDS") ||
|
||||
g_str_has_prefix (current_key->connector, "eDP"))
|
||||
new->outputs[i].enabled = FALSE;
|
||||
{
|
||||
new->outputs[i].enabled = FALSE;
|
||||
x_after = current_output->rect.x;
|
||||
y_after = current_output->rect.y;
|
||||
x_offset = current_output->rect.width;
|
||||
y_offset = current_output->rect.height;
|
||||
}
|
||||
else
|
||||
/* This can potentially leave a "hole" in the screen,
|
||||
but this is actually a good thing, as it means windows
|
||||
don't move around.
|
||||
*/
|
||||
new->outputs[i] = *current_output;
|
||||
{
|
||||
new->outputs[i] = *current_output;
|
||||
|
||||
if (new->outputs[i].rect.x > x_after)
|
||||
new->outputs[i].rect.x -= x_offset;
|
||||
if (new->outputs[i].rect.y > y_after)
|
||||
new->outputs[i].rect.y -= y_offset;
|
||||
}
|
||||
}
|
||||
|
||||
has_primary = FALSE;
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <meta/types.h>
|
||||
#include <meta/workspace.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#define META_TYPE_CURSOR_TRACKER (meta_cursor_tracker_get_type ())
|
||||
#define META_CURSOR_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_CURSOR_TRACKER, MetaCursorTracker))
|
||||
@@ -47,4 +48,11 @@ void meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
||||
int *y);
|
||||
CoglTexture *meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker);
|
||||
|
||||
void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
int *x,
|
||||
int *y,
|
||||
ClutterModifierType *mods);
|
||||
void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
gboolean visible);
|
||||
|
||||
#endif
|
||||
|
@@ -430,7 +430,11 @@ locate_attributes (GMarkupParseContext *context,
|
||||
|
||||
while (name != NULL)
|
||||
{
|
||||
g_return_val_if_fail (retloc != NULL, FALSE);
|
||||
if (retloc == NULL)
|
||||
{
|
||||
retval = FALSE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_assert (n_attrs < MAX_ATTRS);
|
||||
|
||||
@@ -3212,9 +3216,6 @@ parse_style_set_element (GMarkupParseContext *context,
|
||||
meta_frame_style_ref (frame_style);
|
||||
info->style_set->tiled_right_styles[frame_focus] = frame_style;
|
||||
break;
|
||||
meta_frame_style_ref (frame_style);
|
||||
info->style_set->tiled_right_styles[frame_focus] = frame_style;
|
||||
break;
|
||||
case META_FRAME_STATE_SHADED:
|
||||
if (info->style_set->shaded_styles[frame_resize][frame_focus])
|
||||
{
|
||||
|
Reference in New Issue
Block a user