• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A multilingual input method framework


Commit MetaInfo

Revisionab0a7f99209b50c00a1f69851283590a7912532c (tree)
Time2013-11-10 17:22:15
AuthorMuneyuki Noguchi <nogu.dev@gmai...>
CommiterMuneyuki Noguchi

Log Message

Use gtk_widget_queue_draw() to redraw buttons.

* gtk2/candwin/horizontal-gtk.c

- (button_clicked, uim_cand_win_gtk_set_index):
Use gtk_widget_queue_draw() for redraw buttons instead of
gtk_widget_unmap() and gtk_widget_map()
because gtk_widget_unmap() and gtk_widget_map() are
only for use in widget implementations
and we can avoid warnings in GTK+3.

* gtk2/immodule/uim-cand-win-horizontal-gtk.c

- (button_clicked, uim_cand_win_horizontal_gtk_set_index):
Ditto.

Change Summary

Incremental Difference

--- a/gtk2/candwin/horizontal-gtk.c
+++ b/gtk2/candwin/horizontal-gtk.c
@@ -349,8 +349,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
349349 prev_selected = cwin->selected;
350350 if (prev_selected) {
351351 GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
352- gtk_widget_unmap(label);
353- gtk_widget_map(label);
352+ gtk_widget_queue_draw(label);
354353 }
355354
356355 for (i = 0; i < (gint)cwin->buttons->len; i++) {
@@ -364,8 +363,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
364363 if (p == button) {
365364 GtkWidget *label = gtk_bin_get_child(GTK_BIN(button));
366365 idx = idxbutton->cand_index_in_page;
367- gtk_widget_unmap(label);
368- gtk_widget_map(label);
366+ gtk_widget_queue_draw(label);
369367 cwin->selected = idxbutton;
370368 break;
371369 }
@@ -1040,12 +1038,10 @@ uim_cand_win_gtk_set_index(UIMCandidateWindow *cwin, gint index)
10401038 prev_selected = (gpointer)cwin->selected;
10411039 if (prev_selected && prev_index != cwin->candidate_index) {
10421040 label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
1043- gtk_widget_unmap(label);
1044- gtk_widget_map(label);
1041+ gtk_widget_queue_draw(label);
10451042 }
10461043 label = gtk_bin_get_child(GTK_BIN(idxbutton->button));
1047- gtk_widget_unmap(label);
1048- gtk_widget_map(label);
1044+ gtk_widget_queue_draw(label);
10491045 cwin->selected = idxbutton;
10501046
10511047 /* show subwin */
--- a/gtk2/immodule/uim-cand-win-horizontal-gtk.c
+++ b/gtk2/immodule/uim-cand-win-horizontal-gtk.c
@@ -298,8 +298,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
298298 prev_selected = horizontal_cwin->selected;
299299 if (prev_selected) {
300300 GtkWidget *label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
301- gtk_widget_unmap(label);
302- gtk_widget_map(label);
301+ gtk_widget_queue_draw(label);
303302 }
304303
305304 for (i = 0; i < (gint)horizontal_cwin->buttons->len; i++) {
@@ -313,8 +312,7 @@ button_clicked(GtkEventBox *button, GdkEventButton *event, gpointer data)
313312 if (p == button) {
314313 GtkWidget *label = gtk_bin_get_child(GTK_BIN(button));
315314 idx = idxbutton->cand_index_in_page;
316- gtk_widget_unmap(label);
317- gtk_widget_map(label);
315+ gtk_widget_queue_draw(label);
318316 horizontal_cwin->selected = idxbutton;
319317 break;
320318 }
@@ -454,12 +452,10 @@ uim_cand_win_horizontal_gtk_set_index(UIMCandWinHorizontalGtk *horizontal_cwin,
454452 prev_selected = (gpointer)horizontal_cwin->selected;
455453 if (prev_selected && prev_index != cwin->candidate_index) {
456454 label = gtk_bin_get_child(GTK_BIN(prev_selected->button));
457- gtk_widget_unmap(label);
458- gtk_widget_map(label);
455+ gtk_widget_queue_draw(label);
459456 }
460457 label = gtk_bin_get_child(GTK_BIN(idxbutton->button));
461- gtk_widget_unmap(label);
462- gtk_widget_map(label);
458+ gtk_widget_queue_draw(label);
463459 horizontal_cwin->selected = idxbutton;
464460
465461 /* show subwin */