Browse Source

Merge tag 'upstream/2.6.1'

Upstream version 2.6.1
experimental
Fabio Fantoni 8 years ago
parent
commit
6a35dff05a
  1. 109
      .gitignore
  2. 2
      configure.ac
  3. 2
      doc/reference/muffin-docs.sgml.in
  4. 13
      src/core/frame.c
  5. 102
      src/ui/frames.c
  6. 7
      src/ui/frames.h
  7. 7
      src/ui/theme.c
  8. 29
      src/ui/ui.c
  9. 7
      src/ui/ui.h

109
.gitignore

@ -1 +1,110 @@
.pc
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
data/Makefile
data/Makefile.in
depcomp
doc/Makefile
doc/Makefile.in
doc/man/Makefile
doc/man/Makefile.in
doc/reference/*.txt
doc/reference/*.stamp
doc/reference/.libs/
doc/reference/Makefile
doc/reference/Makefile.in
doc/reference/html/
doc/reference/muffin-docs.sgml
doc/reference/muffin.args
doc/reference/muffin.hierarchy
doc/reference/muffin.interfaces
doc/reference/muffin.prerequisites
doc/reference/muffin.signals
doc/reference/muffin.types
doc/reference/xml/
gnome-doc-utils.make
gtk-doc.make
install-sh
intltool-extract.in
intltool-merge.in
libtool
ltmain.sh
m4/
missing
omf.make
po/.intltool-merge-cache
po/Makefile
po/Makefile.in
po/POTFILES
po/stamp-it
po/*.gmo
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
src/Meta-Muffin.0.gir
src/Meta-Muffin.0.typelib
src/*/*.lo
src/*/*.o
src/compositor/.deps/
src/compositor/.dirstamp
src/compositor/.libs/
src/compositor/plugins/.deps/
src/compositor/plugins/.libs/
src/compositor/plugins/Makefile
src/compositor/plugins/Makefile.in
src/compositor/plugins/default.la
src/compositor/plugins/default_la-default.lo
src/compositor/plugins/default_la-default.o
src/core/.deps/
src/core/.dirstamp
src/core/.libs/
src/inlinepixbufs.h
src/libmuffin.la
src/libmuffin.pc
src/muffin
src/muffin-enum-types.c
src/muffin-enum-types.h
src/muffin-enum-types.lo
src/muffin-enum-types.o
src/muffin-plugins.pc
src/muffin-theme-viewer
src/muffin.desktop
src/org.cinnamon.muffin.gschema.valid
src/org.cinnamon.muffin.gschema.xml
src/stamp-muffin-enum-types.h
src/testasyncgetprop
src/testboxes
src/testgradient
src/tools/.deps/
src/tools/Makefile
src/tools/Makefile.in
src/tools/muffin-grayscale
src/tools/muffin-mag
src/tools/muffin-message
src/tools/muffin-window-demo
src/ui/.deps/
src/ui/.dirstamp
src/ui/.libs/
src/wm-tester/.deps/
src/wm-tester/Makefile
src/wm-tester/Makefile.in
src/wm-tester/focus-window
src/wm-tester/test-attached
src/wm-tester/test-gravity
src/wm-tester/test-resizing
src/wm-tester/test-size-hints
src/wm-tester/wm-tester
stamp-h1
xmldocs.make

2
configure.ac

@ -2,7 +2,7 @@ AC_PREREQ(2.50)
m4_define([muffin_major_version], [2])
m4_define([muffin_minor_version], [6])
m4_define([muffin_micro_version], [0])
m4_define([muffin_micro_version], [1])
m4_define([muffin_version],
[muffin_major_version.muffin_minor_version.muffin_micro_version])

2
doc/reference/muffin-docs.sgml.in

@ -10,6 +10,8 @@
<title>Muffin Reference Manual</title>
<releaseinfo>
This document is for Muffin &version;.
The latest version of this documentation can be found online at <ulink role="online-location" url="http://developer.linuxmint.com/reference/git/muffin/">http://developer.linuxmint.com/reference/git/muffin/</ulink>.
</releaseinfo>
</bookinfo>

13
src/core/frame.c

@ -156,6 +156,7 @@ meta_window_ensure_frame (MetaWindow *window)
* style and background.
*/
meta_ui_update_frame_style (window->screen->ui, frame->xwindow);
meta_ui_reset_frame_bg (window->screen->ui, frame->xwindow);
if (window->title)
meta_ui_set_frame_title (window->screen->ui,
@ -378,6 +379,15 @@ meta_frame_sync_to_window (MetaFrame *frame,
frame->rect.x + frame->rect.width,
frame->rect.y + frame->rect.height);
/* set bg to none to avoid flicker */
if (need_resize)
{
meta_ui_unflicker_frame_bg (frame->window->screen->ui,
frame->xwindow,
frame->rect.width,
frame->rect.height);
}
meta_ui_move_resize_frame (frame->window->screen->ui,
frame->xwindow,
frame->rect.x,
@ -387,6 +397,9 @@ meta_frame_sync_to_window (MetaFrame *frame,
if (need_resize)
{
meta_ui_reset_frame_bg (frame->window->screen->ui,
frame->xwindow);
/* If we're interactively resizing the frame, repaint
* it immediately so we don't start to lag.
*/

102
src/ui/frames.c

@ -75,6 +75,9 @@ static void meta_frames_paint (MetaFrames *frames,
MetaUIFrame *frame,
cairo_t *cr);
static void meta_frames_set_window_background (MetaFrames *frames,
MetaUIFrame *frame);
static void meta_frames_calc_geometry (MetaFrames *frames,
MetaUIFrame *frame,
MetaFrameGeometry *fgeom);
@ -429,6 +432,12 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
frames = META_FRAMES (data);
frame = value;
/* If a resize occurs it will cause a redraw, but the
* resize may not actually be needed so we always redraw
* in case of color change.
*/
meta_frames_set_window_background (frames, frame);
invalidate_whole_window (frames, frame);
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
frame->xwindow);
@ -468,6 +477,12 @@ queue_draw_func (gpointer key, gpointer value, gpointer data)
frames = META_FRAMES (data);
frame = value;
/* If a resize occurs it will cause a redraw, but the
* resize may not actually be needed so we always redraw
* in case of color change.
*/
meta_frames_set_window_background (frames, frame);
invalidate_whole_window (frames, frame);
}
@ -693,6 +708,11 @@ meta_frames_manage_window (MetaFrames *frames,
frame->shape_applied = FALSE;
frame->prelit_control = META_FRAME_CONTROL_NONE;
/* Don't set the window background yet; we need frame->xwindow to be
* registered with its MetaWindow, which happens after this function
* and meta_ui_create_frame_window() return to meta_window_ensure_frame().
*/
meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
g_hash_table_replace (frames->frames, &frame->xwindow, frame);
@ -837,6 +857,42 @@ meta_frames_get_corner_radiuses (MetaFrames *frames,
*bottom_right = fgeom.bottom_right_corner_rounded_radius + sqrt(fgeom.bottom_right_corner_rounded_radius);
}
LOCAL_SYMBOL void
meta_frames_reset_bg (MetaFrames *frames,
Window xwindow)
{
MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow);
meta_frames_set_window_background (frames, frame);
}
static void
set_background_none (Display *xdisplay,
Window xwindow)
{
XSetWindowAttributes attrs;
attrs.background_pixmap = None;
XChangeWindowAttributes (xdisplay, xwindow,
CWBackPixmap, &attrs);
}
LOCAL_SYMBOL void
meta_frames_unflicker_bg (MetaFrames *frames,
Window xwindow,
int target_width,
int target_height)
{
MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow);
g_return_if_fail (frame != NULL);
set_background_none (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
}
/* The client rectangle surrounds client window; it subtracts both
* the visible and invisible borders from the frame window's size.
*/
@ -2394,6 +2450,52 @@ meta_frames_paint (MetaFrames *frames,
mini_icon, icon);
}
static void
meta_frames_set_window_background (MetaFrames *frames,
MetaUIFrame *frame)
{
MetaFrameFlags flags;
MetaFrameType type;
MetaFrameStyle *style = NULL;
gboolean frame_exists;
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
META_CORE_WINDOW_HAS_FRAME, &frame_exists,
META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type,
META_CORE_GET_END);
if (frame_exists)
{
style = meta_theme_get_frame_style (meta_theme_get_current (),
type, flags);
}
if (frame_exists && style->window_background_color != NULL)
{
GdkRGBA color;
GdkVisual *visual;
meta_color_spec_render (style->window_background_color,
frame->style,
&color);
/* Set A in ARGB to window_background_alpha, if we have ARGB */
visual = gtk_widget_get_visual (GTK_WIDGET (frames));
if (gdk_visual_get_depth (visual) == 32) /* we have ARGB */
{
color.alpha = style->window_background_alpha / 255.0;
}
gdk_window_set_background_rgba (frame->window, &color);
}
else
{
gtk_style_context_set_background (frame->style, frame->window);
}
}
static gboolean
meta_frames_enter_notify_event (GtkWidget *widget,
GdkEventCrossing *event)

