Upgrade to GTK+3
cover Upgrade to GTK+3
This branch was started 4(!) years ago to update matchbox-desktop to GTK+3, most of it is Ross' handiwork.
For my part, the TakuTable removal started because it had some small but annoying layout bugs and FlowBox seems to do everything we need without those problems (and with less code).
Code still uses some deprecated API, but nothing that I expect to be removed in the next GTK+ releases.
This patchset is part of the quest to make Sato compatible with GTK+3. Complete WIP collection of patches can be found in jku/matchbox-wip branch at git://git.yoctoproject.org/poky-contrib
Thanks,
Jussi
The following changes since commit 5fe37ef38500f858a22ecdf9bf69bf06e213bf68:
Do nothing on delete-event when not STANDALONE (2016-03-22 12:13:24 +0000)
are available in the git repository at:
git://github.com/jku/matchbox-desktop-2 gtk3
https://github.com/jku/matchbox-desktop-2/tree/gtk3
Jussi Kukkonen (2):
Use a GtkFlowBox instead of TakuTable Don't set the desktop fullscreen if MODE_DESKTOP
Ross Burton (14):
Initial port to GTK+ 3
taku-tile: make a subclass of GtkButton, remove all unique logic fixup 1024d115181a182918197d280e0797566178d26f
main: load a custom CSS stylesheet if present
taku-category-bar: don't try to make the arrows square
desktop: set as unresizable to hide resize grip
fixup initial port
taku-table: port to GtkGrid
More fixes
main: ignore file not found errors when loading CSS
desktop: add --mode
build: remove unused --enable-standalone option
build: add a real INSTALL file
build: update git.mk
INSTALL | 370 +++++++++++++++++++++++++++++ Makefile.am | 10 +- configure.ac | 9 +- git.mk | 115 +++++++-- libtaku/Makefile.am | 1 - libtaku/launcher-util.c | 23 +- libtaku/taku-icon-tile.c | 6 +- libtaku/taku-launcher-tile.c | 9 +- libtaku/taku-launcher-tile.h | 2 + libtaku/taku-table.c | 541 ------------------------------------------- libtaku/taku-table.h | 70 ------ libtaku/taku-tile.c | 136 +---------- libtaku/taku-tile.h | 10 +- libtaku/xutil.c | 3 +- libtaku/xutil.h | 2 +- src/Makefile.am | 7 +- src/desktop.c | 183 ++++++++++----- src/desktop.h | 7 +- src/main.c | 79 ++++++- src/taku-category-bar.c | 46 ++-- src/taku-category-bar.h | 5 +- 21 files changed, 734 insertions(+), 900 deletions(-) create mode 100644 INSTALL delete mode 100644 libtaku/taku-table.c delete mode 100644 libtaku/taku-table.h
Signature · 1 line
2.8.1
PATCH 1/16 Initial port to GTK+ 3
From: Ross Burton <[email protected]>
More to be done, but it works. The only known regression is that startup notification isn't multi-screen aware, but this should be ported to use GAppInfo in the future.
Also themeing is likely to be broken, but this needs to be rethought for GTK+ 3 anyway.
--- configure.ac | 2 +- libtaku/launcher-util.c | 23 +++++++---------- libtaku/taku-icon-tile.c | 6 ++--- libtaku/taku-table.c | 64 ++++++++++++++++++++++++++---------------------- libtaku/taku-tile.c | 44 ++++++++++++++------------------- src/desktop.c | 2 +- src/taku-category-bar.c | 12 ++++++--- 7 files changed, 75 insertions(+), 78 deletions(-)
configure.ac +1 -1
@@ -18,7 +18,7 @@ if test x$inotify_support = xyes; then AC_DEFINE(WITH_INOTIFY, [1], [If inotify is enabled]) fi -PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.14 gtk+-2.0 x11]) +PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.14 gtk+-3.0 x11]) AC_ARG_ENABLE(startup_notification, AC_HELP_STRING([--disable-startup-notification], [disable startup notification support]),
libtaku/launcher-util.c +9 -14
@@ -266,23 +266,18 @@ launcher_start (GtkWidget *widget, gtk_get_current_event_time ()); }#endif - -/* GTK+ 2.11.3 has a gdk_spawn_on_screen which doesn't trash envp */ -#if GTK_CHECK_VERSION(2,11,3) - if (!gdk_spawn_on_screen (gtk_widget_get_screen (widget), -#else - if (!g_spawn_async ( -#endif - NULL, argv, NULL, - G_SPAWN_SEARCH_PATH, - child_setup, + +/* TODO: use GAppInfo */ +if (!g_spawn_async (NULL , argv,NULL , +G_SPAWN_SEARCH_PATH , + child_setup, #ifdef USE_LIBSN - use_sn ? context : NULL, + use_sn ? context :NULL , #else - NULL, +NULL , #endif - NULL, - &error)) { +NULL , + &error)) {g_warning ("Cannot launch %s: %s" , argv[0 ], error->message);g_error_free (error);#ifdef USE_LIBSN
libtaku/taku-icon-tile.c +3 -3
@@ -65,13 +65,13 @@ tile_arrange (TakuIconTile *tile)case GTK_ORIENTATION_VERTICAL :gtk_misc_set_alignment (GTK_MISC (tile->priv->primary),0.5 ,0.5 );gtk_misc_set_alignment (GTK_MISC (tile->priv->secondary),0.5 ,0.5 ); - box =gtk_vbox_new (FALSE,6 ); + box =gtk_box_new (GTK_ORIENTATION_VERTICAL ,6 );break ;default :case GTK_ORIENTATION_HORIZONTAL :gtk_misc_set_alignment (GTK_MISC (tile->priv->primary),0.0 ,0.5 );gtk_misc_set_alignment (GTK_MISC (tile->priv->secondary),0.0 ,0.5 ); - box =gtk_hbox_new (FALSE,6 ); + box =gtk_box_new (GTK_ORIENTATION_HORIZONTAL ,6 );break ; }
@@ -79,7 +79,7 @@ tile_arrange (TakuIconTile *tile)gtk_box_pack_start (GTK_BOX (box), tile->priv->icon, FALSE, FALSE,0 ); - vbox =gtk_vbox_new (FALSE,6 ); + vbox =gtk_box_new (GTK_ORIENTATION_VERTICAL ,6 );gtk_widget_show (vbox);gtk_box_pack_start (GTK_BOX (vbox), tile->priv->primary, TRUE, TRUE,0 );
libtaku/taku-table.c +35 -29
141 lines not on this page · raw message
libtaku/taku-tile.c +18 -26
66 lines not on this page · raw message
src/desktop.c +1 -1
@@ -180,7 +180,7 @@ create_desktop (void)gtk_container_add (GTK_CONTAINER (window), fixed);/* Main VBox */ - box =gtk_vbox_new (FALSE,0 ); + box =gtk_box_new (GTK_ORIENTATION_VERTICAL ,0 );gtk_widget_show (box);gtk_fixed_put (GTK_FIXED (fixed), box,0 ,0 );/* Set a sane default in case there is no work area defined yet */
src/taku-category-bar.c +8 -4
@@ -135,11 +135,13 @@ position_menu (GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer user_data) { GtkWidget *widget = GTK_WIDGET (user_data); +GtkAllocation allocation; -gdk_window_get_origin (widget->window, x, y); +gdk_window_get_origin (gtk_widget_get_window (widget), x, y); +gtk_widget_get_allocation (widget, &allocation); - *x += widget->allocation.x; - *y += widget->allocation.y + widget->allocation.height; + *x += allocation.x; + *y += allocation.y + allocation.height; *push_in = TRUE; }
@@ -172,6 +174,7 @@ popup_menu (GtkWidget *button, GdkEventButton *event, gpointer user_data)TakuCategoryBar *bar;TakuCategoryBarPrivate *priv;GtkWidget *menu; +GtkAllocation allocation;GList *l; bar =TAKU_CATEGORY_BAR (user_data);
@@ -183,7 +186,8 @@ popup_menu (GtkWidget *button, GdkEventButton *event, gpointer user_data)/* Create menu */ menu =gtk_menu_new (); -gtk_widget_set_size_request (menu,GTK_WIDGET (button)->allocation.width,-1 ); +gtk_widget_get_allocation (button, &allocation); +gtk_widget_set_size_request (menu, allocation.width,-1 );g_signal_connect (menu,"selection-done" ,G_CALLBACK (popdown_menu), button);
Signature · 1 line
2.8.1
PATCH 2/16 taku-tile: make a subclass of GtkButton, remove all unique logic
From: Ross Burton <[email protected]>
--- libtaku/taku-launcher-tile.c | 9 ++-- libtaku/taku-tile.c | 124 +++---------------------------------------- libtaku/taku-tile.h | 10 +--- 3 files changed, 13 insertions(+), 130 deletions(-)
libtaku/taku-launcher-tile.c +5 -4
@@ -115,14 +115,14 @@ reset_state (gpointer data) }static void -taku_launcher_tile_clicked (TakuTile *tile) +taku_launcher_tile_clicked (GtkButton *button,gpointer user_data) { -TakuLauncherTile *launcher =TAKU_LAUNCHER_TILE (tile); +TakuLauncherTile *launcher =TAKU_LAUNCHER_TILE (button);gtk_widget_set_state (GTK_WIDGET (tile),GTK_STATE_ACTIVE );g_timeout_add (500 , reset_state, tile); - +taku_menu_item_launch (launcher->priv->item,GTK_WIDGET (tile)); }
@@ -141,7 +141,6 @@ taku_launcher_tile_class_init (TakuLauncherTileClass *klass)g_type_class_add_private (klass,sizeof (TakuLauncherTilePrivate)); - tile_class->clicked = taku_launcher_tile_clicked; tile_class->matches_filter = taku_launcher_tile_matches_filter; widget_class->style_set = taku_launcher_tile_style_set;
@@ -161,6 +160,8 @@ static void taku_launcher_tile_init (TakuLauncherTile *self) { self->priv =GET_PRIVATE (self); + +g_signal_connect (self,"clicked" ,G_CALLBACK (taku_launcher_tile_clicked),NULL ); } GtkWidget *
libtaku/taku-tile.c +6 -118
143 lines not on this page · raw message
libtaku/taku-tile.h +2 -8
@@ -46,17 +46,11 @@ G_BEGIN_DECLS TAKU_TYPE_TILE, TakuTileClass))typedef struct { -GtkEventBox parent; -/*< private >*/ -/* TODO: move to private struct */ -gboolean in_tile; +GtkButton parent; }TakuTile ; typedef struct { - GtkEventBoxClass parent_class; - - void (* activate) (TakuTile *tile); - void (* clicked) (TakuTile *tile); + GtkButtonClass parent_class; const char *(* get_sort_key) (TakuTile *tile); const char *(* get_search_key) (TakuTile *tile);
Signature · 1 line
2.8.1
PATCH 3/16 fixup 1024d115181a182918197d280e0797566178d26f
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- libtaku/taku-launcher-tile.c | 4 ++-- libtaku/taku-tile.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
libtaku/taku-launcher-tile.c +2 -2
@@ -115,9 +115,9 @@ reset_state (gpointer data) }static void -taku_launcher_tile_clicked (GtkButton *button,gpointer user_data) +taku_launcher_tile_clicked (GtkButton *tile,gpointer user_data) { -TakuLauncherTile *launcher =TAKU_LAUNCHER_TILE (button); +TakuLauncherTile *launcher =TAKU_LAUNCHER_TILE (tile);gtk_widget_set_state (GTK_WIDGET (tile),GTK_STATE_ACTIVE );
libtaku/taku-tile.c +2 -0
@@ -37,6 +37,8 @@ taku_tile_init (TakuTile *self) { } +/* TODO steal GtkButton's draw function and comment out the focus draw code */ +GtkWidget *taku_tile_new (void ) {
Signature · 1 line
2.8.1
PATCH 4/16 main: load a custom CSS stylesheet if present
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- src/Makefile.am | 7 ++++++- src/main.c | 31 ++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-)
src/Makefile.am +6 -1
@@ -1,4 +1,9 @@ -AM_CPPFLAGS = $(GTK_CFLAGS) $(DBUS_CFLAGS) $(SN_CFLAGS) -I$(top_srcdir) +AM_CPPFLAGS = \ + $(GTK_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(SN_CFLAGS) \ + -I$(top_srcdir) \ + -DPKGDATADIR=\"$(pkgdatadir)\" AM_CFLAGS = $(WARN_CFLAGS) bin_PROGRAMS = matchbox-desktop
src/main.c +26 -5
@@ -43,32 +43,53 @@ emit_loaded_signal (gpointer user_data)dbus_connection_send (conn, msg,NULL );dbus_message_unref (msg); - +/* Flush explicitly because we're too lazy to integrate DBus into the main loop. We're only sending a signal, so if we got as far as here it's unlikely to block. */ dbus_connection_flush (conn);dbus_connection_unref (conn); - +return FALSE; }#endif +static void +load_style (GtkWidget *widget) +{ +GtkCssProvider *provider; +GError *error =NULL ; + + provider =gtk_css_provider_new (); +gtk_css_provider_load_from_path (GTK_CSS_PROVIDER (provider), +PKGDATADIR "/style.css" , &error); +if (error) { +g_warning ("Cannot load CSS: %s" , error->message); +g_error_free (error); + }else { +gtk_style_context_add_provider_for_screen + (gtk_widget_get_screen (widget), +GTK_STYLE_PROVIDER (provider),GTK_STYLE_PROVIDER_PRIORITY_APPLICATION ); + } +g_object_unref (provider); +} +int main (int argc,char **argv) {GtkWidget *desktop; - +gtk_init (&argc, &argv);g_set_application_name (_ ("Desktop" ));#if WITH_DBUS g_idle_add (emit_loaded_signal,NULL );#endif - + desktop =create_desktop (); +load_style (desktop);gtk_main ();destroy_desktop (); - +return 0 ; }
Signature · 1 line
2.8.1
PATCH 5/16 taku-category-bar: don't try to make the arrows square
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- src/taku-category-bar.c | 11 ----------- 1 file changed, 11 deletions(-)
src/taku-category-bar.c +0 -11
@@ -66,15 +66,6 @@ make_bold (GtkLabel *label)gtk_label_set_attributes (label, list); } -/* Make sure arrows request a square amount of space */ -static void -arrow_size_request (GtkWidget *widget, -GtkRequisition *requisition, -gpointer user_data) -{ - requisition->width = requisition->height; -} -/* Changes the current category: Updates the switcher label and table filter */ static void set_category (TakuCategoryBar *bar,GList *category_list_item)
@@ -245,7 +236,6 @@ taku_category_bar_init (TakuCategoryBar *bar)gtk_box_pack_start (GTK_BOX (bar), button, FALSE, TRUE,0 ); arrow =gtk_arrow_new (GTK_ARROW_LEFT ,GTK_SHADOW_NONE ); -g_signal_connect (arrow,"size-request" ,G_CALLBACK (arrow_size_request),NULL );gtk_widget_show (arrow);gtk_container_add (GTK_CONTAINER (button), arrow);gtk_size_group_add_widget (size_group, arrow);
@@ -278,7 +268,6 @@ taku_category_bar_init (TakuCategoryBar *bar)gtk_box_pack_end (GTK_BOX (bar), button, FALSE, TRUE,0 ); arrow =gtk_arrow_new (GTK_ARROW_RIGHT ,GTK_SHADOW_NONE ); -g_signal_connect (arrow,"size-request" ,G_CALLBACK (arrow_size_request),NULL );gtk_widget_show (arrow);gtk_container_add (GTK_CONTAINER (button), arrow);gtk_size_group_add_widget (size_group, arrow);
Signature · 1 line
2.8.1
PATCH 6/16 desktop: set as unresizable to hide resize grip
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- src/desktop.c | 1 + 1 file changed, 1 insertion(+)
src/desktop.c +1 -0
@@ -160,6 +160,7 @@ create_desktop (void)g_signal_connect (window,"delete-event" ,G_CALLBACK (delete_event_cb),NULL );gtk_window_set_type_hint (GTK_WINDOW (window),GDK_WINDOW_TYPE_HINT_DESKTOP );gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE); +gtk_window_set_resizable (GTK_WINDOW (window), FALSE); screen =gtk_widget_get_screen (window); screen_w =gdk_screen_get_width (screen);
Signature · 1 line
2.8.1
PATCH 7/16 fixup initial port
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- src/desktop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
src/desktop.c +4 -4
@@ -47,9 +47,9 @@ on_item_added (TakuMenu *menu, TakuMenuItem *item, gpointer null)GtkWidget *tile; tile =taku_launcher_tile_new_from_item (item); - -if (GTK_IS_WIDGET (tile)) -gtk_container_add (GTK_CONTAINER (table), tile); + +if (tile) +gtk_container_add (GTK_CONTAINER (table), tile); } static void
@@ -116,7 +116,7 @@ load_items (TakuMenu *menu)if (!l->data)continue ; tile =taku_launcher_tile_new_from_item (l->data); -if (GTK_IS_WIDGET (tile)) +if (tile)gtk_container_add (GTK_CONTAINER (table), tile); }
Signature · 1 line
2.8.1
PATCH 8/16 taku-table: port to GtkGrid
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- libtaku/taku-table.c | 44 ++++++++++++++++++++------------------------ libtaku/taku-table.h | 7 +++---- 2 files changed, 23 insertions(+), 28 deletions(-)
libtaku/taku-table.c +20 -24
@@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2007 OpenedHand Ltd * * This program is free software; you can redistribute it and/or modify it under
@@ -20,8 +20,9 @@#include <gtk/gtk.h> #include <string.h> #include "taku-table.h" +#include "taku-tile.h" -G_DEFINE_TYPE (TakuTable, taku_table,GTK_TYPE_TABLE ); +G_DEFINE_TYPE (TakuTable, taku_table,GTK_TYPE_GRID );#define GET_PRIVATE (o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), TAKU_TYPE_TABLE, TakuTablePrivate))
@@ -191,9 +192,9 @@ reflow_foreach (gpointer widget, gpointer user_data)if (!taku_tile_matches_filter (tile, table->priv->filter)) {gtk_container_child_set (container,GTK_WIDGET (widget),"left-attach" ,0 , -"right-attach" ,1 ,"top-attach" ,0 , -"bottom-attach" ,1 , +"width" ,1 , +"height" ,1 ,NULL );gtk_widget_hide (widget);return ;
@@ -205,9 +206,9 @@ reflow_foreach (gpointer widget, gpointer user_data)gtk_container_child_set (container,GTK_WIDGET (widget),"left-attach" , table->priv->x, -"right-attach" , table->priv->x +1 ,"top-attach" , table->priv->y, -"bottom-attach" , table->priv->y +1 , +"width" ,1 , +"height" ,1 ,NULL );if (++table->priv->x >= table->priv->columns) { table->priv->x =0 ;
@@ -248,23 +249,14 @@ reflow (TakuTable *table)GtkWidget *dummy =gtk_label_new (NULL );gtk_widget_show (dummy); -gtk_table_attach (GTK_TABLE (table), - dummy, - table->priv->x, - table->priv->x +1 , - table->priv->y, - table->priv->y +1 , -GTK_FILL |GTK_EXPAND , -GTK_FILL , -0 , -0 ); +gtk_grid_attach (GTK_GRID (table), + dummy, + table->priv->x, table->priv->y, +1 ,1 ); table->priv->x++; table->priv->dummies =g_list_prepend (table->priv->dummies, dummy); } - -/* Crop table */ -gtk_table_resize (GTK_TABLE (table),1 ,1 ); }/*
@@ -281,8 +273,7 @@ container_add (GtkContainer *container, GtkWidget *widget)g_sequence_insert_sorted (self->priv->seq, widget, compare_tiles,NULL ); -gtk_table_attach (GTK_TABLE (container), widget,0 ,1 ,0 ,1 , -GTK_EXPAND |GTK_FILL ,GTK_FILL ,0 ,0 ); +gtk_grid_attach (GTK_GRID (container), widget,0 ,1 ,1 ,1 );reflow (self);
@@ -504,9 +495,14 @@ taku_table_init (TakuTable *self)g_signal_connect (self,"size-allocate" ,G_CALLBACK (on_size_allocate),NULL ); -gtk_container_set_border_width (GTK_CONTAINER (self),6 ); -gtk_table_set_row_spacings (GTK_TABLE (self),6 ); -gtk_table_set_col_spacings (GTK_TABLE (self),6 ); +g_object_set (self, +"border-width" ,6 , +"row-spacing" ,6 , +"column-spacing" ,6 , +"row-homogeneous" , TRUE, +"column-homogeneous" , TRUE, +NULL ); + self->priv->columns =0 ; self->priv->reflowing = FALSE;
libtaku/taku-table.h +3 -4
@@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2007 OpenedHand Ltd * * This program is free software; you can redistribute it and/or modify it under
@@ -20,7 +20,6 @@#define _TAKU_TABLE#include <gtk/gtk.h> -#include "taku-tile.h" G_BEGIN_DECLS
@@ -49,12 +48,12 @@ G_BEGIN_DECLStypedef struct _TakuTablePrivate TakuTablePrivate ;typedef struct { -GtkTable parent; +GtkGrid parent;TakuTablePrivate *priv; }TakuTable ;typedef struct { -GtkTableClass parent_class; +GtkGridClass parent_class; }TakuTableClass ;GType taku_table_get_type (void );
Signature · 1 line
2.8.1
PATCH 9/16 More fixes
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- libtaku/taku-table.c | 34 ++++++++++++---------------------- libtaku/taku-tile.c | 2 ++ libtaku/xutil.c | 3 +-- libtaku/xutil.h | 2 +- src/desktop.c | 17 ++++++++++------- 5 files changed, 26 insertions(+), 32 deletions(-)
libtaku/taku-table.c +12 -22
@@ -190,19 +190,13 @@ reflow_foreach (gpointer widget, gpointer user_data)/* Filter out unwanted items */ if (table->priv->filter !=NULL ) {if (!taku_tile_matches_filter (tile, table->priv->filter)) { -gtk_container_child_set (container,GTK_WIDGET (widget), -"left-attach" ,0 , -"top-attach" ,0 , -"width" ,1 , -"height" ,1 , -NULL ); -gtk_widget_hide (widget); +gtk_widget_set_child_visible (widget, FALSE);return ; } }/* We want this item. Align. */ -gtk_widget_show (widget); +gtk_widget_set_child_visible (widget, TRUE); gtk_container_child_set (container, GTK_WIDGET (widget), "left-attach", table->priv->x,
@@ -247,12 +241,10 @@ reflow (TakuTable *table)for (i =g_sequence_get_length (table->priv->seq); i < table->priv->columns; i++) {GtkWidget *dummy =gtk_label_new (NULL ); -gtk_widget_show (dummy); +gtk_widget_set_child_visible (dummy, TRUE); -gtk_grid_attach (GTK_GRID (table), - dummy, - table->priv->x, table->priv->y, -1 ,1 ); +gtk_grid_attach (GTK_GRID (table), dummy, + table->priv->x, table->priv->y,1 ,1 ); table->priv->x++; table->priv->dummies =g_list_prepend (table->priv->dummies, dummy);
@@ -314,19 +306,18 @@ calculate_columns (GtkWidget *widget)TakuTable *table =TAKU_TABLE (widget);PangoContext *context;PangoFontMetrics *metrics; -int width, new_cols; +int table_width, width, new_cols;guint cell_text_width =DEFAULT_WIDTH ; -GtkAllocation allocation; -gtk_widget_get_allocation (widget, &allocation); + table_width =gtk_widget_get_allocated_width (widget);/* If we are currently reflowing the tiles, or the final allocation hasn't been decided yet, return */ if (!gtk_widget_get_realized (widget) || table->priv->reflowing || - allocation.width <=1 ) + table_width <=1 ) {return ; - + } context =gtk_widget_get_pango_context (widget); metrics =pango_context_get_metrics (context,gtk_widget_get_style (widget)->font_desc,NULL );
@@ -334,8 +325,7 @@ calculate_columns (GtkWidget *widget) width =PANGO_PIXELS (cell_text_width *pango_font_metrics_get_approximate_char_width (metrics)); - new_cols =MAX (1 , allocation.width / width); - + new_cols =MAX (1 , table_width / width);if (table->priv->columns != new_cols) { table->priv->columns = new_cols;
@@ -369,8 +359,8 @@ taku_table_unrealize (GtkWidget *widget)static void on_size_allocate (GtkWidget *widget, -GtkAllocation *allocation, -gpointer user_data) +GtkAllocation *allocation, +gpointer user_data) {calculate_columns (widget); }
libtaku/taku-tile.c +2 -0
@@ -35,6 +35,8 @@ taku_tile_class_init (TakuTileClass *klass)static void taku_tile_init (TakuTile *self) { +gtk_widget_set_hexpand (GTK_WIDGET (self), TRUE); +gtk_widget_set_vexpand (GTK_WIDGET (self), FALSE); }/* TODO steal GtkButton's draw function and comment out the focus draw code */
libtaku/xutil.c +1 -2
@@ -44,9 +44,8 @@ net_workarea_changed (WorkAreaFunc cb, GdkWindow *window)int result, xres, real_format;unsigned long items_read, items_left;long *coords; -Atom workarea_atom =gdk_x11_get_xatom_by_name ("_NET_WORKAREA" ); - +gdk_error_trap_push (); result = XGetWindowProperty (gdk_x11_get_default_xdisplay (), GDK_ROOT_WINDOW (), workarea_atom, 0L, 4L, False,
libtaku/xutil.h +1 -1
@@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2007 OpenedHand Ltd * * This program is free software; you can redistribute it and/or modify it under
src/desktop.c +10 -7
@@ -48,8 +48,10 @@ on_item_added (TakuMenu *menu, TakuMenuItem *item, gpointer null) tile =taku_launcher_tile_new_from_item (item); -if (tile) +if (tile) { +gtk_widget_show (tile);gtk_container_add (GTK_CONTAINER (table), tile); + } } static void
@@ -116,10 +118,11 @@ load_items (TakuMenu *menu)if (!l->data)continue ; tile =taku_launcher_tile_new_from_item (l->data); -if (tile) +if (tile) { +gtk_widget_show (tile);gtk_container_add (GTK_CONTAINER (table), tile); + } } - }#ifndef STANDALONE
@@ -192,7 +195,7 @@ create_desktop (void)#else x_monitor_workarea (gtk_widget_get_screen (window), workarea_changed);#endif - +/* Navigation bar */ bar =TAKU_CATEGORY_BAR (taku_category_bar_new ());gtk_widget_show (GTK_WIDGET (bar));
@@ -223,8 +226,8 @@ create_desktop (void)taku_category_bar_set_categories (bar, categories);g_signal_connect (menu,"item-added" ,G_CALLBACK (on_item_added),NULL ); -g_signal_connect (menu,"item-removed" ,G_CALLBACK (on_item_removed),NULL ); - +g_signal_connect (menu,"item-removed" ,G_CALLBACK (on_item_removed),NULL ); +load_items (menu);return window;
@@ -235,7 +238,7 @@ destroy_desktop (void) {while (categories) {TakuLauncherCategory *category = categories->data; - +taku_launcher_category_free (category); categories =g_list_delete_link (categories, categories);
Signature · 1 line
2.8.1
PATCH 10/16 main: ignore file not found errors when loading CSS
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/main.c +1 -1
@@ -63,7 +63,7 @@ load_style (GtkWidget *widget) provider =gtk_css_provider_new ();gtk_css_provider_load_from_path (GTK_CSS_PROVIDER (provider),PKGDATADIR "/style.css" , &error); -if (error) { +if (error && !g_error_matches (error,GTK_CSS_PROVIDER_ERROR ,GTK_CSS_PROVIDER_ERROR_IMPORT )) {g_warning ("Cannot load CSS: %s" , error->message);g_error_free (error); }else {
Signature · 1 line
2.8.1
PATCH 11/16 desktop: add --mode
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
The --mode argument takes "desktop" (be a normal desktop), "titlebar" (normal desktop but don't hide titlebar, YMMV depending on WM) or "window" (for testing). This replaces the --enable-standalone configure option.
--- src/desktop.c | 59 +++++++++++++++++++++++++++++++---------------------------- src/desktop.h | 7 ++++++- src/main.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 83 insertions(+), 31 deletions(-)
src/desktop.c +31 -28
@@ -125,14 +125,12 @@ load_items (TakuMenu *menu) } } -#ifndef STANDALONE static gboolean delete_event_cb (GtkWidget *widget,GdkEvent *event,gpointer user_data) {/* prevent default handler from destroying the window */ return TRUE; } -#endif static void workarea_changed (int x,int y,int w,int h)
@@ -143,13 +141,11 @@ workarea_changed (int x, int y, int w, int h) }GtkWidget * -create_desktop (void ) +create_desktop (DesktopMode mode) {GtkWidget *window, *scrolled, *viewport; -#ifndef STANDALONE GdkScreen *screen; -#endif -int screen_w, screen_h; +int width, height;/* Register the magic taku-icon size so that it can be controlled from the theme. */
@@ -159,23 +155,32 @@ create_desktop (void)gtk_widget_set_name (window,"TakuWindow" );gtk_window_set_title (GTK_WINDOW (window),_ ("Desktop" )); -#ifndef STANDALONE -g_signal_connect (window,"delete-event" ,G_CALLBACK (delete_event_cb),NULL ); -gtk_window_set_type_hint (GTK_WINDOW (window),GDK_WINDOW_TYPE_HINT_DESKTOP ); -gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE); -gtk_window_set_resizable (GTK_WINDOW (window), FALSE); - screen =gtk_widget_get_screen (window); - screen_w =gdk_screen_get_width (screen); - screen_h =gdk_screen_get_height (screen); -#else -g_signal_connect (window,"delete-event" ,G_CALLBACK (gtk_main_quit),NULL ); - screen_w =640 ; - screen_h =480 ; -#endif - -gtk_window_set_default_size (GTK_WINDOW (window), screen_w, screen_h); +switch (mode) { +case MODE_DESKTOP : +gtk_window_fullscreen (GTK_WINDOW (window)); +case MODE_TITLEBAR : +gtk_window_set_type_hint (GTK_WINDOW (window),GDK_WINDOW_TYPE_HINT_DESKTOP ); +gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE); +gtk_window_set_resizable (GTK_WINDOW (window), FALSE); +g_signal_connect (window,"delete-event" ,G_CALLBACK (delete_event_cb),NULL ); + + width =gdk_screen_get_width (screen); + height =gdk_screen_get_height (screen); +gtk_window_set_default_size (GTK_WINDOW (window), width, height); +gtk_window_move (GTK_WINDOW (window),0 ,0 ); +break ; +case MODE_WINDOW : + width =640 ; + height =480 ; +gtk_window_set_default_size (GTK_WINDOW (window), width, height); +g_signal_connect (window,"delete-event" ,G_CALLBACK (gtk_main_quit),NULL ); +/* TODO: fake workarea_changed calls on window resize */ +break ; +default : +g_assert_not_reached (); + }gtk_widget_show (window);/* This fixed is used to position the desktop itself in the work area */
@@ -187,14 +192,12 @@ create_desktop (void) box =gtk_box_new (GTK_ORIENTATION_VERTICAL ,0 );gtk_widget_show (box);gtk_fixed_put (GTK_FIXED (fixed), box,0 ,0 ); -/* Set a sane default in case there is no work area defined yet */ -workarea_changed (0 ,0 , screen_w, screen_h); -#ifdef STANDALONE -/* TODO: fake workarea_changed calls on window resize */ -#else -x_monitor_workarea (gtk_widget_get_screen (window), workarea_changed); -#endif +/* Set a sane default in case there is no work area defined yet */ +workarea_changed (0 ,0 , width, height); +if (mode ==MODE_DESKTOP || mode ==MODE_TITLEBAR ) { +x_monitor_workarea (screen, workarea_changed); + }/* Navigation bar */ bar =TAKU_CATEGORY_BAR (taku_category_bar_new ());
src/desktop.h +6 -1
@@ -23,7 +23,12 @@#include <gtk/gtk.h> +typedef enum { +MODE_DESKTOP , +MODE_TITLEBAR , +MODE_WINDOW +}DesktopMode ; -GtkWidget *create_desktop (void ); +GtkWidget *create_desktop (DesktopMode mode);void destroy_desktop (void );
src/main.c +46 -2
61 lines not on this page · raw message
Signature · 1 line
2.8.1
PATCH 12/16 build: remove unused --enable-standalone option
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- configure.ac | 7 ------- 1 file changed, 7 deletions(-)
configure.ac +0 -7
@@ -30,13 +30,6 @@ if test x$enable_startup_notification != xno; then AC_DEFINE(USE_LIBSN, [1], [Has Startup Notification Support]) fi -AC_ARG_ENABLE(standalone, - AC_HELP_STRING([--enable-standalone], [run in a window, not as the desktop]), - enable_standalone=$enableval, enable_standalone=no) -if test x$enable_standalone != xno; then - AC_DEFINE(STANDALONE, [1], [Run in a window]) -fi - AC_ARG_WITH(dbus, AC_HELP_STRING([--with-dbus], [use DBus to send a 'loaded' signal]), with_dbus=$withval, with_dbus=no)
Signature · 1 line
2.8.1
PATCH 13/16 build: add a real INSTALL file
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- INSTALL | 370 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 INSTALL
INSTALL new file +370 -0
@@ -0,0 +1,370 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. +
Signature · 1 line
2.8.1
PATCH 15/16 Use a GtkFlowBox instead of TakuTable
In reply to Jussi KukkonenRemove ~500 lines of code by using FlowBox instead of custom code
Also avoid using GtkFixed when in desktop mode
--- libtaku/Makefile.am | 1 - libtaku/taku-launcher-tile.c | 8 +- libtaku/taku-launcher-tile.h | 2 + libtaku/taku-table.c | 533 ------------------------------------------- libtaku/taku-table.h | 69 ------ libtaku/taku-tile.c | 2 +- src/desktop.c | 121 +++++++--- src/taku-category-bar.c | 23 +- src/taku-category-bar.h | 5 +- 9 files changed, 118 insertions(+), 646 deletions(-) delete mode 100644 libtaku/taku-table.c delete mode 100644 libtaku/taku-table.h
libtaku/Makefile.am +0 -1
@@ -10,7 +10,6 @@ libtaku_a_SOURCES = \ taku-launcher-tile.c taku-launcher-tile.h \ taku-menu.h \ taku-menu-desktop.c \ - taku-table.c taku-table.h \ taku-tile.c taku-tile.h \ xutil.c xutil.h \ taku-queue-source.c taku-queue-source.h
libtaku/taku-launcher-tile.c +3 -5
@@ -104,7 +104,7 @@ taku_launcher_tile_finalize (GObject *object) }/* -* Timeout callback to restore the state of the widget after the clicked state +* Timeout callback to restore the state of the widget after the activated state * change. */ static gboolean
@@ -114,8 +114,8 @@ reset_state (gpointer data)return FALSE; } -static void -taku_launcher_tile_clicked (GtkButton *tile,gpointer user_data) +void +taku_launcher_tile_activate (TakuLauncherTile *tile) {TakuLauncherTile *launcher =TAKU_LAUNCHER_TILE (tile);
@@ -160,8 +160,6 @@ static void taku_launcher_tile_init (TakuLauncherTile *self) { self->priv =GET_PRIVATE (self); - -g_signal_connect (self,"clicked" ,G_CALLBACK (taku_launcher_tile_clicked),NULL ); } GtkWidget *
libtaku/taku-launcher-tile.h +2 -0
@@ -72,6 +72,8 @@ GtkWidget* taku_launcher_tile_new (void);GtkWidget *taku_launcher_tile_new_from_item (TakuMenuItem *item);TakuMenuItem *taku_launcher_tile_get_item (TakuLauncherTile *tile); +void taku_launcher_tile_activate (TakuLauncherTile *tile); +void taku_launcher_tile_add_group (TakuLauncherTile *tile,TakuLauncherCategory *category);void taku_launcher_tile_remove_group (TakuLauncherTile *tile,TakuLauncherCategory *category);
libtaku/taku-table.c deleted +0 -533
533 lines not on this page · raw message
libtaku/taku-table.h deleted +0 -69
69 lines not on this page · raw message
libtaku/taku-tile.c +1 -1
@@ -25,7 +25,7 @@#include <gtk/gtk.h> #include "taku-tile.h" -G_DEFINE_ABSTRACT_TYPE (TakuTile, taku_tile,GTK_TYPE_BUTTON ); +G_DEFINE_ABSTRACT_TYPE (TakuTile, taku_tile,GTK_TYPE_BIN );static void taku_tile_class_init (TakuTileClass *klass)
src/desktop.c +93 -28
189 lines not on this page · raw message
src/taku-category-bar.c +16 -7
@@ -21,12 +21,11 @@#include <glib/gi18n.h> #include <gtk/gtk.h> -#include "libtaku/taku-table.h" #include "libtaku/taku-launcher-tile.h" #include "taku-category-bar.h" -G_DEFINE_TYPE (TakuCategoryBar, taku_category_bar,GTK_TYPE_HBOX ); +G_DEFINE_TYPE (TakuCategoryBar, taku_category_bar,GTK_TYPE_BOX );#define GET_PRIVATE (o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), TAKU_TYPE_CATEGORY_BAR, TakuCategoryBarPrivate))
@@ -34,7 +33,7 @@ G_DEFINE_TYPE (TakuCategoryBar, taku_category_bar, GTK_TYPE_HBOX);#define LIST_DATA "taku-category-bar:list" typedef struct { - TakuTable *table; + GtkFlowBox *table; GList *categories; GList *current_category; GtkWidget *prev_button, *popup_button, *next_button;
@@ -78,9 +77,8 @@ set_category (TakuCategoryBar *bar, GList *category_list_item) category = category_list_item->data;gtk_label_set_text (priv->switcher_label, category->name); -taku_table_set_filter (priv->table, category); - priv->current_category = category_list_item; +gtk_flow_box_invalidate_filter (priv->table); } static void
@@ -285,12 +283,12 @@ taku_category_bar_new (void) }void -taku_category_bar_set_table (TakuCategoryBar *bar,TakuTable *table) +taku_category_bar_set_table (TakuCategoryBar *bar,GtkFlowBox *table) {TakuCategoryBarPrivate *priv;g_return_if_fail (TAKU_IS_CATEGORY_BAR (bar)); -g_return_if_fail (TAKU_IS_TABLE (table)); +g_return_if_fail (GTK_IS_FLOW_BOX (table)); priv =GET_PRIVATE (bar);
@@ -321,6 +319,17 @@ taku_category_bar_set_categories (TakuCategoryBar *bar, GList *categories) } } +TakuLauncherCategory * +taku_category_bar_get_current (TakuCategoryBar *bar) +{ +TakuCategoryBarPrivate *priv; + +g_return_if_fail (TAKU_IS_CATEGORY_BAR (bar)); + priv =GET_PRIVATE (bar); + +return (TakuLauncherCategory *)priv->current_category->data; +} +void taku_category_bar_next (TakuCategoryBar *bar) {
src/taku-category-bar.h +3 -2
@@ -20,7 +20,7 @@#define _TAKU_CATEGORY_BAR#include <gtk/gtk.h> -#include <libtaku/taku-table.h> +#include "libtaku/taku-launcher-tile.h" G_BEGIN_DECLS
@@ -58,9 +58,10 @@ GType taku_category_bar_get_type (void);GtkWidget *taku_category_bar_new (void ); -void taku_category_bar_set_table (TakuCategoryBar *bar,TakuTable *table); +void taku_category_bar_set_table (TakuCategoryBar *bar,GtkFlowBox *table);void taku_category_bar_set_categories (TakuCategoryBar *bar,GList *categories); +TakuLauncherCategory *taku_category_bar_get_current (TakuCategoryBar *bar);void taku_category_bar_next (TakuCategoryBar *bar);void taku_category_bar_previous (TakuCategoryBar *bar);
Signature · 1 line
2.8.1
PATCH 14/16 build: update git.mk
In reply to Jussi KukkonenFrom: Ross Burton <[email protected]>
--- Makefile.am | 10 ++---- git.mk | 115 +++++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 93 insertions(+), 32 deletions(-)
Makefile.am +3 -7
@@ -1,12 +1,8 @@ SUBDIRS = libtaku src MAINTAINERCLEANFILES = \ - $(srcdir)/INSTALL \ - $(srcdir)/aclocal.m4 \ - $(srcdir)/config.h.in \ - $(srcdir)/depcomp \ - $(srcdir)/install-sh \ - $(srcdir)/missing \ - `find "$(srcdir)" -type f -name Makefile.in -print` + $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ + $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ + $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) -include $(top_srcdir)/git.mk
git.mk +90 -25
227 lines not on this page · raw message
Signature · 1 line
2.8.1
PATCH 16/16 Don't set the desktop fullscreen if MODE_DESKTOP
In reply to Jussi KukkonenWM paints fullscreen windows over the panel: don't make the desktop fullscreen.
--- src/desktop.c | 1 - 1 file changed, 1 deletion(-)
src/desktop.c +0 -1
@@ -210,7 +210,6 @@ create_desktop (DesktopMode mode)switch (mode) {case MODE_DESKTOP : -gtk_window_fullscreen (GTK_WINDOW (window));case MODE_TITLEBAR :gtk_window_set_type_hint (GTK_WINDOW (window),GDK_WINDOW_TYPE_HINT_DESKTOP );gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE);
Signature · 1 line
2.8.1
Quoted 2 lines · Jussi Kukkonen
Code still uses some deprecated API, but nothing that I expect to be removed in the next GTK+ releases.
I'll have a another go at fixing these deprecation warnings and will let you know : feel free to review the other patches though.
Jussi