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

Unified Diff: chrome/browser/ui/gtk/extensions/shell_window_gtk.h

Issue 10834205: Draggable region support for frameless app window on GTK. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: refactor the patch. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/extensions/shell_window_gtk.h
diff --git a/chrome/browser/ui/gtk/extensions/shell_window_gtk.h b/chrome/browser/ui/gtk/extensions/shell_window_gtk.h
index 432edd14c938c239c743303f5c6d4a58cc75c23d..535ba98b2c1927b980b76b77d8c6171bb73a5b24 100644
--- a/chrome/browser/ui/gtk/extensions/shell_window_gtk.h
+++ b/chrome/browser/ui/gtk/extensions/shell_window_gtk.h
@@ -10,13 +10,17 @@
#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h"
#include "ui/base/gtk/gtk_signal.h"
+#include "ui/base/ui_base_types.h"
#include "ui/base/x/active_window_watcher_x_observer.h"
+#include "ui/base/x/x11_util.h"
#include "ui/gfx/rect.h"
+#include "third_party/skia/include/core/SkRegion.h"
class Profile;
namespace extensions {
class Extension;
+struct DraggableRegion;
}
class ShellWindowGtk : public ShellWindow,
@@ -55,6 +59,8 @@ class ShellWindowGtk : public ShellWindow,
// ShellWindow implementation.
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
virtual bool IsFullscreenOrPending() const OVERRIDE;
+ virtual void UpdateDraggableRegions(
+ const std::vector<extensions::DraggableRegion>& regions) OVERRIDE;
virtual ~ShellWindowGtk();
@@ -64,6 +70,8 @@ class ShellWindowGtk : public ShellWindow,
GdkEventConfigure*);
CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnWindowState,
GdkEventWindowState*);
+ CHROMEGTK_CALLBACK_1(ShellWindowGtk, gboolean, OnButtonPress,
+ GdkEventButton*);
GtkWindow* window_;
GdkWindowState state_;
@@ -83,6 +91,22 @@ class ShellWindowGtk : public ShellWindow,
// fullscreen, however: some WMs don't support fullscreen.
bool content_thinks_its_fullscreen_;
+ // The region is treated as title bar, can be dragged to move
+ // and double clicked to maximize.
+ SkRegion draggable_region_;
+
+ // If true, don't call gdk_window_raise() when we get a click in the title
+ // bar or window border. This is to work around a compiz bug.
+ bool suppress_window_raise_;
+
+ // Keep track of the last click time and the last click position so we can
+ // filter out extra GDK_BUTTON_PRESS events when a double click happens.
+ guint32 last_click_time_;
+ gfx::Point last_click_position_;
+
+ // True if the window shows without frame.
+ bool frameless_;
+
DISALLOW_COPY_AND_ASSIGN(ShellWindowGtk);
};

Powered by Google App Engine
This is Rietveld 408576698