client: Ensure keyboard focus is not lost when main window leaflets fold
See GNOME/libhandy#179
This commit is contained in:
parent
2222c6af87
commit
1667a7b2da
2 changed files with 29 additions and 4 deletions
|
|
@ -2113,12 +2113,35 @@ public class Application.MainWindow :
|
|||
update_conversation_actions(
|
||||
ConversationCount.for_size(selected)
|
||||
);
|
||||
if (this.outer_leaflet.folded) {
|
||||
// Ensure something useful gets the keyboard focus, given
|
||||
// GNOME/libhandy#179
|
||||
if (this.is_conversation_list_shown) {
|
||||
this.conversation_list_view.grab_focus();
|
||||
} else if (this.is_folder_list_shown) {
|
||||
this.folder_list.grab_focus();
|
||||
}
|
||||
|
||||
// Close any open composer that is no longer visible
|
||||
if (this.has_composer &&
|
||||
this.outer_leaflet.folded &&
|
||||
(this.is_folder_list_shown || this.is_conversation_list_shown)) {
|
||||
close_composer(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GtkCallback]
|
||||
private void on_inner_leaflet_changed() {
|
||||
if (this.inner_leaflet.folded) {
|
||||
// Ensure something useful gets the keyboard focus, given
|
||||
// GNOME/libhandy#179
|
||||
if (this.is_conversation_list_shown) {
|
||||
this.conversation_list_view.grab_focus();
|
||||
} else if (this.is_folder_list_shown) {
|
||||
this.folder_list.grab_focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void on_offline_infobar_response() {
|
||||
this.info_bars.remove(this.offline_infobar);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
<property name="hexpand_set">True</property>
|
||||
<property name="can_swipe_back">True</property>
|
||||
<property name="transition_type">over</property>
|
||||
<signal name="notify::folded" handler="on_inner_leaflet_changed" swapped="no"/>
|
||||
<signal name="notify::visible-child" handler="on_inner_leaflet_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="folder_box">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue