Skip to content

Commit

Permalink
Add safety check for scale.
Browse files Browse the repository at this point in the history
  • Loading branch information
azzar1 committed Oct 31, 2016
1 parent d0c7c56 commit 97a6945
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion decorations/DecorationsForceQuitDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ struct ForceQuitDialog::Impl : sigc::trackable

void UpdateDialogPosition()
{
auto scale = gtk_widget_get_scale_factor(dialog_);
gint scale = gtk_widget_get_scale_factor(dialog_);
scale = std::max<gint>(1, scale);
auto const& win_geo = win_->inputRect();
nux::Size walloc(gtk_widget_get_allocated_width(dialog_) * scale, gtk_widget_get_allocated_height(dialog_) * scale);
gtk_window_move(GTK_WINDOW(dialog_), (win_geo.centerX() - walloc.width/2) / scale, (win_geo.centerY() - walloc.height/2) / scale);
Expand Down

0 comments on commit 97a6945

Please sign in to comment.