diff options
author | Robert Manea <gotmor@gmail.com> | 2009-10-19 22:45:52 +0200 |
---|---|---|
committer | Robert Manea <gotmor@gmail.com> | 2009-10-19 22:45:52 +0200 |
commit | 4c29f0bc019198a19b82ad3bbf57fc529ababebc (patch) | |
tree | 34eac8c759a8d7fe733b8e524b9f7bbc3ae7b080 | |
parent | cbf5a2988767616df196a3fa5bd88bc020d5e264 (diff) |
added ROOT_ACTIVE event
-rw-r--r-- | callbacks.c | 4 | ||||
-rw-r--r-- | events.c | 3 | ||||
-rw-r--r-- | events.h | 2 | ||||
-rw-r--r-- | examples/config/uzbl/config | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/callbacks.c b/callbacks.c index dd3008c..a9cdc79 100644 --- a/callbacks.c +++ b/callbacks.c @@ -494,7 +494,9 @@ button_press_cb (GtkWidget* window, GdkEventButton* event) { context = get_click_context(); if((context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE)) - send_event(FORM_ACTIVE, "", NULL); + send_event(FORM_ACTIVE, "button1", NULL); + else if((context & WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT)) + send_event(ROOT_ACTIVE, "button1", NULL); } } @@ -36,7 +36,8 @@ const char *event_table[LAST_EVENT] = { "INSTANCE_EXIT" , "LOAD_PROGRESS" , "LINK_UNHOVER" , - "FORM_ACTIVE" + "FORM_ACTIVE" , + "ROOT_ACTIVE" }; void @@ -11,7 +11,7 @@ enum event_type { WEBINSPECTOR, NEW_WINDOW, SELECTION_CHANGED, VARIABLE_SET, FIFO_SET, SOCKET_SET, INSTANCE_START, INSTANCE_EXIT, LOAD_PROGRESS, - LINK_UNHOVER, FORM_ACTIVE, + LINK_UNHOVER, FORM_ACTIVE, ROOT_ACTIVE, /* must be last entry */ LAST_EVENT diff --git a/examples/config/uzbl/config b/examples/config/uzbl/config index 60c816d..c3babe0 100644 --- a/examples/config/uzbl/config +++ b/examples/config/uzbl/config @@ -42,8 +42,10 @@ set new_window = sh 'uzbl-browser -u $8' # equivalent to the default beh @on_event LOAD_FINISH @set_status <span foreground="gold">done</span> @on_event LOAD_FINISH spawn @scripts_dir/history.sh -# Switch to insert mode if clicked on a html form +# Switch to insert mode if a (editable) html form is clicked @on_event FORM_ACTIVE @set_mode insert +# Switch to command mode if anything else is clicked +@on_event ROOT_ACTIVE @set_mode command # Misc on_event handlers #@on_event CONFIG_CHANGED print Config changed: %1 = %2 |