Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/gtk/browser_window_gtk.cc

Issue 155169: Work around a bug in KWin where the window shape doesn't get (Closed)
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/gtk/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 GdkRectangle mid_rect = { 1, 1, width - 2, 2 }; 1116 GdkRectangle mid_rect = { 1, 1, width - 2, 2 };
1117 GdkRectangle bot_rect = { 0, 3, width, height - 3 }; 1117 GdkRectangle bot_rect = { 0, 3, width, height - 3 };
1118 GdkRegion* mask = gdk_region_rectangle(&top_rect); 1118 GdkRegion* mask = gdk_region_rectangle(&top_rect);
1119 gdk_region_union_with_rect(mask, &mid_rect); 1119 gdk_region_union_with_rect(mask, &mid_rect);
1120 gdk_region_union_with_rect(mask, &bot_rect); 1120 gdk_region_union_with_rect(mask, &bot_rect);
1121 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, mask, 0, 0); 1121 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, mask, 0, 0);
1122 gdk_region_destroy(mask); 1122 gdk_region_destroy(mask);
1123 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 1, 1123 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 1,
1124 kFrameBorderThickness, kFrameBorderThickness, kFrameBorderThickness); 1124 kFrameBorderThickness, kFrameBorderThickness, kFrameBorderThickness);
1125 } else { 1125 } else {
1126 // Disable rounded corners. 1126 // Disable rounded corners. Simply passing in a NULL region doesn't
1127 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, NULL, 0, 0); 1127 // seem to work on KWin, so manually set the shape to the whole window.
1128 GdkRectangle rect = { 0, 0, width, height };
1129 GdkRegion* mask = gdk_region_rectangle(&rect);
1130 gdk_window_shape_combine_region(GTK_WIDGET(window_)->window, mask, 0, 0);
1131 gdk_region_destroy(mask);
1128 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 0, 0, 0, 0); 1132 gtk_alignment_set_padding(GTK_ALIGNMENT(window_container_), 0, 0, 0, 0);
1129 } 1133 }
1130 } 1134 }
1131 1135
1132 void BrowserWindowGtk::ConnectAccelerators() { 1136 void BrowserWindowGtk::ConnectAccelerators() {
1133 GtkAccelGroup* accel_group = gtk_accel_group_new(); 1137 GtkAccelGroup* accel_group = gtk_accel_group_new();
1134 gtk_window_add_accel_group(window_, accel_group); 1138 gtk_window_add_accel_group(window_, accel_group);
1135 // Drop the initial ref on |accel_group| so |window_| will own it. 1139 // Drop the initial ref on |accel_group| so |window_| will own it.
1136 g_object_unref(accel_group); 1140 g_object_unref(accel_group);
1137 1141
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 *edge = GDK_WINDOW_EDGE_NORTH_EAST; 1396 *edge = GDK_WINDOW_EDGE_NORTH_EAST;
1393 } else if (y < bounds_.height() - kResizeAreaCornerSize) { 1397 } else if (y < bounds_.height() - kResizeAreaCornerSize) {
1394 *edge = GDK_WINDOW_EDGE_EAST; 1398 *edge = GDK_WINDOW_EDGE_EAST;
1395 } else { 1399 } else {
1396 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; 1400 *edge = GDK_WINDOW_EDGE_SOUTH_EAST;
1397 } 1401 }
1398 return true; 1402 return true;
1399 } 1403 }
1400 NOTREACHED(); 1404 NOTREACHED();
1401 } 1405 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698