Browse Source

Imported Upstream version 2.8.5

tags/upstream/2.8.5^0
Fabio Fantoni 5 years ago
parent
commit
1711e0ccf7
9 changed files with 139 additions and 79 deletions
  1. +1
    -1
      configure.ac
  2. +24
    -0
      src/compositor/cogl-utils.c
  3. +42
    -3
      src/compositor/meta-sync-ring.c
  4. +9
    -59
      src/core/constraints.c
  5. +4
    -2
      src/core/display.c
  6. +2
    -4
      src/core/prefs.c
  7. +6
    -0
      src/core/window-private.h
  8. +50
    -9
      src/core/window.c
  9. +1
    -1
      src/org.cinnamon.muffin.gschema.xml.in

+ 1
- 1
configure.ac View File

@@ -2,7 +2,7 @@ AC_PREREQ(2.50)

m4_define([muffin_major_version], [2])
m4_define([muffin_minor_version], [8])
m4_define([muffin_micro_version], [4])
m4_define([muffin_micro_version], [5])

m4_define([muffin_version],
[muffin_major_version.muffin_minor_version.muffin_micro_version])


+ 24
- 0
src/compositor/cogl-utils.c View File

@@ -25,6 +25,7 @@
#include <config.h>
#endif
#include "cogl-utils.h"
#include <gdk/gdk.h>

/**
* meta_create_color_texture_4ub:
@@ -118,6 +119,9 @@ meta_create_texture_material (CoglHandle src_texture)
static CoglContext *cogl_context = NULL;
static gboolean supports_npot = FALSE;

static gint screen_width = 0;
static gint screen_height = 0;

inline static gboolean
hardware_supports_npot_sizes (void)
{
@@ -131,6 +135,22 @@ hardware_supports_npot_sizes (void)
return supports_npot;
}

inline static void
clamp_sizes (gint *width,
gint *height)
{
if (screen_width == 0)
{
GdkScreen *screen = gdk_screen_get_default ();

screen_width = gdk_screen_get_width (screen);
screen_height = gdk_screen_get_height (screen);
}

*width = MIN (*width, screen_width);
*height = MIN (*height, screen_height);
}

/**
* meta_cogl_texture_new_from_data_wrapper: (skip)
*
@@ -150,6 +170,8 @@ meta_cogl_texture_new_from_data_wrapper (int width,
{
CoglTexture *texture = NULL;

clamp_sizes (&width, &height);

if (hardware_supports_npot_sizes ())
{
texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (cogl_context, width, height,
@@ -226,6 +248,8 @@ meta_cogl_texture_new_with_size_wrapper (int width,
{
CoglTexture *texture = NULL;

clamp_sizes (&width, &height);

if (hardware_supports_npot_sizes ())
{
texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (cogl_context,


+ 42
- 3
src/compositor/meta-sync-ring.c View File

@@ -29,6 +29,7 @@
*/

#include <string.h>
#include <stdlib.h>

