File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,13 +16,11 @@ class WayfireStreamChooserApp : public Gtk::Application
1616{
1717 private:
1818 Gtk::Window window;
19- Gtk::Notebook notebook;
2019
2120 Gtk::Box main, buttons;
2221
2322 Gtk::Label window_label, screen_label, header;
2423
25- Gtk::FlowBox window_list, screen_list;
2624 Gtk::Button done, cancel;
2725 Gtk::ScrolledWindow scroll_window, scroll_screen;
2826
@@ -34,7 +32,8 @@ class WayfireStreamChooserApp : public Gtk::Application
3432
3533 public:
3634 wl_display *display;
37- bool is_in_use = false ;
35+ Gtk::Notebook notebook;
36+ Gtk::FlowBox window_list, screen_list;
3837 bool has_foreign_toplevel_list = false ;
3938 bool has_image_copy_capture = false ;
4039 bool has_image_capture_source = false ;
Original file line number Diff line number Diff line change @@ -380,6 +380,29 @@ WayfireChooserTopLevel::WayfireChooserTopLevel(ext_foreign_toplevel_handle_v1 *h
380380 return G_SOURCE_REMOVE ;
381381 }, 2000 );
382382
383+ signals.push_back (
384+ WayfireStreamChooserApp::getInstance ().window_list .signal_selected_children_changed ().connect (
385+ [=] ()
386+ {
387+ if (WayfireStreamChooserApp::getInstance ().window_list .get_selected_children ()[0 ]->get_children ()[0 ]
388+ ==
389+ this )
390+ {
391+ this ->initial_timeout .disconnect ();
392+ this ->pause_timeout .disconnect ();
393+ this ->stream ();
394+ return ;
395+ }
396+
397+ this ->pause_timeout .disconnect ();
398+ this ->pause_timeout = Glib::signal_timeout ().connect (
399+ [this ] ()
400+ {
401+ this ->pause ();
402+ return G_SOURCE_REMOVE ;
403+ }, 2000 );
404+ }));
405+
383406 auto motion_controller = Gtk::EventControllerMotion::create ();
384407 signals.push_back (motion_controller->signal_enter ().connect (
385408 [this ] (double , double )
@@ -398,6 +421,12 @@ WayfireChooserTopLevel::WayfireChooserTopLevel(ext_foreign_toplevel_handle_v1 *h
398421 this ->pause_timeout = Glib::signal_timeout ().connect (
399422 [this ] ()
400423 {
424+ if (WayfireStreamChooserApp::getInstance ().window_list .get_selected_children ()[0 ]->get_children ()[
425+ 0 ] == this )
426+ {
427+ return G_SOURCE_REMOVE ;
428+ }
429+
401430 this ->pause ();
402431 return G_SOURCE_REMOVE ;
403432 }, 2000 );
You can’t perform that action at this time.
0 commit comments