summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-05-22 13:23:33 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-22 13:56:53 +0100
commit2807bcc186c976e55b6844d3459e2b0fbb92cdb8 (patch)
treee23243ecae59ddff3cd5ee328f105edec311e9ce /libreofficekit
parentcaf14ad1c2d8d198a45fbaaeeb6b9fc653f3a68d (diff)
gtktiledviewer: avoid a number of pointless re-rendering on startup
Change-Id: Ia7f63a6fa7505da50e6580ea009975e06a0cb65c
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index ae6cfa666096..d066a835d5f1 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -363,7 +363,6 @@ int main( int argc, char* argv[] )
GtkWidget* pComboBox = gtk_combo_box_text_new();
gtk_container_add( GTK_CONTAINER(pPartSelectorToolItem), pComboBox );
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), pPartSelectorToolItem, -1 );
- g_signal_connect( G_OBJECT(pComboBox), "changed", G_CALLBACK(changePart), NULL );
pPartSelector = GTK_COMBO_BOX_TEXT(pComboBox);
@@ -374,7 +373,6 @@ int main( int argc, char* argv[] )
GtkWidget* pPartModeComboBox = gtk_combo_box_text_new();
gtk_container_add( GTK_CONTAINER(pPartModeSelectorToolItem), pPartModeComboBox );
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), pPartModeSelectorToolItem, -1 );
- g_signal_connect( G_OBJECT(pPartModeComboBox), "changed", G_CALLBACK(changePartMode), NULL );
#endif
gtk_toolbar_insert( GTK_TOOLBAR(pToolbar), gtk_separator_tool_item_new(), -1);
@@ -458,8 +456,12 @@ int main( int argc, char* argv[] )
#if ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 24 ) || GTK_MAJOR_VERSION > 2
populatePartSelector();
populatePartModeSelector( GTK_COMBO_BOX_TEXT(pPartModeComboBox) );
+ // Connect these signals after populating the selectors, to avoid re-rendering on setting the default part/partmode.
+ g_signal_connect(G_OBJECT(pPartModeComboBox), "changed", G_CALLBACK(changePartMode), 0);
#endif
+ g_signal_connect(G_OBJECT(pPartSelector), "changed", G_CALLBACK(changePart), 0);
+
gtk_main();
pOffice->pClass->destroy( pOffice );