[brasero] Partial fix for #631160 - Needs porting to new rendering regime Main patch from Kjartan Maraas with
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero] Partial fix for #631160 - Needs porting to new rendering regime Main patch from Kjartan Maraas with
- Date: Mon, 4 Oct 2010 15:35:19 +0000 (UTC)
commit 31541b3dabb9d821c42a681a995c355d644b8188
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon Oct 4 17:27:16 2010 +0200
Partial fix for #631160 - Needs porting to new rendering regime
Main patch from Kjartan Maraas with fixes from Philippe Rouquier
src/baobab-cell-renderer-progress.c | 14 ++++----------
src/brasero-data-disc.c | 2 --
src/brasero-file-chooser.c | 10 +++++-----
src/brasero-mime-filter.c | 2 +-
src/brasero-player-bacon.c | 13 +++++--------
src/brasero-playlist.c | 4 ++--
src/brasero-plugin-manager-ui.c | 4 ++--
src/brasero-project-type-chooser.c | 30 +++++++++++-------------------
src/brasero-search.c | 4 ++--
src/brasero-setting.c | 6 +++---
src/eggdesktopfile.c | 2 +-
11 files changed, 36 insertions(+), 55 deletions(-)
---
diff --git a/src/baobab-cell-renderer-progress.c b/src/baobab-cell-renderer-progress.c
index f3a9575..abe2900 100644
--- a/src/baobab-cell-renderer-progress.c
+++ b/src/baobab-cell-renderer-progress.c
@@ -184,24 +184,20 @@ set_color_according_to_perc (cairo_t *cr, double value)
static void
baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
- GdkWindow *window,
+ cairo_t *cr,
GtkWidget *widget,
- GdkRectangle *background_area,
- GdkRectangle *cell_area,
- GdkRectangle *expose_area,
- guint flags)
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
{
BaobabCellRendererProgress *cellprogress = BAOBAB_CELL_RENDERER_PROGRESS (cell);
GtkStyle *style;
gint x, y, w, h, perc_w;
gint xpad, ypad;
gboolean is_rtl;
- cairo_t *cr;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
- cr = gdk_cairo_create (window);
-
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
x = cell_area->x + xpad;
y = cell_area->y + ypad;
@@ -235,8 +231,6 @@ baobab_cell_renderer_progress_render (GtkCellRenderer *cell,
cairo_rectangle (cr, is_rtl ? (x + w - perc_w) : x, y, perc_w, h);
set_color_according_to_perc (cr, cellprogress->priv->perc);
cairo_fill (cr);
-
- cairo_destroy (cr);
}
static void
diff --git a/src/brasero-data-disc.c b/src/brasero-data-disc.c
index 89f427d..cc2b99e 100644
--- a/src/brasero-data-disc.c
+++ b/src/brasero-data-disc.c
@@ -1921,8 +1921,6 @@ brasero_data_disc_rename_activated (BraseroDataDisc *disc)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
_("_Rename"), GTK_RESPONSE_APPLY,
NULL);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
rename = brasero_rename_new ();
brasero_rename_set_show_keep_default (BRASERO_RENAME (rename), FALSE);
gtk_widget_show (rename);
diff --git a/src/brasero-file-chooser.c b/src/brasero-file-chooser.c
index 1cbe99b..5eba040 100644
--- a/src/brasero-file-chooser.c
+++ b/src/brasero-file-chooser.c
@@ -284,7 +284,7 @@ brasero_file_chooser_customize (GtkWidget *widget, gpointer null_data)
parent = gtk_widget_get_parent (widget);
gtk_widget_get_requisition (parent, &request);
width = request.width;
- gtk_widget_size_request (parent, &request);
+ gtk_widget_get_preferred_size (parent, &request, NULL);
if (request.width >= width)
gtk_widget_set_size_request (parent,
request.width,
@@ -428,10 +428,10 @@ brasero_file_chooser_find_pane (GtkWidget *child,
if (packing == GTK_PACK_START) {
GtkRequisition total_request, footer_request;
- gtk_widget_size_request (GTK_WIDGET (vbox),
- &total_request);
- gtk_widget_size_request (GTK_WIDGET (iter_vbox->data),
- &footer_request);
+ gtk_widget_get_preferred_size (GTK_WIDGET (vbox),
+ &total_request, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (iter_vbox->data),
+ &footer_request, NULL);
*((gint *) footer) = total_request.height - footer_request.height;
break;
}
diff --git a/src/brasero-mime-filter.c b/src/brasero-mime-filter.c
index af1c424..73fc495 100644
--- a/src/brasero-mime-filter.c
+++ b/src/brasero-mime-filter.c
@@ -277,7 +277,7 @@ brasero_mime_filter_add_filter (BraseroMimeFilter *filter,
BRASERO_MIME_FILTER_DISPLAY_COL, name,
BRASERO_MIME_FILTER_FILTER_COL, item,
-1);
- g_object_ref_sink (GTK_OBJECT (item));
+ g_object_ref_sink (item);
g_hash_table_insert (filter->priv->table,
g_strdup (name),
diff --git a/src/brasero-player-bacon.c b/src/brasero-player-bacon.c
index 2b1842b..e9c93ab 100644
--- a/src/brasero-player-bacon.c
+++ b/src/brasero-player-bacon.c
@@ -157,12 +157,11 @@ brasero_player_bacon_realize (GtkWidget *widget)
attributes.height = screen_height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK|
GDK_BUTTON_PRESS_MASK|
GDK_BUTTON_RELEASE_MASK;
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_COLORMAP;
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
gtk_widget_set_window (widget, gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes,
@@ -177,15 +176,13 @@ brasero_player_bacon_realize (GtkWidget *widget)
}
static gboolean
-brasero_player_bacon_expose (GtkWidget *widget, GdkEventExpose *event)
+brasero_player_bacon_draw (GtkWidget *widget, cairo_t *cr)
{
BraseroPlayerBacon *bacon;
GdkWindow *window;
- if (event && event->count > 0)
- return TRUE;
-
g_return_val_if_fail (widget != NULL, FALSE);
+
bacon = BRASERO_PLAYER_BACON (widget);
window = gtk_widget_get_window (widget);
@@ -197,7 +194,7 @@ brasero_player_bacon_expose (GtkWidget *widget, GdkEventExpose *event)
&& bacon->priv->state >= GST_STATE_PAUSED)
gst_x_overlay_expose (bacon->priv->xoverlay);
else if (window)
- gdk_window_clear (window);
+ gtk_widget_queue_draw (GTK_WIDGET (widget));
return TRUE;
}
@@ -672,7 +669,7 @@ brasero_player_bacon_class_init (BraseroPlayerBaconClass *klass)
object_class->get_property = brasero_player_bacon_get_property;
widget_class->destroy = brasero_player_bacon_destroy;
- widget_class->expose_event = brasero_player_bacon_expose;
+ widget_class->draw = brasero_player_bacon_draw;
widget_class->realize = brasero_player_bacon_realize;
widget_class->unrealize = brasero_player_bacon_unrealize;
widget_class->size_request = brasero_player_bacon_size_request;
diff --git a/src/brasero-playlist.c b/src/brasero-playlist.c
index cb0b450..322a9b9 100644
--- a/src/brasero-playlist.c
+++ b/src/brasero-playlist.c
@@ -112,8 +112,8 @@ brasero_playlist_get_proportion (BraseroLayoutObject *object,
{
GtkRequisition requisition;
- gtk_widget_size_request (gtk_widget_get_parent (BRASERO_PLAYLIST (object)->priv->button_add),
- &requisition);
+ gtk_widget_get_preferred_size (gtk_widget_get_parent (BRASERO_PLAYLIST (object)->priv->button_add),
+ &requisition, NULL);
(*footer) = requisition.height + BRASERO_PLAYLIST_SPACING;
}
diff --git a/src/brasero-plugin-manager-ui.c b/src/brasero-plugin-manager-ui.c
index 9260aff..d0defe8 100644
--- a/src/brasero-plugin-manager-ui.c
+++ b/src/brasero-plugin-manager-ui.c
@@ -651,7 +651,7 @@ menu_position_under_widget (GtkMenu *menu,
GtkAllocation allocation;
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
- gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
gtk_widget_get_allocation (w, &allocation);
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL) {
@@ -705,7 +705,7 @@ menu_position_under_tree_view (GtkMenu *menu,
if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL) {
GtkRequisition requisition;
- gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
*x += rect.width - requisition.width;
}
diff --git a/src/brasero-project-type-chooser.c b/src/brasero-project-type-chooser.c
index bfaa1f2..1b2614c 100644
--- a/src/brasero-project-type-chooser.c
+++ b/src/brasero-project-type-chooser.c
@@ -36,6 +36,8 @@
#include <gtk/gtk.h>
+#include <cairo/cairo.h>
+
#include "brasero-app.h"
#include "brasero-utils.h"
#include "brasero-session.h"
@@ -544,37 +546,27 @@ brasero_project_type_chooser_init (BraseroProjectTypeChooser *obj)
/* Cut and Pasted from Gtk+ gtkeventbox.c but modified to display back image */
static gboolean
-brasero_project_type_expose_event (GtkWidget *widget, GdkEventExpose *event)
+brasero_project_type_draw_event (GtkWidget *widget, cairo_t *cr)
{
BraseroProjectTypeChooser *chooser;
chooser = BRASERO_PROJECT_TYPE_CHOOSER (widget);
- if (gtk_widget_is_drawable (widget))
- {
- (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+ if (gtk_widget_is_drawable (widget)) {
+ (* GTK_WIDGET_CLASS (parent_class)->draw) (widget, cr);
if (gtk_widget_get_has_window (widget)) {
if (!gtk_widget_get_app_paintable (widget)
&& chooser->priv->background) {
- int width, height, offset = 150;
- cairo_t *ctx;
-
- width = gdk_pixbuf_get_width (chooser->priv->background);
- height = gdk_pixbuf_get_height (chooser->priv->background);
- ctx = gdk_cairo_create (GDK_DRAWABLE (gtk_widget_get_window (widget)));
- cairo_rectangle (ctx, 0, 0, width - offset, height);
- cairo_clip (ctx);
- gdk_cairo_set_source_pixbuf (ctx,
- chooser->priv->background,
- 0, 0);
- cairo_paint (ctx);
- cairo_destroy (ctx);
+ gdk_cairo_set_source_pixbuf (cr,
+ chooser->priv->background,
+ 0, 0);
+ cairo_paint (cr);
}
}
}
- return FALSE;
+ return TRUE;
}
static void
@@ -601,7 +593,7 @@ brasero_project_type_chooser_class_init (BraseroProjectTypeChooserClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = brasero_project_type_chooser_finalize;
- widget_class->expose_event = brasero_project_type_expose_event;
+ widget_class->draw = brasero_project_type_draw_event;
brasero_project_type_chooser_signals[CHOSEN_SIGNAL] =
g_signal_new ("chosen", G_OBJECT_CLASS_TYPE (object_class),
diff --git a/src/brasero-search.c b/src/brasero-search.c
index 8a828da..e47e96b 100644
--- a/src/brasero-search.c
+++ b/src/brasero-search.c
@@ -655,8 +655,8 @@ brasero_search_get_proportion (BraseroLayoutObject *object,
{
GtkRequisition requisition;
- gtk_widget_size_request (BRASERO_SEARCH (object)->priv->filters,
- &requisition);
+ gtk_widget_get_preferred_size (BRASERO_SEARCH (object)->priv->filters,
+ &requisition, NULL);
*footer = requisition.height + BRASERO_SEARCH_SPACING;
}
diff --git a/src/brasero-setting.c b/src/brasero-setting.c
index 8bedc80..ce6960a 100644
--- a/src/brasero-setting.c
+++ b/src/brasero-setting.c
@@ -47,9 +47,9 @@ struct _BraseroSettingPrivate
gchar **search_entry_history;
- guint win_maximized:1;
- guint show_preview:1;
- guint show_sidepane:1;
+ gboolean win_maximized;
+ gboolean show_preview;
+ gboolean show_sidepane;
};
#define BRASERO_SETTING_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_SETTING, BraseroSettingPrivate))
diff --git a/src/eggdesktopfile.c b/src/eggdesktopfile.c
index 1a20e96..48c53cd 100644
--- a/src/eggdesktopfile.c
+++ b/src/eggdesktopfile.c
@@ -1072,7 +1072,7 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file,
GError **error)
{
EggDesktopFileLaunchOption option;
- GSList *translated_documents, *docs;
+ GSList *translated_documents = NULL, *docs;
char *command, **argv;
int argc, i, screen_num;
gboolean success, current_success;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]