7
src/ui/frames.h

@ -137,6 +137,13 @@ void meta_frames_get_borders (MetaFrames *frames,
Window xwindow,
MetaFrameBorders *borders);
void meta_frames_reset_bg (MetaFrames *frames,
Window xwindow);
void meta_frames_unflicker_bg (MetaFrames *frames,
Window xwindow,
int target_width,
int target_height);
cairo_region_t *meta_frames_get_frame_bounds (MetaFrames *frames,
Window xwindow,
int window_width,

7
src/ui/theme.c

@ -1520,11 +1520,12 @@ get_background_color (GtkStyleContext *context,
GdkRGBA empty = {0.0, 0.0, 0.0, 0.0};
// Sometimes the widget has no background color. Steal one from a generic toplevel window, since this always has a background color.
// Sometimes the widget has no background color, so append the background
// class and ask again.
if (gdk_rgba_equal(color, &empty))
{
GtkWidget *widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_style_context_get_background_color(gtk_widget_get_style_context (widget), state, color);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND);
gtk_style_context_get_background_color (context, state, color);
}
}

29
src/ui/ui.c

@ -333,17 +333,6 @@ meta_ui_get_corner_radiuses (MetaUI *ui,
bottom_left, bottom_right);
}
LOCAL_SYMBOL void
set_background_none (Display *xdisplay,
Window xwindow)
{
XSetWindowAttributes attrs;
attrs.background_pixmap = None;
XChangeWindowAttributes (xdisplay, xwindow,
CWBackPixmap, &attrs);
}
LOCAL_SYMBOL Window
meta_ui_create_frame_window (MetaUI *ui,
Display *xdisplay,
@ -410,7 +399,6 @@ meta_ui_create_frame_window (MetaUI *ui,
&attrs, attributes_mask);
gdk_window_resize (window, width, height);
set_background_none (xdisplay, GDK_WINDOW_XID (window));
meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window);
@ -463,6 +451,16 @@ meta_ui_unmap_frame (MetaUI *ui,
gdk_window_hide (window);
}
LOCAL_SYMBOL void
meta_ui_unflicker_frame_bg (MetaUI *ui,
Window xwindow,
int target_width,
int target_height)
{
meta_frames_unflicker_bg (ui->frames, xwindow,
target_width, target_height);
}
LOCAL_SYMBOL void
meta_ui_update_frame_style (MetaUI *ui,
Window xwindow)
@ -477,6 +475,13 @@ meta_ui_repaint_frame (MetaUI *ui,
meta_frames_repaint_frame (ui->frames, xwindow);
}
LOCAL_SYMBOL void
meta_ui_reset_frame_bg (MetaUI *ui,
Window xwindow)
{
meta_frames_reset_bg (ui->frames, xwindow);
}
LOCAL_SYMBOL cairo_region_t *
meta_ui_get_frame_bounds (MetaUI *ui,
Window xwindow,

7
src/ui/ui.h

@ -88,6 +88,13 @@ void meta_ui_map_frame (MetaUI *ui,
void meta_ui_unmap_frame (MetaUI *ui,
Window xwindow);
void meta_ui_unflicker_frame_bg (MetaUI *ui,
Window xwindow,
int target_width,
int target_height);
void meta_ui_reset_frame_bg (MetaUI *ui,
Window xwindow);
cairo_region_t *meta_ui_get_frame_bounds (MetaUI *ui,
Window xwindow,
int window_width,

Loading…
Cancel
Save