summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 16:41:22 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 16:41:22 +0000
commitc43686a522ed78f5de92588491e4242fd259c283 (patch)
tree900ca246f811f32cc9233b3e76f2efe05f9dae43 /views/widget
parentd5368093444337a3c7e5b9c7535627cc98f662af (diff)
downloadchromium_src-c43686a522ed78f5de92588491e4242fd259c283.zip
chromium_src-c43686a522ed78f5de92588491e4242fd259c283.tar.gz
chromium_src-c43686a522ed78f5de92588491e4242fd259c283.tar.bz2
re-landing after clang fix. clang bot is red due to bus error in linker.
Wait showing html dialog until renderre finish painting after page is loaded. This change keeps track of state transition to make sure we only show the window on the paint after page load. minor change; use gdk's debug paint. Views no longer manage the damaged rect by itself so we can simply use gdk's debug paint. Note to mazda. Please consider adding fade-in animation. I believe it will make it much nicer. BUG=chromium-os:15809 TEST=open keyboard overlay on device. no white flicker should be observed. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=88271 Review URL: http://codereview.chromium.org/7024032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88345 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_gtk.cc27
-rw-r--r--views/widget/native_widget_gtk.h9
2 files changed, 18 insertions, 18 deletions
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index 392abe8..91af0e3 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -279,7 +279,6 @@ static GtkWidget* CreateDragIconWidget(GdkPixbuf* drag_image) {
// static
GtkWidget* NativeWidgetGtk::null_parent_ = NULL;
-bool NativeWidgetGtk::debug_paint_enabled_ = false;
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetGtk, public:
@@ -502,7 +501,7 @@ void NativeWidgetGtk::ActiveWindowChanged(GdkWindow* active_window) {
}
////////////////////////////////////////////////////////////////////////////////
-// NativeWidgetGtk, Widget implementation:
+// NativeWidgetGtk implementation:
void NativeWidgetGtk::ClearNativeFocus() {
DCHECK(!child_);
@@ -545,9 +544,17 @@ bool NativeWidgetGtk::HandleKeyboardEvent(const KeyEvent& key) {
return handled;
}
+bool NativeWidgetGtk::SuppressFreezeUpdates() {
+ if (!painted_) {
+ painted_ = true;
+ return true;
+ }
+ return false;
+}
+
// static
void NativeWidgetGtk::EnableDebugPaint() {
- debug_paint_enabled_ = true;
+ gdk_window_set_debug_updates(true);
}
// static
@@ -1182,20 +1189,6 @@ gboolean NativeWidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
}
}
- if (debug_paint_enabled_) {
- // Using cairo directly because using skia didn't have immediate effect.
- cairo_t* cr = gdk_cairo_create(event->window);
- gdk_cairo_region(cr, event->region);
- cairo_set_source_rgb(cr, 1, 0, 0); // red
- cairo_rectangle(cr,
- event->area.x, event->area.y,
- event->area.width, event->area.height);
- cairo_fill(cr);
- cairo_destroy(cr);
- // Make sure that users see the red flash.
- XSync(ui::GetXDisplay(), false /* don't discard events */);
- }
-
ui::ScopedRegion region(gdk_region_copy(event->region));
if (!gdk_region_empty(region.Get())) {
GdkRectangle clip_bounds;
diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h
index 2603298..f080b10 100644
--- a/views/widget/native_widget_gtk.h
+++ b/views/widget/native_widget_gtk.h
@@ -108,7 +108,7 @@ class NativeWidgetGtk : public NativeWidget,
void GetRequestedSize(gfx::Size* out) const;
// Overridden from ui::ActiveWindowWatcherX::Observer.
- virtual void ActiveWindowChanged(GdkWindow* active_window);
+ virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
// Clears the focus on the native widget having the focus.
virtual void ClearNativeFocus();
@@ -117,6 +117,13 @@ class NativeWidgetGtk : public NativeWidget,
// Returns true if it's handled by the focus manager.
bool HandleKeyboardEvent(const KeyEvent& key);
+ // Tells widget not to remove FREEZE_UPDATES property when the
+ // widget is painted. This is used if painting the gtk widget
+ // is not enough to show the window and has to wait further like
+ // keyboard overlay. Returns true if this is called before
+ // FREEZE_UPDATES property is removed, or false otherwise.
+ bool SuppressFreezeUpdates();
+
// Enables debug painting. See |debug_paint_enabled_| for details.
static void EnableDebugPaint();