#include <GL/gl.h>
#include <GL/glx.h>
@@ -161,6 +162,17 @@ check_gl_extensions (void)
{
case COGL_DRIVER_GL3:
{

int major, minor;
gboolean version_ok = FALSE;

meta_gl_get_integerv (GL_MAJOR_VERSION, &major);
meta_gl_get_integerv (GL_MINOR_VERSION, &minor);

version_ok = (major >= 3);

g_printerr ("openGL version %d.%d detected (GL3 Cogl Driver)\n", major, minor);

int num_extensions, i;
gboolean arb_sync = FALSE;
gboolean x11_sync_object = FALSE;
@@ -177,12 +189,39 @@ check_gl_extensions (void)
x11_sync_object = TRUE;
}

return arb_sync && x11_sync_object;
return version_ok && arb_sync && x11_sync_object;
}
case COGL_DRIVER_GL:
{
gboolean version_ok = FALSE;

const char *version_string = meta_gl_get_string (GL_VERSION);

/* From the spec:

The string returned starts with "<major version>.<minor version>".
Following the minor version, there can be another '.',
then a vendor-specific build number. The string may have more content,
which is completely vendor-specific (thus not a part of the OpenGL standard).

So, we can split this by . and care only about the first two substrings returned.
Anything else is dumped in the third substring.
*/

gchar **split = g_strsplit (version_string, ".", 3);

if (g_strv_length (split) >= 2)
{
g_printerr ("openGL version %s.%s detected (GL Cogl Driver)\n", split[0], split[1]);

version_ok = (atoi (split[0]) >= 3);
}

g_strfreev (split);

const char *extensions = meta_gl_get_string (GL_EXTENSIONS);
return (extensions != NULL &&
return version_ok &&
(extensions != NULL &&
strstr (extensions, "GL_ARB_sync") != NULL &&
strstr (extensions, "GL_EXT_x11_sync_object") != NULL);
}
@@ -215,7 +254,7 @@ load_required_symbols (void)

if (!check_gl_extensions ())
{
meta_verbose ("MetaSyncRing: couldn't find required GL extensions\n");
g_printerr ("MetaSyncRing disabled: couldn't find required GL extensions, or the minimum safe openGL version was not met\n");
goto out;
}



+ 9
- 59
src/core/constraints.c View File

@@ -204,12 +204,6 @@ static void place_window_if_needed (MetaWindow *window,
ConstraintInfo *info);
static void update_onscreen_requirements (MetaWindow *window,
ConstraintInfo *info);
static void extend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders);
static void unextend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders);

static inline void get_size_limits (const MetaWindow *window,
const MetaFrameBorders *borders,
@@ -680,7 +674,7 @@ update_onscreen_requirements (MetaWindow *window,
/* The require onscreen/on-single-monitor and titlebar_visible
* stuff is relative to the outer window, not the inner
*/
extend_by_frame (window, &info->current, info->borders);
meta_window_extend_by_frame (window, &info->current, info->borders);

/* Update whether we want future constraint runs to require the
* window to be on fully onscreen.
@@ -732,51 +726,7 @@ update_onscreen_requirements (MetaWindow *window,


/* Don't forget to restore the position of the window */
unextend_by_frame (window, &info->current, info->borders);
}

static void
extend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders)
{
if (window->frame)
{
rect->x -= borders->visible.left;
rect->y -= borders->visible.top;
rect->width += borders->visible.left + borders->visible.right;
rect->height += borders->visible.top + borders->visible.bottom;
}
else if (meta_window_is_client_decorated (window))
{
const GtkBorder *extents = &window->custom_frame_extents;
rect->x += extents->left;
rect->y += extents->top;
rect->width -= extents->left + extents->right;
rect->height -= extents->top + extents->bottom;
}
}

static void
unextend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders)
{
if (window->frame)
{
rect->x += borders->visible.left;
rect->y += borders->visible.top;
rect->width -= borders->visible.left + borders->visible.right;
rect->height -= borders->visible.top + borders->visible.bottom;
}
else if (meta_window_is_client_decorated (window))
{
const GtkBorder *extents = &window->custom_frame_extents;
rect->x -= extents->left;
rect->y -= extents->top;
rect->width += extents->left + extents->right;
rect->height += extents->top + extents->bottom;
}
meta_window_unextend_by_frame (window, &info->current, info->borders);
}

static inline void
@@ -915,7 +865,7 @@ constrain_maximization (MetaWindow *window,
}

