diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2013-12-06 11:45:04 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2013-12-06 11:45:04 +0900 |
commit | bf18adb00f2e6f656c35ab2ee169db6f38be5fbe (patch) | |
tree | 7c81c324b11637652315537eacb6fbd8ff977e84 /ui | |
parent | 291bacf99d6da1e7f3952784e83d45400254b15b (diff) | |
download | ibus-bf18adb00f2e6f656c35ab2ee169db6f38be5fbe.tar.gz |
Fix candidate panel not to be out of screen.
BUG=http://code.google.com/p/ibus/issues/detail?id=1676
TEST=ui/gtk3/ibus-ui-gtk3
Review URL: https://codereview.appspot.com/35800045
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk3/candidatepanel.vala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala index e9d3a344..396c78a0 100644 --- a/ui/gtk3/candidatepanel.vala +++ b/ui/gtk3/candidatepanel.vala @@ -55,6 +55,9 @@ public class CandidatePanel : Gtk.HBox{ set_vertical(!m_vertical); return true; }); + m_toplevel.size_allocate.connect((w, a) => { + adjust_window_position(); + }); Handle handle = new Handle(); handle.set_visible(true); @@ -96,7 +99,10 @@ public class CandidatePanel : Gtk.HBox{ if (m_cursor_location == location) return; m_cursor_location = location; - adjust_window_position(); + + /* Do not call adjust_window_position() here because + * m_toplevel is not shown yet and + * m_toplevel.get_allocation() returns height = width = 1 */ } private void set_labels(IBus.Text[] labels) { |