Browse Source

Imported Upstream version 1.8.1

upstream upstream/1.8.1
Nicolas Bourdaud 10 years ago
parent
commit
eed5e2b8d1
  1. 11
      configure.in
  2. 24
      debian/changelog
  3. 5
      debian/control
  4. 8
      src/Makefile.am
  5. 1
      src/compositor/meta-window-actor.c
  6. 6
      src/core/keybindings-private.h
  7. 135
      src/core/keybindings.c
  8. 13
      src/core/main.c
  9. 88
      src/core/prefs.c
  10. 2
      src/core/screen.c
  11. 10
      src/core/window.c
  12. 19
      src/meta/display.h
  13. 9
      src/meta/prefs.h
  14. 24
      src/org.cinnamon.muffin.gschema.xml.in
  15. 14
      src/ui/ui.c
  16. 2
      src/ui/ui.h

11
configure.in

@ -1,8 +1,8 @@
AC_PREREQ(2.50)
m4_define([muffin_major_version], [1])
m4_define([muffin_minor_version], [7])
m4_define([muffin_micro_version], [3])
m4_define([muffin_minor_version], [8])
m4_define([muffin_micro_version], [1])
m4_define([muffin_version],
[muffin_major_version.muffin_minor_version.muffin_micro_version])
@ -86,6 +86,7 @@ MUFFIN_PC_MODULES="
xcomposite >= 0.2 xfixes xrender xdamage
$CLUTTER_PACKAGE >= 1.9.10
cogl-1.0 >= 1.9.6
gl
"
GLIB_GSETTINGS
@ -194,7 +195,11 @@ if test x$found_introspection != xno; then
# parallel install, there's no real reason to change directories, filenames,
# etc. as we change the Muffin tarball version. Note that this must match
# api_version in src/Makefile.am
META_GIR=Meta_3_0_gir
# This is set to a magic number which is different from the API which
# Mutter uses. Otherwise there will be dependency conflicts in RPM
# based distributions that automatically resolve typelib file dependencies.
META_GIR=Meta_Muffin_0_gir
# META_GIR=[Meta_]muffin_major_version[_]muffin_minor_version[_gir]
AC_SUBST(META_GIR)
fi

24
debian/changelog

@ -1,3 +1,27 @@
muffin (1.8.1) olivia; urgency=low
* 1.8.1
-- Clement Lefebvre <root@linuxmint.com> Thu, 09 May 2013 13:37:25 +0100
muffin (1.8.0) olivia; urgency=low
* 1.8.0
-- Clement Lefebvre <root@linuxmint.com> Sun, 05 May 2013 12:08:27 +0100
muffin (1.7.5) olivia; urgency=low
* 1.7.5
-- Clement Lefebvre <root@linuxmint.com> Fri, 03 May 2013 17:09:46 +0100
muffin (1.7.4) olivia; urgency=low
* 1.7.4
-- Clement Lefebvre <root@linuxmint.com> Sat, 27 Apr 2013 20:01:00 +0100
muffin (1.7.3) olivia; urgency=low
* 1.7.3

5
debian/control

@ -38,12 +38,9 @@ Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
muffin-common (= ${source:Version}),
libgnome2-common,
zenity
Provides: x-window-manager
Recommends: gnome-session | x-session-manager
Suggests: gnome-control-center (>= 1:2.5.4),
gnome-themes,
Suggests: gnome-themes,
xdg-user-dirs
Description: lightweight GTK+ window manager
Muffin is a small window manager, using GTK+ and Clutter to do

8
src/Makefile.am

@ -206,8 +206,12 @@ include $(INTROSPECTION_MAKEFILE)
# Since we don't make any guarantees about stability and we don't support
# parallel install, there's no real reason to change directories, filenames,
# etc. as we change the Muffin tarball version.
#api_version = $(MUFFIN_MAJOR_VERSION).$(MUFFIN_MINOR_VERSION)
api_version = 3.0
#
# Change the api_version to a muffin specific number since setting it to
# 3.0 causes major dependency issues with mutter on distributions which
# auto generate typelib dependencies in RPMS
api_version = Muffin.0
#api_version = 3.0
# These files are in package-private directories, even though they may be used
# by plugins. If you're writing a plugin, use g-ir-compiler --add-include-path

