From 69c102059fe76ad5a27d07a2081938a5c613b292 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 6 Aug 2012 15:04:33 -0400 Subject: Attach t->cmd to the hide signal to focus t->wv Whenever t->cmd is hidden we need to make a decision about what to focus (in most cases, the webview). Before this may not have always happened if t->cmd was hidden and no focus was explicitly set. --- xombrero.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'xombrero.c') diff --git a/xombrero.c b/xombrero.c index 214b104..6b40e49 100644 --- a/xombrero.c +++ b/xombrero.c @@ -6610,7 +6610,6 @@ cmd_keypress_cb(GtkEntry *w, GdkEventKey *e, struct tab *t) /* FALLTHROUGH */ case GDK_Escape: hide_cmd(t); - focus_webview(t); /* cancel search */ if (c != NULL && (c[0] == '/' || c[0] == '?')) @@ -6701,12 +6700,21 @@ cmd_focusout_cb(GtkWidget *w, GdkEventFocus *e, struct tab *t) hide_oops(t); disable_hints(t); + return (XT_CB_PASSTHROUGH); +} + +void +cmd_hide_cb(GtkWidget *w, struct tab *t) +{ + if (t == NULL) { + show_oops(NULL, "%s: invalid parameters", __func__); + return; + } + if (show_url == 0 || t->focus_wv) focus_webview(t); else gtk_widget_grab_focus(GTK_WIDGET(t->uri_entry)); - - return (XT_CB_PASSTHROUGH); } void @@ -7765,6 +7773,7 @@ create_new_tab(char *title, struct undo *u, int focus, int position) "signal::focus-out-event", G_CALLBACK(cmd_focusout_cb), t, "signal::activate", G_CALLBACK(cmd_activate_cb), t, "signal::populate-popup", G_CALLBACK(cmd_popup_cb), t, + "signal::hide", G_CALLBACK(cmd_hide_cb), t, (char *)NULL); /* reuse wv_button_cb to hide oops */ @@ -7883,10 +7892,6 @@ notebook_switchpage_cb(GtkNotebook *nb, GtkWidget *nbp, guint pn, hide_cmd(t); hide_oops(t); - if (t->focus_wv) { - /* can't use focus_webview here */ - gtk_widget_grab_focus(GTK_WIDGET(t->wv)); - } update_statusbar_tabs(t); break; } -- cgit 1.4.1-2-gfad0 ite.subx'>
path: root/057write.subx
blob: db3cb5cc39aa9a117d76563d3b09041065fc7c3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159