diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 19:31:31 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 19:31:31 +0000 |
commit | b482147a9e98a8492940e9293f9b922c63720f91 (patch) | |
tree | 2d0a101fc814e3afdf0e3072284c35b819d070c5 /chrome/browser/autocomplete | |
parent | d4b726d756a9ba89eb6a19c9099b7c2c592da0ee (diff) | |
download | chromium_src-b482147a9e98a8492940e9293f9b922c63720f91.zip chromium_src-b482147a9e98a8492940e9293f9b922c63720f91.tar.gz chromium_src-b482147a9e98a8492940e9293f9b922c63720f91.tar.bz2 |
Revert "GTK: Use rounded corners in AutocompletePopupViewGtk."
This mostly reverts commit e461ca0cebce93375b81a14af7caf5d95a10158c (r25080) and adds a comment about why I reverted it.
This breaks on NX, probably because we're shaping a toplevel window
from within the expose event. I don't see a different point when we
can shape the window reliably (configure-event doesn't appear to work),
so just revert rounded corners on the popup for now.
BUG=22015
Review URL: http://codereview.chromium.org/224004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index 5c0b56c..450521e 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -25,7 +25,6 @@ #include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/gtk/rounded_window.h" #include "chrome/common/notification_service.h" #include "grit/theme_resources.h" @@ -64,9 +63,6 @@ const int kRightPadding = 3; // the total width. const float kContentWidthPercentage = 0.7; -// Radius of the rounded corners. -const int kCornerSize = 3; - // UTF-8 Left-to-right embedding. const char* kLRE = "\xe2\x80\xaa"; @@ -291,11 +287,17 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk( g_signal_connect(window_, "expose-event", G_CALLBACK(&HandleExposeThunk), this); - // Make the popup have rounded corners. (Must be called after we hook up - // AutocompletePopupViewGtk's expose-event handler.) - gtk_util::ActAsRoundedWindow( - window_, kBorderColor, kCornerSize, - gtk_util::ROUNDED_ALL, gtk_util::BORDER_ALL); + // TODO(erg): There appears to be a bug somewhere in something which shows + // itself when we're in NX. Previously, we called + // gtk_util::ActAsRoundedWindow() to make this popup have rounded + // corners. This worked on the standard xorg server (both locally and + // remotely), but broke over NX. My current hypothesis is that it can't + // handle shaping top-level windows during an expose event, but I'm not sure + // how else to get accurate shaping information. + // + // r25080 (the original patch that added rounded corners here) should + // eventually be cherry picked once I know what's going + // on. http://crbug.com/22015. } AutocompletePopupViewGtk::~AutocompletePopupViewGtk() { @@ -422,11 +424,23 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, // This means we won't draw the border, but, yeah, whatever. // TODO(deanm): Make the code more robust and remove this check. if (window_rect.width() < (kIconAreaWidth * 3)) - return FALSE; + return TRUE; GdkDrawable* drawable = GDK_DRAWABLE(event->window); GdkGC* gc = gdk_gc_new(drawable); + // kBorderColor is unallocated, so use the GdkRGB routine. + gdk_gc_set_rgb_fg_color(gc, &kBorderColor); + + // This assert is kinda ugly, but it would be more currently unneeded work + // to support painting a border that isn't 1 pixel thick. There is no point + // in writing that code now, and explode if that day ever comes. + COMPILE_ASSERT(kBorderThickness == 1, border_1px_implied); + // Draw the 1px border around the entire window. + gdk_draw_rectangle(drawable, gc, FALSE, + 0, 0, + window_rect.width() - 1, window_rect.height() - 1); + pango_layout_set_height(layout_, kHeightPerResult * PANGO_SCALE); // TODO(deanm): Intersect the line and damage rects, and only repaint and @@ -502,7 +516,7 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, g_object_unref(gc); - return FALSE; + return TRUE; } // static |