Commit b12fb089 authored by Carl-Anton Ingmarsson's avatar Carl-Anton Ingmarsson Committed by Sebastien Granjoux

class-gen: fix compile warnings

https://bugzilla.gnome.org/show_bug.cgi?id=693213
parent 0a5b5bad
......@@ -325,9 +325,8 @@ cg_cell_renderer_flags_start_editing (GtkCellRenderer *cell,
G_GNUC_UNUSED GdkEvent *event,
G_GNUC_UNUSED GtkWidget *widget,
const gchar *path,
G_GNUC_UNUSED GdkRectangle
*background_area,
G_GNUC_UNUSED GdkRectangle *cell_area,
G_GNUC_UNUSED const GdkRectangle *background_area,
G_GNUC_UNUSED const GdkRectangle *cell_area,
G_GNUC_UNUSED GtkCellRendererState flags)
{
CgCellRendererFlags *cell_flags;
......
......@@ -47,7 +47,10 @@ struct _CgComboFlagsPrivate
GtkWidget* window;
GtkWidget* treeview;
GtkTreeViewColumn* column;
GdkDevice* pointer_device;
GdkDevice* keyboard_device;
GSList* cells;
gboolean editing_started;
......@@ -392,7 +395,7 @@ cg_combo_flags_get_position (CgComboFlags *combo,
*y += allocation.y;
}
gtk_widget_size_request (priv->window, &popup_req);
gtk_widget_get_preferred_size (priv->window, &popup_req, NULL);
*width = allocation.width;
if (popup_req.width > *width) *width = popup_req.width;
......@@ -717,6 +720,7 @@ cg_combo_flags_popup_idle (gpointer data)
GtkWidget *toplevel;
GtkWidget *scrolled;
GdkWindow *window;
GdkDeviceManager* device_manager;
gint height, width, x, y;
combo = CG_COMBO_FLAGS (data);
......@@ -797,14 +801,19 @@ cg_combo_flags_popup_idle (gpointer data)
window = gtk_widget_get_window (priv->window);
gdk_pointer_grab (window, TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK,
NULL, NULL, GDK_CURRENT_TIME);
device_manager = gdk_display_get_device_manager (gdk_window_get_display (window));
priv->pointer_device = gdk_device_manager_get_client_pointer (device_manager);
priv->keyboard_device = gdk_device_get_associated_device (priv->pointer_device);
gtk_grab_add (priv->window);
gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME);
gdk_device_grab (priv->pointer_device, window, GDK_OWNERSHIP_NONE, TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK,
NULL, GDK_CURRENT_TIME);
gdk_device_grab (priv->keyboard_device, window, GDK_OWNERSHIP_NONE, TRUE,
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,
NULL, GDK_CURRENT_TIME);
return FALSE;
}
......@@ -916,8 +925,8 @@ cg_combo_flags_popdown(CgComboFlags *combo)
if (priv->window != NULL)
{
gtk_grab_remove (priv->window);
gdk_pointer_ungrab (GDK_CURRENT_TIME);
gdk_keyboard_ungrab (GDK_CURRENT_TIME);
gdk_device_ungrab (priv->pointer_device, GDK_CURRENT_TIME);
gdk_device_ungrab (priv->keyboard_device, GDK_CURRENT_TIME);
gtk_widget_hide (priv->window);
g_object_unref (priv->column);
......
......@@ -298,15 +298,15 @@ cg_window_set_heap_value (CgWindow *window,
{
case G_TYPE_STRING:
text = cg_window_fetch_string (window, id);
g_hash_table_insert (values, name, text);
g_hash_table_insert (values, (gchar*)name, text);
break;
case G_TYPE_INT:
int_value = cg_window_fetch_integer (window, id);
g_hash_table_insert (values, name, g_strdup_printf ("%d", int_value));
g_hash_table_insert (values, (gchar*)name, g_strdup_printf ("%d", int_value));
break;
case G_TYPE_BOOLEAN:
text = g_strdup (cg_window_fetch_boolean (window, id) ? "1" : "0");
g_hash_table_insert (values, name, text);
g_hash_table_insert (values, (gchar*)name, text);
break;
default:
break;
......@@ -1171,12 +1171,10 @@ cg_window_set_property (GObject *object,
GParamSpec *pspec)
{
CgWindow *window;
CgWindowPrivate *priv;
g_return_if_fail (CG_IS_WINDOW (object));
window = CG_WINDOW (object);
priv = CG_WINDOW_PRIVATE (window);
switch (prop_id)
{
......@@ -1300,7 +1298,6 @@ cg_window_create_value_heap (CgWindow *window)
CgWindowPrivate *priv;
GHashTable *values;
GError *error;
gint license_index;
GtkNotebook *notebook;
......@@ -1317,7 +1314,6 @@ cg_window_create_value_heap (CgWindow *window)
"top_notebook"));
values = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_free);
error = NULL;
switch (gtk_notebook_get_current_page (notebook))
{
......@@ -1615,18 +1611,12 @@ cg_window_set_add_to_repository (CgWindow *window,
gboolean
cg_window_get_add_to_project(CgWindow *window)
{
CgWindowPrivate *priv;
priv = CG_WINDOW_PRIVATE (window);
return cg_window_fetch_boolean (window, "add_project");
}
gboolean
cg_window_get_add_to_repository (CgWindow *window)
{
CgWindowPrivate *priv;
priv = CG_WINDOW_PRIVATE (window);
return cg_window_fetch_boolean (window, "add_repository");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment