Skip to content

Commit

Permalink
Show exercises on primary monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaelers committed Nov 25, 2023
1 parent 56f68da commit 6a33df9
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 60 deletions.
7 changes: 7 additions & 0 deletions changes.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
releases:
- version: 1.11.0-beta.8
date: 2023-11-26T00:00:00+01:00
short: |-
Workrave 1.11.0-beta.8 has been released.
changes:
- Workrave now always shows the exercises during a restbreak on the primary monitor

- version: 1.11.0-beta.7
date: 2023-08-14T22:34:36+02:00
short: |-
Expand Down
178 changes: 125 additions & 53 deletions tools/citool/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions ui/app/Application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ Application::create_break_window(BreakId break_id, workrave::utils::Flags<BreakH

break_windows.push_back(break_window);
break_window->init();

break_flags |= BREAK_FLAGS_NO_EXERCISES;
}
}

Expand Down
6 changes: 6 additions & 0 deletions ui/app/toolkits/gtkmm/HeadInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ HeadInfo::get_y() const
{
return geometry.get_y();
}

bool
HeadInfo::is_primary() const
{
return primary;
}
3 changes: 2 additions & 1 deletion ui/app/toolkits/gtkmm/HeadInfo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public:
int get_height() const;
int get_x() const;
int get_y() const;
bool is_primary() const;

int monitor{0};
bool primary{false};
Gdk::Rectangle geometry;
};

Expand Down
4 changes: 2 additions & 2 deletions ui/app/toolkits/gtkmm/RestBreakWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ RestBreakWindow::get_exercise_count()
void
RestBreakWindow::install_exercises_panel()
{
if (head.monitor != 0 || (break_flags & BREAK_FLAGS_NO_EXERCISES))
if (!head.is_primary() || ((break_flags & BREAK_FLAGS_NO_EXERCISES) != 0))
{
install_info_panel();
}
Expand Down Expand Up @@ -242,7 +242,7 @@ RestBreakWindow::install_info_panel()
pluggable_panel->queue_resize();

BlockMode block_mode = GUIConfig::block_mode()();
if (block_mode == BlockMode::Off && head.monitor == 0)
if (block_mode == BlockMode::Off && head.is_primary())
{
Gtk::Requisition new_size;
get_preferred_size(new_size, natural_size);
Expand Down
3 changes: 1 addition & 2 deletions ui/app/toolkits/gtkmm/Toolkit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Toolkit::get_head_info(int screen_index) const
Glib::RefPtr<Gdk::Monitor> monitor = display->get_monitor(screen_index);

HeadInfo head;
head.monitor = screen_index;
head.primary = monitor->is_primary();
monitor->get_geometry(head.geometry);

return head;
Expand Down Expand Up @@ -429,7 +429,6 @@ Toolkit::init_multihead()
TRACE_ENTRY();
Glib::RefPtr<Gdk::Display> display = Gdk::Display::get_default();
Glib::RefPtr<Gdk::Screen> screen = display->get_default_screen();
// screen->signal_monitors_changed().connect(sigc::mem_fun(*this, &Application::update_multihead));
}

void
Expand Down

0 comments on commit 6a33df9

Please sign in to comment.