X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fframe.hh;h=7248c71fdb268831c99da864f3f30cf569c2d014;hb=52cb7bd11ed83a57c4c1affcdac8a1f7d68ae551;hp=ff6a21ad0becd3ab9db8d8f74fbdc440b6adf4c4;hpb=d8de17b58e2fee1414e0970bc372b661abe259a6;p=chaz%2Fopenbox diff --git a/src/frame.hh b/src/frame.hh index ff6a21ad..7248c71f 100644 --- a/src/frame.hh +++ b/src/frame.hh @@ -25,8 +25,16 @@ namespace ob { //! Holds and decorates a frame around an OBClient (client window) /*! + The frame is responsible for calling XSelectInput on the client window's new + parent with the SubstructureRedirectMask so that structure events for the + client are sent to the window manager. */ class OBFrame : public otk::OtkWidget { +public: + + //! The event mask to grab on frame windows + static const long event_mask = EnterWindowMask | LeaveWindowMask; + private: OBClient *_client; const otk::ScreenInfo *_screen; @@ -37,6 +45,9 @@ private: //! The size of the frame on each side of the client window otk::Strut _size; + //! The size of the frame on each side of the client window inside the border + otk::Strut _innersize; + // decoration windows otk::OtkFocusWidget _plate; // sits entirely under the client window otk::OtkFocusWidget _titlebar; @@ -64,6 +75,9 @@ private: */ void releaseClient(bool remap); + //! Shape the frame window to the client window + void adjustShape(); + public: //! Constructs an OBFrame object, and reparents the client to itself /*! @@ -77,14 +91,25 @@ public: //! Set the style to decorate the frame with virtual void setStyle(otk::Style *style); - //! Update the frame to match the client - void adjust(); - //! Shape the frame window to the client window - void adjustShape(); + //! Update the frame's size to match the client + void adjustSize(); + //! Update the frame's position to match the client + void adjustPosition(); + + //! Applies gravity to the client's position to find where the frame should + //! be positioned. + /*! + @return The proper coordinates for the frame, based on the client. + */ + void clientGravity(int &x, int &y); + + //! Reversly applies gravity to the frame's position to find where the client + //! should be positioned. + /*! + @return The proper coordinates for the client, based on the frame. + */ + void frameGravity(int &x, int &y); - //! Applies gravity for the client's gravity, moving the frame to the - //! appropriate place - void applyGravity(); }; }