1
src/compositor/meta-window-actor.c

@ -1515,7 +1515,6 @@ meta_window_actor_new (MetaWindow *window)
window->type == META_WINDOW_POPUP_MENU ||
window->type == META_WINDOW_COMBO ||
window->type == META_WINDOW_NOTIFICATION ||
window->type == META_WINDOW_DND ||
window->type == META_WINDOW_OVERRIDE_OTHER){
clutter_container_add_actor (CLUTTER_CONTAINER (info->top_window_group),
CLUTTER_ACTOR (self));

6
src/core/keybindings-private.h

@ -79,6 +79,12 @@ gboolean meta_prefs_add_keybinding (const char *name,
gboolean meta_prefs_remove_keybinding (const char *name);
gboolean meta_prefs_add_custom_keybinding (const char *name,
const char *binding,
MetaKeyBindingAction action,
MetaKeyBindingFlags flags);
gboolean meta_prefs_remove_custom_keybinding (const char *name);
#endif

135
src/core/keybindings.c

@ -61,6 +61,13 @@ static gboolean add_builtin_keybinding (MetaDisplay *display,
MetaKeyHandlerFunc handler,
int handler_arg);
static void invoke_handler_by_name (MetaDisplay *display,
MetaScreen *screen,
const char *handler_name,
MetaWindow *window,
XEvent *event);
static void
meta_key_binding_free (MetaKeyBinding *binding)
{
@ -653,6 +660,90 @@ meta_display_remove_keybinding (MetaDisplay *display,
return TRUE;
}
static gboolean
add_custom_keybinding_internal (MetaDisplay *display,
const char *name,
const char *binding,
MetaKeyBindingFlags flags,
MetaKeyBindingAction action,
MetaKeyHandlerFunc func,
int data,
gpointer user_data,
GDestroyNotify free_data)
{
MetaKeyHandler *handler;
if (!meta_prefs_add_custom_keybinding (name, binding, action, flags))
return FALSE;
handler = g_new0 (MetaKeyHandler, 1);
handler->name = g_strdup (name);
handler->func = func;
handler->default_func = func;
handler->data = data;
handler->flags = flags;
handler->user_data = user_data;
handler->user_data_free_func = free_data;
g_hash_table_insert (key_handlers, g_strdup (name), handler);
return TRUE;
}
/**
* meta_display_add_custom_keybinding:
* @display: a #MetaDisplay
* @name: the binding's unique name
* @binding: the parseable keystrokes string (<Control>F1, etc..)
* @callback: function to run when the keybinding is invoked
* @user_data: the data to pass to @handler
* @free_data: function to free @user_data
*
*
* Use meta_display_remove_custom_keybinding() to remove the binding.
*
* Returns: %TRUE if the keybinding was added successfully,
* otherwise %FALSE
*/
gboolean
meta_display_add_custom_keybinding (MetaDisplay *display,
const char *name,
const char *binding,
MetaKeyHandlerFunc callback,
gpointer user_data,
GDestroyNotify free_data)
{
return add_custom_keybinding_internal (display, name, binding,
META_KEY_BINDING_NONE,
META_KEYBINDING_ACTION_CUSTOM,
(MetaKeyHandlerFunc)callback, 0, user_data, free_data);
}
/**
* meta_display_remove_custom_keybinding:
* @display: the #MetaDisplay
* @name: name of the keybinding to remove
*
* Remove keybinding @name; the function will fail if @name is not a known
* keybinding or has not been added with meta_display_add_custom_keybinding().
*
* Returns: %TRUE if the binding has been removed sucessfully,
* otherwise %FALSE
*/
gboolean
meta_display_remove_custom_keybinding (MetaDisplay *display,
const char *name)
{
if (!meta_prefs_remove_custom_keybinding (name))
return FALSE;
g_hash_table_remove (key_handlers, name);
return TRUE;
}
/**
* meta_display_get_keybinding_action:
* @display: A #MetaDisplay
@ -688,6 +779,41 @@ meta_display_get_keybinding_action (MetaDisplay *display,
return META_KEYBINDING_ACTION_NONE;
}
void
meta_display_keybinding_action_invoke_by_code (MetaDisplay *display,
unsigned int keycode,
unsigned long mask)
{
MetaKeyBinding *binding;
KeySym keysym;
keysym = XkbKeycodeToKeysym (display->xdisplay, keycode, 0, 0);
mask = mask & 0xff & ~display->ignored_modifier_mask;
binding = display_get_keybinding (display, keysym, keycode, mask);
if (!binding && keycode == meta_display_get_above_tab_keycode (display))
binding = display_get_keybinding (display, META_KEY_ABOVE_TAB, keycode, mask);
if (binding)
invoke_handler_by_name (display, NULL, binding->name, NULL, NULL);
}
gboolean
meta_display_get_is_overlay_key (MetaDisplay *display,
unsigned int keycode,
unsigned long mask)
{
MetaKeyCombo combo;
KeySym keysym;
keysym = XkbKeycodeToKeysym (display->xdisplay, keycode, 0, 0);
mask = mask & 0xff & ~display->ignored_modifier_mask;
meta_prefs_get_overlay_binding (&combo);
return combo.keysym == keysym && combo.modifiers == mask;
}
LOCAL_SYMBOL void
meta_display_process_mapping_event (MetaDisplay *display,
XEvent *event)
@ -764,6 +890,15 @@ bindings_changed_callback (MetaPreference pref,
}
}
void
meta_display_rebuild_keybindings (MetaDisplay *display)
{
rebuild_key_binding_table (display);
rebuild_special_bindings (display);
reload_keycodes (display);
reload_modifiers (display);
regrab_key_bindings (display);
}
LOCAL_SYMBOL void
meta_display_shutdown_keys (MetaDisplay *display)

13
src/core/main.c

@ -74,6 +74,7 @@
#include <clutter/clutter.h>
#include <clutter/x11/clutter-x11.h>
#include <GL/gl.h>
#ifdef HAVE_INTROSPECTION
#include <girepository.h>
@ -456,6 +457,18 @@ meta_init (void)
* Clutter can only be initialized after the UI.
*/
meta_clutter_init ();
const char *renderer = (const char *) glGetString (GL_RENDERER);
if (strstr (renderer, "llvmpipe") ||
strstr (renderer, "Rasterizer") ||
strstr (renderer, "softpipe"))
{
/* Clutter envs not set, since they won't work after Clutter init */
g_setenv ("CINNAMON_SOFTWARE_RENDERING", "1", FALSE);
g_setenv ("CINNAMON_SLOWDOWN_FACTOR", "0.0001", FALSE);
g_setenv ("MUFFIN_NO_SHADOWS", "1", FALSE);
meta_warning ("Software rendering detected: %s\n", renderer);
}
}
/**

88
src/core/prefs.c

@ -97,6 +97,8 @@ static gboolean gnome_animations = TRUE;
static char *cursor_theme = NULL;
static int cursor_size = 24;
static int draggable_border_width = 10;
static int edge_tile_threshold = 48;
static int edge_detach_threshold = 24;
static gboolean resize_with_right_button = FALSE;
static gboolean edge_tiling = FALSE;
static gboolean force_fullscreen = TRUE;
@ -460,6 +462,20 @@ static MetaIntPreference preferences_int[] =
},
&draggable_border_width
},
{
{ "edge-tile-threshold",
SCHEMA_MUFFIN,
META_PREF_EDGE_TILE_THRESHOLD,
},
&edge_tile_threshold
},
{
{ "edge-detach-threshold",
SCHEMA_MUFFIN,
META_PREF_EDGE_DETACH_THRESHOLD,
},
&edge_detach_threshold
},
{ { NULL, 0, 0 }, NULL },
};
@ -1658,6 +1674,12 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_DRAGGABLE_BORDER_WIDTH:
return "DRAGGABLE_BORDER_WIDTH";
case META_PREF_EDGE_TILE_THRESHOLD:
return "EDGE_TILE_THRESHOLD";
case META_PREF_EDGE_DETACH_THRESHOLD:
return "EDGE_DETACH_THRESHOLD";
case META_PREF_DYNAMIC_WORKSPACES:
return "DYNAMIC_WORKSPACES";
}
@ -1791,7 +1813,6 @@ update_binding (MetaKeyPref *binding,
}
changed = TRUE;
combo = g_malloc0 (sizeof (MetaKeyCombo));
combo->keysym = keysym;
combo->keycode = keycode;
@ -1802,7 +1823,6 @@ 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;
}
@ -2035,6 +2055,58 @@ meta_prefs_remove_keybinding (const char *name)
return TRUE;
}
LOCAL_SYMBOL gboolean
meta_prefs_add_custom_keybinding (const char *name,
const char *binding,
MetaKeyBindingAction action,
MetaKeyBindingFlags flags)
{
MetaKeyPref *pref;
if (g_hash_table_lookup (key_bindings, name))
{
meta_warning ("Trying to re-add custom keybinding \"%s\".\n", name);
return FALSE;
}
pref = g_new0 (MetaKeyPref, 1);
pref->name = g_strdup (name);
pref->schema = g_strdup (binding);
pref->action = action;
pref->bindings = NULL;
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
char **strokes = g_strsplit(binding, "XYZZY", 1);
update_binding (pref, strokes);
g_strfreev (strokes);
g_hash_table_insert (key_bindings, g_strdup (name), pref);
return TRUE;
}
LOCAL_SYMBOL gboolean
meta_prefs_remove_custom_keybinding (const char *name)
{
MetaKeyPref *pref;
pref = g_hash_table_lookup (key_bindings, name);
if (!pref)
{
meta_warning ("Trying to remove non-existent custom keybinding \"%s\".\n", name);
return FALSE;
}
g_hash_table_remove (key_bindings, name);
queue_changed (META_PREF_KEYBINDINGS);
return TRUE;
}
/**
* meta_prefs_get_keybindings:
*
@ -2214,6 +2286,18 @@ meta_prefs_get_draggable_border_width (void)
return draggable_border_width;
}
int
meta_prefs_get_edge_tile_threshold (void)
{
return edge_tile_threshold;
}
int
meta_prefs_get_edge_detach_threshold (void)
{
return edge_detach_threshold;
}
void
meta_prefs_set_force_fullscreen (gboolean whether)
{

2
src/core/screen.c

@ -2020,7 +2020,7 @@ meta_screen_tile_preview_hide (MetaScreen *screen)
/**
* meta_screen_get_mouse_window:
* @screen: an X screen structure.
* @not_this_one: window to be excluded
* @not_this_one: (allow-none): window to be excluded
*
* Gets the #MetaWindow pointed by the mouse
*

10
src/core/window.c

@ -3975,6 +3975,7 @@ meta_window_make_fullscreen_internal (MetaWindow *window)
recalc_window_features (window);
set_net_wm_state (window);
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
g_object_notify (G_OBJECT (window), "fullscreen");
}
}
@ -4031,6 +4032,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
meta_window_update_layer (window);
meta_stack_tracker_queue_sync_stack (window->screen->stack_tracker);
g_object_notify (G_OBJECT (window), "fullscreen");
}
}
@ -8613,9 +8615,7 @@ update_move (MetaWindow *window,
* for the zones at the sides of the monitor where trigger tiling
* because it's about the right size
*/
#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
shake_threshold = meta_ui_get_drag_threshold (window->screen->ui) *
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
shake_threshold = meta_prefs_get_edge_tile_threshold ();
if (snap)
{
@ -8814,10 +8814,8 @@ check_resize_unmaximize(MetaWindow *window,
int threshold;
MetaMaximizeFlags new_unmaximize;
#define DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR 3
threshold = meta_prefs_get_edge_detach_threshold ();
threshold = meta_ui_get_drag_threshold (window->screen->ui) *
DRAG_THRESHOLD_TO_RESIZE_THRESHOLD_FACTOR;
new_unmaximize = 0;
if (window->maximized_horizontally ||

19
src/meta/display.h

@ -145,6 +145,18 @@ gboolean meta_display_add_keybinding (MetaDisplay *display,
gboolean meta_display_remove_keybinding (MetaDisplay *display,
const char *name);
void meta_display_rebuild_keybindings (MetaDisplay *display);
gboolean meta_display_add_custom_keybinding (MetaDisplay *display,
const char *name,
const char *binding,
MetaKeyHandlerFunc callback,
gpointer user_data,
GDestroyNotify free_data);
gboolean meta_display_remove_custom_keybinding (MetaDisplay *display,
const char *name);
MetaKeyBindingAction meta_display_get_keybinding_action (MetaDisplay *display,
unsigned int keycode,
unsigned long mask);
@ -183,4 +195,11 @@ void meta_display_unmanage_screen (MetaDisplay *display,
MetaScreen *screen,
guint32 timestamp);
void meta_display_keybinding_action_invoke_by_code (MetaDisplay *display,
unsigned int keycode,
unsigned long mask);
gboolean meta_display_get_is_overlay_key (MetaDisplay *display,
unsigned int keycode,
unsigned long mask);
#endif

9
src/meta/prefs.h

@ -67,7 +67,9 @@ typedef enum
META_PREF_LIVE_HIDDEN_WINDOWS,
META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
META_PREF_NO_TAB_POPUP,
META_PREF_DRAGGABLE_BORDER_WIDTH
META_PREF_DRAGGABLE_BORDER_WIDTH,
META_PREF_EDGE_TILE_THRESHOLD,
META_PREF_EDGE_DETACH_THRESHOLD
} MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@ -149,6 +151,10 @@ void meta_prefs_set_no_tab_popup (gboolean whether);
int meta_prefs_get_draggable_border_width (void);
int meta_prefs_get_edge_tile_threshold (void);
int meta_prefs_get_edge_detach_threshold (void);
/* XXX FIXME This should be x-macroed, but isn't yet because it would be
* difficult (or perhaps impossible) to add the suffixes using the current
* system. It needs some more thought, perhaps after the current system
@ -236,6 +242,7 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_MOVE_TO_SIDE_E,
META_KEYBINDING_ACTION_MOVE_TO_SIDE_W,
META_KEYBINDING_ACTION_MOVE_TO_CENTER,
META_KEYBINDING_ACTION_CUSTOM,
META_KEYBINDING_ACTION_LAST
} MetaKeyBindingAction;

24
src/org.cinnamon.muffin.gschema.xml.in

@ -93,6 +93,30 @@
</_description>
</key>
<key name="edge-tile-threshold" type="i">
<default>48</default>
<range min="1" max="400"/>
<_summary>Window edge snap threshold</_summary>
<_description>
The region size in pixels, from the edge of the screen, where a dragged
window will be registered as 'sticky'
</_description>
</key>
<key name="edge-detach-threshold" type="i">
<default>24</default>
<range min="1" max="400"/>
<_summary>Window edge detach threshold</_summary>
<_description>
The region size in pixels, from the edge of the screen, where a tiled or
maximized window will be registered as a drag
</_description>
</key>
<child name="keybindings" schema="org.cinnamon.muffin.keybindings"/>
</schema>

14
src/ui/ui.c

@ -1024,20 +1024,6 @@ meta_stock_icons_init (void)
g_object_unref (G_OBJECT (factory));
}
LOCAL_SYMBOL int
meta_ui_get_drag_threshold (MetaUI *ui)
{
GtkSettings *settings;
int threshold;
settings = gtk_widget_get_settings (GTK_WIDGET (ui->frames));
threshold = 8;
g_object_get (G_OBJECT (settings), "gtk-dnd-drag-threshold", &threshold, NULL);
return threshold;
}
LOCAL_SYMBOL MetaUIDirection
meta_ui_get_direction (void)
{

2
src/ui/ui.h

@ -182,8 +182,6 @@ gchar* meta_ui_accelerator_name (unsigned int keysym,
gboolean meta_ui_window_is_widget (MetaUI *ui,
Window xwindow);
int meta_ui_get_drag_threshold (MetaUI *ui);
MetaUIDirection meta_ui_get_direction (void);
#include "tabpopup.h"

Loading…
Cancel
Save