summarylogtreecommitdiffstats
path: root/ps-event-view_all.patch
blob: 1981d08c03ea96ae07593ee6f4989a1398eda480 (plain)
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
--- a/src/main.cc
+++ b/src/main.cc
@@ -249,6 +249,9 @@ main(int argc, char** argv) {
 
     rpc::parse_command_multiple
       (rpc::make_target(),
+       "method.insert = event.view.hide,multi|rlookup|static\n"
+       "method.insert = event.view.show,multi|rlookup|static\n"
+
        "method.insert = event.download.inserted,multi|rlookup|static\n"
        "method.insert = event.download.inserted_new,multi|rlookup|static\n"
        "method.insert = event.download.inserted_session,multi|rlookup|static\n"
diff --git a/src/ui/element_download_list.cc b/src/ui/element_download_list.cc
index 3f34bb9..90a769a 100644
--- a/src/ui/element_download_list.cc
+++ b/src/ui/element_download_list.cc
@@ -220,7 +220,14 @@ ElementDownloadList::receive_change_view(const std::string& name) {
     return;
   }
 
+  std::string old_name = view() ? view()->name() : "";
+  if (!old_name.empty())
+    rpc::commands.call_catch("event.view.hide", rpc::make_target(), name,
+                             "View hide event action failed: ");
   set_view(*itr);
+  if (!old_name.empty())
+    rpc::commands.call_catch("event.view.show", rpc::make_target(), old_name,
+                             "View show event action failed: ");
 }
 
 void