target_size = info->current;
extend_by_frame (window, &target_size, info->borders);
meta_window_extend_by_frame (window, &target_size, info->borders);
meta_rectangle_expand_to_snapped_borders (&target_size,
&info->entire_monitor,
active_workspace_struts,
@@ -924,7 +874,7 @@ constrain_maximization (MetaWindow *window,
g_slist_free (snapped_windows_as_struts);
} else {
target_size = info->current;
extend_by_frame (window, &target_size, info->borders);
meta_window_extend_by_frame (window, &target_size, info->borders);
meta_rectangle_expand_to_avoiding_struts (&target_size,
&info->entire_monitor,
direction,
@@ -932,7 +882,7 @@ constrain_maximization (MetaWindow *window,
}
}
/* Now make target_size = maximized size of client window */
unextend_by_frame (window, &target_size, info->borders);
meta_window_unextend_by_frame (window, &target_size, info->borders);

/* Check min size constraints; max size constraints are ignored for maximized
* windows, as per bug 327543.
@@ -1087,7 +1037,7 @@ constrain_tiling (MetaWindow *window,
}
}

unextend_by_frame (window, &target_size, info->borders);
meta_window_unextend_by_frame (window, &target_size, info->borders);

/* Check min size constraints; max size constraints are ignored as for
* maximized windows.
@@ -1438,7 +1388,7 @@ do_screen_and_monitor_relative_constraints (
/* Determine whether constraint applies; exit if it doesn't */
how_far_it_can_be_smushed = info->current;
get_size_limits (window, info->borders, TRUE, &min_size, &max_size);
extend_by_frame (window, &info->current, info->borders);
meta_window_extend_by_frame (window, &info->current, info->borders);

if (info->action_type != ACTION_MOVE)
{
@@ -1458,7 +1408,7 @@ do_screen_and_monitor_relative_constraints (
&info->current);
if (exit_early || constraint_satisfied || check_only)
{
unextend_by_frame (window, &info->current, info->borders);
meta_window_unextend_by_frame (window, &info->current, info->borders);
return constraint_satisfied;
}

@@ -1484,7 +1434,7 @@ do_screen_and_monitor_relative_constraints (
&info->current);
}

unextend_by_frame (window, &info->current, info->borders);
meta_window_unextend_by_frame (window, &info->current, info->borders);
return TRUE;
}



+ 4
- 2
src/core/display.c View File

@@ -1897,7 +1897,8 @@ event_callback (XEvent *event,
*/
if (!frame_was_receiver)
{
if (meta_prefs_get_raise_on_click ())
if (meta_prefs_get_raise_on_click () &&
!meta_ui_window_is_widget (display->active_screen->ui, modified))
meta_window_raise (window);
else
meta_topic (META_DEBUG_FOCUS,
@@ -1906,7 +1907,8 @@ event_callback (XEvent *event,
/* Don't focus panels--they must explicitly request focus.
* See bug 160470
*/
if (window->type != META_WINDOW_DOCK)
if (window->type != META_WINDOW_DOCK &&
!meta_ui_window_is_widget (display->active_screen->ui, modified))
{
meta_topic (META_DEBUG_FOCUS,
"Focusing %s due to unmodified button %u press (display.c)\n",


+ 2
- 4
src/core/prefs.c View File

@@ -1959,7 +1959,6 @@ update_binding (MetaKeyPref *binding,
unsigned int keysym;
unsigned int keycode;
MetaVirtualModifier mods;
gboolean changed = FALSE;
MetaKeyCombo *combo;
int i;

@@ -2008,8 +2007,7 @@ update_binding (MetaKeyPref *binding,
* Changing the key in response to a modification could lead to cyclic calls. */
continue;
}
changed = TRUE;

combo = g_malloc0 (sizeof (MetaKeyCombo));
combo->keysym = keysym;
combo->keycode = keycode;
@@ -2020,7 +2018,7 @@ update_binding (MetaKeyPref *binding,
"New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
binding->name, keysym, keycode, mods);
}
return changed;
return TRUE;
}

static gboolean


+ 6
- 0
src/core/window-private.h View File

@@ -812,4 +812,10 @@ gboolean meta_window_is_client_decorated (MetaWindow *window);

gboolean meta_window_updates_are_frozen (MetaWindow *window);

void meta_window_extend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders);
void meta_window_unextend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders);
#endif

+ 50
- 9
src/core/window.c View File

@@ -3909,9 +3909,7 @@ meta_window_can_tile_side_by_side (MetaWindow *window)
tile_area.width /= 2;

meta_frame_calc_borders (window->frame, &borders);

tile_area.width -= (borders.visible.left + borders.visible.right);
tile_area.height -= (borders.visible.top + borders.visible.bottom);
meta_window_unextend_by_frame (window, &tile_area, &borders);

return tile_area.width >= window->size_hints.min_width &&
tile_area.height >= window->size_hints.min_height;
@@ -3933,9 +3931,7 @@ meta_window_can_tile_top_bottom (MetaWindow *window)
tile_area.height /= 2;

meta_frame_calc_borders (window->frame, &borders);

tile_area.width -= (borders.visible.left + borders.visible.right);
tile_area.height -= (borders.visible.top + borders.visible.bottom);
meta_window_unextend_by_frame (window, &tile_area, &borders);

return tile_area.width >= window->size_hints.min_width &&
tile_area.height >= window->size_hints.min_height;
@@ -3958,9 +3954,7 @@ meta_window_can_tile_corner (MetaWindow *window)
tile_area.height /= 2;

meta_frame_calc_borders (window->frame, &borders);

tile_area.width -= (borders.visible.left + borders.visible.right);
tile_area.height -= (borders.visible.top + borders.visible.bottom);
meta_window_unextend_by_frame (window, &tile_area, &borders);

return tile_area.width >= window->size_hints.min_width &&
tile_area.height >= window->size_hints.min_height;
@@ -9495,6 +9489,9 @@ update_move (MetaWindow *window,
if (window->tile_mode != META_TILE_NONE) {
get_size_limits (window, NULL, FALSE, &min_size, &max_size);
meta_window_get_current_tile_area (window, &target_size);
MetaFrameBorders borders;
meta_frame_calc_borders (window->frame, &borders);
meta_window_unextend_by_frame (window, &target_size, &borders);
hminbad = target_size.width < min_size.width;
vminbad = target_size.height < min_size.height;
}
@@ -10550,6 +10547,50 @@ meta_window_is_client_decorated (MetaWindow *window)
return window->has_custom_frame_extents;
}

void
meta_window_extend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders)
{
if (window->frame)
{
rect->x -= borders->visible.left;
rect->y -= borders->visible.top;
rect->width += borders->visible.left + borders->visible.right;
rect->height += borders->visible.top + borders->visible.bottom;
}
else if (meta_window_is_client_decorated (window))
{
const GtkBorder *extents = &window->custom_frame_extents;
rect->x += extents->left;
rect->y += extents->top;
rect->width -= extents->left + extents->right;
rect->height -= extents->top + extents->bottom;
}
}

void
meta_window_unextend_by_frame (MetaWindow *window,
MetaRectangle *rect,
const MetaFrameBorders *borders)
{
if (window->frame)
{
rect->x += borders->visible.left;
rect->y += borders->visible.top;
rect->width -= borders->visible.left + borders->visible.right;
rect->height -= borders->visible.top + borders->visible.bottom;
}
else if (meta_window_is_client_decorated (window))
{
const GtkBorder *extents = &window->custom_frame_extents;
rect->x -= extents->left;
rect->y -= extents->top;
rect->width += extents->left + extents->right;
rect->height += extents->top + extents->bottom;
}
}

LOCAL_SYMBOL void
meta_window_refresh_resize_popup (MetaWindow *window)
{


+ 1
- 1
src/org.cinnamon.muffin.gschema.xml.in View File

@@ -10,7 +10,7 @@
gettext-domain="@GETTEXT_DOMAIN">

<key name="attach-modal-dialogs" type="b">
<default>true</default>
<default>false</default>
<_summary>Attach modal dialogs</_summary>
<_description>
When true, instead of having independent titlebars, modal dialogs


Loading…
Cancel
Save