LCOV - code coverage report
Current view: top level - widget/gtk - nsWindow.h (source / functions) Hit Total Coverage
Test: output.info Lines: 5 11 45.5 %
Date: 2017-07-14 16:53:18 Functions: 4 7 57.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /* vim:expandtab:shiftwidth=4:tabstop=4:
       3             :  */
       4             : /* This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       7             : 
       8             : #ifndef __nsWindow_h__
       9             : #define __nsWindow_h__
      10             : 
      11             : #include "mozcontainer.h"
      12             : #include "mozilla/RefPtr.h"
      13             : #include "mozilla/UniquePtr.h"
      14             : #include "nsIDragService.h"
      15             : #include "nsITimer.h"
      16             : #include "nsGkAtoms.h"
      17             : #include "nsRefPtrHashtable.h"
      18             : 
      19             : #include "nsBaseWidget.h"
      20             : #include <gdk/gdk.h>
      21             : #include <gtk/gtk.h>
      22             : 
      23             : #ifdef MOZ_X11
      24             : #include <gdk/gdkx.h>
      25             : #endif /* MOZ_X11 */
      26             : 
      27             : #include "mozilla/widget/WindowSurface.h"
      28             : #include "mozilla/widget/WindowSurfaceProvider.h"
      29             : 
      30             : #ifdef ACCESSIBILITY
      31             : #include "mozilla/a11y/Accessible.h"
      32             : #endif
      33             : #include "mozilla/EventForwards.h"
      34             : #include "mozilla/TouchEvents.h"
      35             : 
      36             : #include "IMContextWrapper.h"
      37             : 
      38             : #undef LOG
      39             : #ifdef MOZ_LOGGING
      40             : 
      41             : #include "mozilla/Logging.h"
      42             : #include "nsTArray.h"
      43             : #include "Units.h"
      44             : 
      45             : extern mozilla::LazyLogModule gWidgetLog;
      46             : extern mozilla::LazyLogModule gWidgetFocusLog;
      47             : extern mozilla::LazyLogModule gWidgetDragLog;
      48             : extern mozilla::LazyLogModule gWidgetDrawLog;
      49             : 
      50             : #define LOG(args) MOZ_LOG(gWidgetLog, mozilla::LogLevel::Debug, args)
      51             : #define LOGFOCUS(args) MOZ_LOG(gWidgetFocusLog, mozilla::LogLevel::Debug, args)
      52             : #define LOGDRAG(args) MOZ_LOG(gWidgetDragLog, mozilla::LogLevel::Debug, args)
      53             : #define LOGDRAW(args) MOZ_LOG(gWidgetDrawLog, mozilla::LogLevel::Debug, args)
      54             : 
      55             : #else
      56             : 
      57             : #define LOG(args)
      58             : #define LOGFOCUS(args)
      59             : #define LOGDRAG(args)
      60             : #define LOGDRAW(args)
      61             : 
      62             : #endif /* MOZ_LOGGING */
      63             : 
      64             : class gfxPattern;
      65             : 
      66             : namespace mozilla {
      67             : class TimeStamp;
      68             : class CurrentX11TimeGetter;
      69             : }
      70             : 
      71             : class nsWindow final : public nsBaseWidget
      72             : {
      73             : public:
      74             :     typedef mozilla::gfx::DrawTarget DrawTarget;
      75             :     typedef mozilla::WidgetEventTime WidgetEventTime;
      76             : 
      77             :     nsWindow();
      78             : 
      79             :     static void ReleaseGlobals();
      80             : 
      81             :     NS_DECL_ISUPPORTS_INHERITED
      82             : 
      83             :     void CommonCreate(nsIWidget *aParent, bool aListenForResizes);
      84             : 
      85             :     virtual nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
      86             :                                    nsEventStatus& aStatus) override;
      87             : 
      88             :     // called when we are destroyed
      89             :     virtual void OnDestroy(void) override;
      90             : 
      91             :     // called to check and see if a widget's dimensions are sane
      92             :     bool AreBoundsSane(void);
      93             : 
      94             :     // nsIWidget
      95             :     using nsBaseWidget::Create; // for Create signature not overridden here
      96             :     virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
      97             :                                          nsNativeWidget aNativeParent,
      98             :                                          const LayoutDeviceIntRect& aRect,
      99             :                                          nsWidgetInitData* aInitData) override;
     100             :     virtual void       Destroy() override;
     101             :     virtual nsIWidget *GetParent() override;
     102             :     virtual float      GetDPI() override;
     103             :     virtual double     GetDefaultScaleInternal() override;
     104             :     // Under Gtk, we manage windows using device pixels so no scaling is needed:
     105          31 :     mozilla::DesktopToLayoutDeviceScale GetDesktopToDeviceScale() final
     106             :     {
     107          31 :         return mozilla::DesktopToLayoutDeviceScale(1.0);
     108             :     }
     109             :     virtual void       SetParent(nsIWidget* aNewParent) override;
     110             :     virtual void       SetModal(bool aModal) override;
     111             :     virtual bool       IsVisible() const override;
     112             :     virtual void       ConstrainPosition(bool aAllowSlop,
     113             :                                          int32_t *aX,
     114             :                                          int32_t *aY) override;
     115             :     virtual void       SetSizeConstraints(const SizeConstraints& aConstraints) override;
     116             :     virtual void       Move(double aX,
     117             :                             double aY) override;
     118             :     virtual void       Show             (bool aState) override;
     119             :     virtual void       Resize           (double aWidth,
     120             :                                          double aHeight,
     121             :                                          bool   aRepaint) override;
     122             :     virtual void       Resize           (double aX,
     123             :                                          double aY,
     124             :                                          double aWidth,
     125             :                                          double aHeight,
     126             :                                          bool   aRepaint) override;
     127             :     virtual bool       IsEnabled() const override;
     128             : 
     129             :     void               SetZIndex(int32_t aZIndex) override;
     130             :     virtual void       SetSizeMode(nsSizeMode aMode) override;
     131             :     virtual void       Enable(bool aState) override;
     132             :     virtual nsresult   SetFocus(bool aRaise = false) override;
     133             :     virtual LayoutDeviceIntRect GetScreenBounds() override;
     134             :     virtual LayoutDeviceIntRect GetClientBounds() override;
     135             :     virtual LayoutDeviceIntSize GetClientSize() override;
     136             :     virtual LayoutDeviceIntPoint GetClientOffset() override;
     137             :     virtual void       SetCursor(nsCursor aCursor) override;
     138             :     virtual nsresult   SetCursor(imgIContainer* aCursor,
     139             :                                  uint32_t aHotspotX, uint32_t aHotspotY) override;
     140             :     virtual void       Invalidate(const LayoutDeviceIntRect& aRect) override;
     141             :     virtual void*      GetNativeData(uint32_t aDataType) override;
     142             :     virtual nsresult   SetTitle(const nsAString& aTitle) override;
     143             :     virtual void       SetIcon(const nsAString& aIconSpec) override;
     144             :     virtual void       SetWindowClass(const nsAString& xulWinType) override;
     145             :     virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
     146             :     virtual void       CaptureMouse(bool aCapture) override;
     147             :     virtual void       CaptureRollupEvents(nsIRollupListener *aListener,
     148             :                                            bool aDoCapture) override;
     149             :     virtual MOZ_MUST_USE nsresult GetAttention(int32_t aCycleCount) override;
     150             :     virtual nsresult   SetWindowClipRegion(const nsTArray<LayoutDeviceIntRect>& aRects,
     151             :                                            bool aIntersectWithExisting) override;
     152             :     virtual bool       HasPendingInputEvent() override;
     153             : 
     154             :     virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;
     155             :     virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
     156             :                                              uint16_t aDuration,
     157             :                                              nsISupports* aData,
     158             :                                              nsIRunnable* aCallback) override;
     159             :     virtual already_AddRefed<nsIScreen> GetWidgetScreen() override;
     160             :     virtual nsresult   MakeFullScreen(bool aFullScreen,
     161             :                                       nsIScreen* aTargetScreen = nullptr) override;
     162             :     virtual void       HideWindowChrome(bool aShouldHide) override;
     163             : 
     164             :     /**
     165             :      * GetLastUserInputTime returns a timestamp for the most recent user input
     166             :      * event.  This is intended for pointer grab requests (including drags).
     167             :      */
     168             :     static guint32     GetLastUserInputTime();
     169             : 
     170             :     // utility method, -1 if no change should be made, otherwise returns a
     171             :     // value that can be passed to gdk_window_set_decorations
     172             :     gint               ConvertBorderStyles(nsBorderStyle aStyle);
     173             : 
     174             :     GdkRectangle DevicePixelsToGdkRectRoundOut(LayoutDeviceIntRect aRect);
     175             : 
     176             :     // event callbacks
     177             : #if (MOZ_WIDGET_GTK == 2)
     178             :     gboolean           OnExposeEvent(GdkEventExpose *aEvent);
     179             : #else
     180             :     gboolean           OnExposeEvent(cairo_t *cr);
     181             : #endif
     182             :     gboolean           OnConfigureEvent(GtkWidget *aWidget,
     183             :                                         GdkEventConfigure *aEvent);
     184             :     void               OnContainerUnrealize();
     185             :     void               OnSizeAllocate(GtkAllocation *aAllocation);
     186             :     void               OnDeleteEvent();
     187             :     void               OnEnterNotifyEvent(GdkEventCrossing *aEvent);
     188             :     void               OnLeaveNotifyEvent(GdkEventCrossing *aEvent);
     189             :     void               OnMotionNotifyEvent(GdkEventMotion *aEvent);
     190             :     void               OnButtonPressEvent(GdkEventButton *aEvent);
     191             :     void               OnButtonReleaseEvent(GdkEventButton *aEvent);
     192             :     void               OnContainerFocusInEvent(GdkEventFocus *aEvent);
     193             :     void               OnContainerFocusOutEvent(GdkEventFocus *aEvent);
     194             :     gboolean           OnKeyPressEvent(GdkEventKey *aEvent);
     195             :     gboolean           OnKeyReleaseEvent(GdkEventKey *aEvent);
     196             : 
     197             :     /**
     198             :      * MaybeDispatchContextMenuEvent() may dispatch eContextMenu event if
     199             :      * the given key combination should cause opening context menu.
     200             :      *
     201             :      * @param aEvent            The native key event.
     202             :      * @return                  true if this method dispatched eContextMenu
     203             :      *                          event.  Otherwise, false.
     204             :      *                          Be aware, when this returns true, the
     205             :      *                          widget may have been destroyed.
     206             :      */
     207             :     bool               MaybeDispatchContextMenuEvent(const GdkEventKey* aEvent);
     208             : 
     209             :     void               OnScrollEvent(GdkEventScroll *aEvent);
     210             :     void               OnVisibilityNotifyEvent(GdkEventVisibility *aEvent);
     211             :     void               OnWindowStateEvent(GtkWidget *aWidget,
     212             :                                           GdkEventWindowState *aEvent);
     213             :     void               OnDragDataReceivedEvent(GtkWidget       *aWidget,
     214             :                                                GdkDragContext  *aDragContext,
     215             :                                                gint             aX,
     216             :                                                gint             aY,
     217             :                                                GtkSelectionData*aSelectionData,
     218             :                                                guint            aInfo,
     219             :                                                guint            aTime,
     220             :                                                gpointer         aData);
     221             :     gboolean           OnPropertyNotifyEvent(GtkWidget *aWidget,
     222             :                                              GdkEventProperty *aEvent);
     223             : #if GTK_CHECK_VERSION(3,4,0)
     224             :     gboolean           OnTouchEvent(GdkEventTouch* aEvent);
     225             : #endif
     226             : 
     227             :     virtual already_AddRefed<mozilla::gfx::DrawTarget>
     228             :                        StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
     229             :                                                   mozilla::layers::BufferMode* aBufferMode) override;
     230             :     virtual void       EndRemoteDrawingInRegion(mozilla::gfx::DrawTarget* aDrawTarget,
     231             :                                                 LayoutDeviceIntRegion& aInvalidRegion) override;
     232             : 
     233             : private:
     234             :     void               UpdateAlpha(mozilla::gfx::SourceSurface* aSourceSurface, nsIntRect aBoundsRect);
     235             : 
     236             :     void               NativeMove();
     237             :     void               NativeResize();
     238             :     void               NativeMoveResize();
     239             : 
     240             :     void               NativeShow  (bool    aAction);
     241             :     void               SetHasMappedToplevel(bool aState);
     242             :     LayoutDeviceIntSize GetSafeWindowSize(LayoutDeviceIntSize aSize);
     243             : 
     244             :     void               EnsureGrabs  (void);
     245             :     void               GrabPointer  (guint32 aTime);
     246             :     void               ReleaseGrabs (void);
     247             : 
     248             :     void               UpdateClientOffset();
     249             : 
     250             : public:
     251             :     void               ThemeChanged(void);
     252             :     void               OnDPIChanged(void);
     253             :     void               OnCheckResize(void);
     254             :     void               OnCompositedChanged(void);
     255             : 
     256             : #ifdef MOZ_X11
     257             :     Window             mOldFocusWindow;
     258             : #endif /* MOZ_X11 */
     259             : 
     260             :     static guint32     sLastButtonPressTime;
     261             : 
     262             :     virtual MOZ_MUST_USE nsresult
     263             :                        BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
     264             :                                        int32_t aHorizontal,
     265             :                                        int32_t aVertical) override;
     266             :     virtual MOZ_MUST_USE nsresult
     267             :                        BeginMoveDrag(mozilla::WidgetMouseEvent* aEvent) override;
     268             : 
     269           2 :     MozContainer*      GetMozContainer() { return mContainer; }
     270             :     // GetMozContainerWidget returns the MozContainer even for undestroyed
     271             :     // descendant windows
     272             :     GtkWidget*         GetMozContainerWidget();
     273           4 :     GdkWindow*         GetGdkWindow() { return mGdkWindow; }
     274           0 :     bool               IsDestroyed() { return mIsDestroyed; }
     275             : 
     276             :     void               DispatchDragEvent(mozilla::EventMessage aMsg,
     277             :                                          const LayoutDeviceIntPoint& aRefPoint,
     278             :                                          guint aTime);
     279             :     static void        UpdateDragStatus (GdkDragContext *aDragContext,
     280             :                                          nsIDragService *aDragService);
     281             :     // If this dispatched the keydown event actually, this returns TRUE,
     282             :     // otherwise, FALSE.
     283             :     bool               DispatchKeyDownEvent(GdkEventKey *aEvent,
     284             :                                             bool *aIsCancelled);
     285             :     WidgetEventTime    GetWidgetEventTime(guint32 aEventTime);
     286             :     mozilla::TimeStamp GetEventTimeStamp(guint32 aEventTime);
     287             :     mozilla::CurrentX11TimeGetter* GetCurrentTimeGetter();
     288             : 
     289             :     virtual void SetInputContext(const InputContext& aContext,
     290             :                                  const InputContextAction& aAction) override;
     291             :     virtual InputContext GetInputContext() override;
     292             :     virtual TextEventDispatcherListener*
     293             :         GetNativeTextEventDispatcherListener() override;
     294             :     void GetEditCommandsRemapped(NativeKeyBindingsType aType,
     295             :                                  const mozilla::WidgetKeyboardEvent& aEvent,
     296             :                                  nsTArray<mozilla::CommandInt>& aCommands,
     297             :                                  uint32_t aGeckoKeyCode,
     298             :                                  uint32_t aNativeKeyCode);
     299             :     virtual void GetEditCommands(
     300             :                      NativeKeyBindingsType aType,
     301             :                      const mozilla::WidgetKeyboardEvent& aEvent,
     302             :                      nsTArray<mozilla::CommandInt>& aCommands) override;
     303             : 
     304             :     // These methods are for toplevel windows only.
     305             :     void               ResizeTransparencyBitmap();
     306             :     void               ApplyTransparencyBitmap();
     307             :     void               ClearTransparencyBitmap();
     308             : 
     309             :    virtual void        SetTransparencyMode(nsTransparencyMode aMode) override;
     310             :    virtual nsTransparencyMode GetTransparencyMode() override;
     311             : #if (MOZ_WIDGET_GTK >= 3)
     312             :    virtual void        UpdateOpaqueRegion(const LayoutDeviceIntRegion& aOpaqueRegion) override;
     313             : #endif
     314             :    virtual nsresult    ConfigureChildren(const nsTArray<Configuration>& aConfigurations) override;
     315             :    nsresult            UpdateTranslucentWindowAlphaInternal(const nsIntRect& aRect,
     316             :                                                             uint8_t* aAlphas, int32_t aStride);
     317             : 
     318             : #if (MOZ_WIDGET_GTK == 2)
     319             :     static already_AddRefed<DrawTarget> GetDrawTargetForGdkDrawable(GdkDrawable* aDrawable,
     320             :                                                                     const mozilla::gfx::IntSize& aSize);
     321             : #endif
     322             :     virtual void       ReparentNativeWidget(nsIWidget* aNewParent) override;
     323             : 
     324             :     virtual nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
     325             :                                                 uint32_t aNativeMessage,
     326             :                                                 uint32_t aModifierFlags,
     327             :                                                 nsIObserver* aObserver) override;
     328             : 
     329           0 :     virtual nsresult SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
     330             :                                                nsIObserver* aObserver) override
     331           0 :     { return SynthesizeNativeMouseEvent(aPoint, GDK_MOTION_NOTIFY, 0, aObserver); }
     332             : 
     333             :     virtual nsresult SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
     334             :                                                       uint32_t aNativeMessage,
     335             :                                                       double aDeltaX,
     336             :                                                       double aDeltaY,
     337             :                                                       double aDeltaZ,
     338             :                                                       uint32_t aModifierFlags,
     339             :                                                       uint32_t aAdditionalFlags,
     340             :                                                       nsIObserver* aObserver) override;
     341             : 
     342             : #if GTK_CHECK_VERSION(3,4,0)
     343             :     virtual nsresult SynthesizeNativeTouchPoint(uint32_t aPointerId,
     344             :                                                 TouchPointerState aPointerState,
     345             :                                                 LayoutDeviceIntPoint aPoint,
     346             :                                                 double aPointerPressure,
     347             :                                                 uint32_t aPointerOrientation,
     348             :                                                 nsIObserver* aObserver) override;
     349             : #endif
     350             : 
     351             : #ifdef MOZ_X11
     352           1 :     Display* XDisplay() { return mXDisplay; }
     353             : #endif
     354             :     virtual void GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData) override;
     355             : 
     356             :     // HiDPI scale conversion
     357             :     gint GdkScaleFactor();
     358             : 
     359             :     // To GDK
     360             :     gint DevicePixelsToGdkCoordRoundUp(int pixels);
     361             :     gint DevicePixelsToGdkCoordRoundDown(int pixels);
     362             :     GdkPoint DevicePixelsToGdkPointRoundDown(LayoutDeviceIntPoint point);
     363             :     GdkRectangle DevicePixelsToGdkSizeRoundUp(LayoutDeviceIntSize pixelSize);
     364             : 
     365             :     // From GDK
     366             :     int GdkCoordToDevicePixels(gint coord);
     367             :     LayoutDeviceIntPoint GdkPointToDevicePixels(GdkPoint point);
     368             :     LayoutDeviceIntPoint GdkEventCoordsToDevicePixels(gdouble x, gdouble y);
     369             :     LayoutDeviceIntRect GdkRectToDevicePixels(GdkRectangle rect);
     370             : 
     371             :     virtual bool WidgetTypeSupportsAcceleration() override;
     372             : protected:
     373             :     virtual ~nsWindow();
     374             : 
     375             :     // event handling code
     376             :     void DispatchActivateEvent(void);
     377             :     void DispatchDeactivateEvent(void);
     378             :     void DispatchResized();
     379             :     void MaybeDispatchResized();
     380             : 
     381             :     // Helper for SetParent and ReparentNativeWidget.
     382             :     void ReparentNativeWidgetInternal(nsIWidget* aNewParent,
     383             :                                       GtkWidget* aNewContainer,
     384             :                                       GdkWindow* aNewParentWindow,
     385             :                                       GtkWidget* aOldContainer);
     386             : 
     387             :     virtual void RegisterTouchWindow() override;
     388             : 
     389             :     nsCOMPtr<nsIWidget> mParent;
     390             :     // Is this a toplevel window?
     391             :     bool                mIsTopLevel;
     392             :     // Has this widget been destroyed yet?
     393             :     bool                mIsDestroyed;
     394             : 
     395             :     // Should we send resize events on all resizes?
     396             :     bool                mListenForResizes;
     397             :     // Does WindowResized need to be called on listeners?
     398             :     bool                mNeedsDispatchResized;
     399             :     // This flag tracks if we're hidden or shown.
     400             :     bool                mIsShown;
     401             :     bool                mNeedsShow;
     402             :     // is this widget enabled?
     403             :     bool                mEnabled;
     404             :     // has the native window for this been created yet?
     405             :     bool                mCreated;
     406             : #if GTK_CHECK_VERSION(3,4,0)
     407             :     // whether we handle touch event
     408             :     bool                mHandleTouchEvent;
     409             : #endif
     410             :     // true if this is a drag and drop feedback popup
     411             :     bool               mIsDragPopup;
     412             :     // Can we access X?
     413             :     bool               mIsX11Display;
     414             : 
     415             : private:
     416             :     void               DestroyChildWindows();
     417             :     GtkWidget         *GetToplevelWidget();
     418             :     nsWindow          *GetContainerWindow();
     419             :     void               SetUrgencyHint(GtkWidget *top_window, bool state);
     420             :     void               SetDefaultIcon(void);
     421             :     void               InitButtonEvent(mozilla::WidgetMouseEvent& aEvent,
     422             :                                        GdkEventButton* aGdkEvent);
     423             :     bool               DispatchCommandEvent(nsIAtom* aCommand);
     424             :     bool               DispatchContentCommandEvent(mozilla::EventMessage aMsg);
     425             :     bool               CheckForRollup(gdouble aMouseX, gdouble aMouseY,
     426             :                                       bool aIsWheel, bool aAlwaysRollup);
     427           0 :     void               CheckForRollupDuringGrab()
     428             :     {
     429           0 :       CheckForRollup(0, 0, false, true);
     430           0 :     }
     431             : 
     432             :     bool               GetDragInfo(mozilla::WidgetMouseEvent* aMouseEvent,
     433             :                                    GdkWindow** aWindow, gint* aButton,
     434             :                                    gint* aRootX, gint* aRootY);
     435             :     void               ClearCachedResources();
     436             :     nsIWidgetListener* GetListener();
     437             :     bool               IsComposited() const;
     438             : 
     439             : 
     440             :     GtkWidget          *mShell;
     441             :     MozContainer       *mContainer;
     442             :     GdkWindow          *mGdkWindow;
     443             : 
     444             :     uint32_t            mHasMappedToplevel : 1,
     445             :                         mIsFullyObscured : 1,
     446             :                         mRetryPointerGrab : 1;
     447             :     nsSizeMode          mSizeState;
     448             : 
     449             :     int32_t             mTransparencyBitmapWidth;
     450             :     int32_t             mTransparencyBitmapHeight;
     451             : 
     452             :     nsIntPoint          mClientOffset;
     453             : 
     454             : #if GTK_CHECK_VERSION(3,4,0)
     455             :     // This field omits duplicate scroll events caused by GNOME bug 726878.
     456             :     guint32             mLastScrollEventTime;
     457             : 
     458             :     // for touch event handling
     459             :     nsRefPtrHashtable<nsPtrHashKey<GdkEventSequence>, mozilla::dom::Touch> mTouches;
     460             : #endif
     461             : 
     462             : #ifdef MOZ_X11
     463             :     Display*            mXDisplay;
     464             :     Window              mXWindow;
     465             :     Visual*             mXVisual;
     466             :     int                 mXDepth;
     467             :     mozilla::widget::WindowSurfaceProvider mSurfaceProvider;
     468             : #endif
     469             : 
     470             :     // Upper bound on pending ConfigureNotify events to be dispatched to the
     471             :     // window. See bug 1225044.
     472             :     unsigned int mPendingConfigures;
     473             : 
     474             : #ifdef ACCESSIBILITY
     475             :     RefPtr<mozilla::a11y::Accessible> mRootAccessible;
     476             : 
     477             :     /**
     478             :      * Request to create the accessible for this window if it is top level.
     479             :      */
     480             :     void                CreateRootAccessible();
     481             : 
     482             :     /**
     483             :      * Dispatch accessible event for the top level window accessible.
     484             :      *
     485             :      * @param  aEventType  [in] the accessible event type to dispatch
     486             :      */
     487             :     void                DispatchEventToRootAccessible(uint32_t aEventType);
     488             : 
     489             :     /**
     490             :      * Dispatch accessible window activate event for the top level window
     491             :      * accessible.
     492             :      */
     493             :     void                DispatchActivateEventAccessible();
     494             : 
     495             :     /**
     496             :      * Dispatch accessible window deactivate event for the top level window
     497             :      * accessible.
     498             :      */
     499             :     void                DispatchDeactivateEventAccessible();
     500             : 
     501             :     /**
     502             :      * Dispatch accessible window maximize event for the top level window
     503             :      * accessible.
     504             :      */
     505             :     void                DispatchMaximizeEventAccessible();
     506             : 
     507             :     /**
     508             :      * Dispatch accessible window minize event for the top level window
     509             :      * accessible.
     510             :      */
     511             :     void                DispatchMinimizeEventAccessible();
     512             : 
     513             :     /**
     514             :      * Dispatch accessible window restore event for the top level window
     515             :      * accessible.
     516             :      */
     517             :     void                DispatchRestoreEventAccessible();
     518             : #endif
     519             : 
     520             :     // The cursor cache
     521             :     static GdkCursor   *gsGtkCursorCache[eCursorCount];
     522             : 
     523             :     // Transparency
     524             :     bool         mIsTransparent;
     525             :     // This bitmap tracks which pixels are transparent. We don't support
     526             :     // full translucency at this time; each pixel is either fully opaque
     527             :     // or fully transparent.
     528             :     gchar*       mTransparencyBitmap;
     529             : 
     530             :     // all of our DND stuff
     531             :     void   InitDragEvent(mozilla::WidgetDragEvent& aEvent);
     532             : 
     533             :     float              mLastMotionPressure;
     534             : 
     535             :     // Remember the last sizemode so that we can restore it when
     536             :     // leaving fullscreen
     537             :     nsSizeMode         mLastSizeMode;
     538             : 
     539             :     static bool DragInProgress(void);
     540             : 
     541             :     void DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent);
     542             : 
     543             :     // nsBaseWidget
     544             :     virtual LayerManager* GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
     545             :                                           LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
     546             :                                           LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override;
     547             : 
     548             :     void CleanLayerManagerRecursive();
     549             : 
     550             :     virtual int32_t RoundsWidgetCoordinatesTo() override;
     551             : 
     552             :     /**
     553             :      * |mIMContext| takes all IME related stuff.
     554             :      *
     555             :      * This is owned by the top-level nsWindow or the topmost child
     556             :      * nsWindow embedded in a non-Gecko widget.
     557             :      *
     558             :      * The instance is created when the top level widget is created.  And when
     559             :      * the widget is destroyed, it's released.  All child windows refer its
     560             :      * ancestor widget's instance.  So, one set of IM contexts is created for
     561             :      * all windows in a hierarchy.  If the children are released after the top
     562             :      * level window is released, the children still have a valid pointer,
     563             :      * however, IME doesn't work at that time.
     564             :      */
     565             :     RefPtr<mozilla::widget::IMContextWrapper> mIMContext;
     566             : 
     567             :     mozilla::UniquePtr<mozilla::CurrentX11TimeGetter> mCurrentTimeGetter;
     568             : };
     569             : 
     570             : #endif /* __nsWindow_h__ */

Generated by: LCOV version 1.13