Chromium Code Reviews| Index: remoting/host/disconnect_window_linux.cc |
| diff --git a/remoting/host/disconnect_window_linux.cc b/remoting/host/disconnect_window_linux.cc |
| index f79bd30dd3f8d07544ba36249f2aaf83edd1b572..f9f3b70e6a207669cc00058f53c6794568d961fd 100644 |
| --- a/remoting/host/disconnect_window_linux.cc |
| +++ b/remoting/host/disconnect_window_linux.cc |
| @@ -54,6 +54,7 @@ class DisconnectWindowGtk : public HostWindow { |
| DISALLOW_COPY_AND_ASSIGN(DisconnectWindowGtk); |
| }; |
| +#if GTK_MAJOR_VERSION == 2 |
| // Helper function for creating a rectangular path with rounded corners, as |
| // Cairo doesn't have this facility. |radius| is the arc-radius of each |
| // corner. The bounding rectangle extends from (0, 0) to (width, height). |
| @@ -66,6 +67,7 @@ void AddRoundRectPath(cairo_t* cairo_context, int width, int height, |
| cairo_arc(cairo_context, radius, radius, radius, 2 * M_PI_2, 3 * M_PI_2); |
| cairo_close_path(cairo_context); |
| } |
| +#endif |
| DisconnectWindowGtk::DisconnectWindowGtk() |
| : disconnect_window_(nullptr), |
| @@ -138,7 +140,12 @@ void DisconnectWindowGtk::Start( |
| gtk_alignment_set_padding(GTK_ALIGNMENT(align), 8, 8, 24, 12); |
| gtk_container_add(GTK_CONTAINER(window), align); |
| +#if GTK_MAJOR_VERSION == 2 |
| GtkWidget* button_row = gtk_hbox_new(FALSE, 12); |
| +#else |
| + GtkWidget* button_row = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); |
| + gtk_box_set_homogeneous(GTK_BOX(button_row), FALSE); |
| +#endif |
| gtk_container_add(GTK_CONTAINER(align), button_row); |
| button_ = gtk_button_new_with_label( |
| @@ -197,6 +204,7 @@ gboolean DisconnectWindowGtk::OnConfigure(GtkWidget* widget, |
| current_width_ = event->width; |
| current_height_ = event->height; |
| +#if GTK_MAJOR_VERSION == 2 |
|
Tom (Use chromium acct)
2017/02/01 00:02:42
We can just let gtk draw the window background, ri
Sergey Ulanov
2017/02/02 00:42:49
I don't think we want to omit this code. This code
|
| // Create the depth 1 pixmap for the window shape. |
| GdkPixmap* shape_mask = |
| gdk_pixmap_new(nullptr, current_width_, current_height_, 1); |
| @@ -270,6 +278,7 @@ gboolean DisconnectWindowGtk::OnConfigure(GtkWidget* widget, |
| gdk_window_set_back_pixmap(widget->window, background, FALSE); |
| g_object_unref(background); |
| gdk_window_invalidate_rect(widget->window, nullptr, TRUE); |
| +#endif |
| return FALSE; |
| } |