Introduction
Introduction Statistics Contact Development Disclaimer Help
tFix target uri handling when leaving window - surf - customized build of surf,…
git clone git://src.adamsgaard.dk/surf
Log
Files
Refs
README
LICENSE
---
commit 971856a579889de5ee6d427c3f7374969b872cbc
parent d0020bad4fc40f3a84e828936c2588232bb687bf
Author: Quentin Rameau <[email protected]>
Date: Sun, 22 Nov 2015 16:45:22 +0100
Fix target uri handling when leaving window
Introduce a new string pointer overtitle in Client to be able to keep
tthe targeturi intact while modifying the former for overriding or not
tthe window title.
Connect to GDK_ENTER_NOTIFY to restore overtitle when refocusing on
window.
Diffstat:
M surf.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/surf.c b/surf.c
t@@ -70,7 +70,7 @@ typedef struct Client {
GTlsCertificateFlags tlsflags;
Window xid;
int progress, fullscreen;
- const char *title, *targeturi;
+ const char *title, *overtitle, *targeturi;
const char *needle;
struct Client *next;
} Client;
t@@ -433,7 +433,7 @@ void
updatetitle(Client *c)
{
char *title;
- const char *name = c->targeturi ? c->targeturi :
+ const char *name = c->overtitle ? c->overtitle :
c->title ? c->title : "";
if (showindicators) {
t@@ -879,22 +879,25 @@ gboolean
winevent(GtkWidget *w, GdkEvent *e, Client *c)
{
switch (e->type) {
+ case GDK_ENTER_NOTIFY:
+ c->overtitle = c->targeturi;
+ updatetitle(c);
+ break;
case GDK_LEAVE_NOTIFY:
- c->targeturi = NULL;
+ c->overtitle = NULL;
updatetitle(c);
break;
- case GDK_WINDOW_STATE: /* fallthrough */
+ case GDK_WINDOW_STATE:
if (e->window_state.changed_mask ==
- GDK_WINDOW_STATE_FULLSCREEN) {
+ GDK_WINDOW_STATE_FULLSCREEN)
c->fullscreen = e->window_state.new_window_state &
GDK_WINDOW_STATE_FULLSCREEN;
- break;
- }
+ break;
default:
- return FALSE;
+ break;
}
- return TRUE;
+ return FALSE;
}
void
t@@ -965,6 +968,8 @@ createwindow(Client *c)
g_signal_connect(G_OBJECT(w), "destroy",
G_CALLBACK(destroywin), c);
+ g_signal_connect(G_OBJECT(w), "enter-notify-event",
+ G_CALLBACK(winevent), c);
g_signal_connect(G_OBJECT(w), "leave-notify-event",
G_CALLBACK(winevent), c);
g_signal_connect(G_OBJECT(w), "window-state-event",
t@@ -1037,6 +1042,8 @@ mousetargetchanged(WebKitWebView *v, WebKitHitTestResult…
c->targeturi = webkit_hit_test_result_get_media_uri(h);
else
c->targeturi = NULL;
+
+ c->overtitle = c->targeturi;
updatetitle(c);
}
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.