]> Dogcows Code - chaz/openbox/commitdiff
make struts get added to the screen when mapping a window. let the user disable windo...
authorDana Jansens <danakj@orodu.net>
Wed, 29 Jan 2003 21:48:46 +0000 (21:48 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 29 Jan 2003 21:48:46 +0000 (21:48 +0000)
src/client.cc
src/client.hh
src/python.hh
src/screen.cc

index 3939b0c61ada1b63278e7d0691ccf392da3cf722..e9136df4d0324c3294869e8af44d6cee9ef56af1 100644 (file)
@@ -288,6 +288,23 @@ void Client::setupDecorAndFunctions()
     }
   }
 
+  // finally, user specified disabled decorations are applied to subtract
+  // decorations
+  if (_disabled_decorations & Decor_Titlebar)
+    _decorations &= ~Decor_Titlebar;
+  if (_disabled_decorations & Decor_Handle)
+    _decorations &= ~Decor_Handle;
+  if (_disabled_decorations & Decor_Border)
+    _decorations &= ~Decor_Border;
+  if (_disabled_decorations & Decor_Iconify)
+    _decorations &= ~Decor_Iconify;
+  if (_disabled_decorations & Decor_Maximize)
+    _decorations &= ~Decor_Maximize;
+  if (_disabled_decorations & Decor_AllDesktops)
+    _decorations &= ~Decor_AllDesktops;
+  if (_disabled_decorations & Decor_Close)
+    _decorations &= ~Decor_Close;
+
   changeAllowedActions();
 }
 
@@ -1322,6 +1339,15 @@ void Client::fullscreen(bool fs)
 }
 
 
+void Client::disableDecorations(DecorationFlags flags)
+{
+  _disabled_decorations = flags;
+  setupDecorAndFunctions();
+  if (frame)
+    frame->adjustSize(); // change the decors on the frame
+}
+
+
 bool Client::focus()
 {
   // won't try focus if the client doesn't want it, or if the window isn't
index 4bc7a517140df0ac4efb9af4be88e68d491310bf..2a55d992f7fb9b0d9e9a36a8fff2cb11bf157c98 100644 (file)
@@ -326,6 +326,12 @@ private:
   */
   DecorationFlags _decorations;
 
+  //! A bitmask of values in the Client::Decoration enum.
+  /*!
+    Specifies the decorations that should NOT be displayed on the client.
+  */
+  DecorationFlags _disabled_decorations;
+
   //! A bitmask of values in the Client::Function enum
   /*!
     The values in the variable specify the ways in which the user is allowed to
@@ -527,6 +533,10 @@ BB    @param window The window id that the Client class should handle
   //! Returns the decorations that the client window wishes to be displayed on
   //! it
   inline DecorationFlags decorations() const { return _decorations; }
+  //! Returns the decorations that the user has requested to be disabled on the
+  //! client
+  inline DecorationFlags disabledDecorations() const
+    { return _disabled_decorations; }
   //! Returns the functions that the user can perform on the window
   inline FunctionFlags funtions() const { return _functions; }
 
@@ -596,6 +606,16 @@ BB    @param window The window id that the Client class should handle
   */
   void resize(Corner anchor, int w, int h);
 
+  //! Choose a mask of decorations to not display on the client
+  /*!
+    Pass a value of 0 to the function to turn all decorations back on. Note
+    that you cannot add decorations to a window with this, you can only remove
+    decorations that would otherwise have been displayed.
+    @param flags The mask of values from Client::Decoration to specify which
+                 decorations should not be displayed.
+  */
+  void disableDecorations(DecorationFlags flags);
+  
   //! Attempt to focus the client window
   bool focus();
 
@@ -609,7 +629,7 @@ BB    @param window The window id that the Client class should handle
             been unmapped/destroyed, and so is invalid.
   */
   bool validate() const;
-  
+
   virtual void focusHandler(const XFocusChangeEvent &e);
   virtual void unfocusHandler(const XFocusChangeEvent &e);
   virtual void propertyHandler(const XPropertyEvent &e);
index ac5bd3e1821f727cc4588a6ba870db1530beffdc..42b9726f50081ca752721f8fab64545bb42b3c69 100644 (file)
@@ -36,8 +36,10 @@ struct MouseContext {
     AllDesktopsButton,
     Grip,
     Root,
-    MenuItem,
-    NUM_MOUSE_CONTEXT
+    MenuItem
+#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+    , NUM_MOUSE_CONTEXT
+#endif
   };
 };
 
@@ -46,40 +48,80 @@ struct MouseAction {
     Press,
     Click,
     DoubleClick,
-    Motion,
-    NUM_MOUSE_ACTION
+    Motion
+#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+    , NUM_MOUSE_ACTION
+#endif
   };
 };
 
 struct KeyContext {
   enum KC {
     Menu,
-    All,
-    NUM_KEY_CONTEXT
+    All
+#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+    , NUM_KEY_CONTEXT
+#endif
   };
 };
 
 struct KeyAction {
   enum KA {
     Press,
-    Release,
-    NUM_KEY_ACTION
+    Release
+#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+    , NUM_KEY_ACTION
+#endif
   };
 };
 
 struct EventAction {
   enum EA {
-    EnterWindow,
-    LeaveWindow,
+    EnterWindow,        //!< Occurs when the mouse enters a window
+    LeaveWindow,        //!< Occurs when the mouse leaves a window
+    //! Occurs while a window is being managed. The handler should call
+    //! Client::move to the window
     PlaceWindow,
+    //! Occurs while a window is being managed, just before the window is
+    //! displayed
+    /*!
+      Note that the window's state may not be completely stabilized by this
+      point. The NewWindow event should be used when possible.
+    */
+    DisplayingWindow,
+    //! Occurs when a window is finished being managed
     NewWindow,
+    //! Occurs when a window has been closed and is going to be unmanaged
     CloseWindow,
+    //! Occurs when the window manager manages a screen
+    /*!
+      This event occurs on each managed screen during startup.
+    */
     Startup,
+    //! Occurs when the window manager unmanages a screen
+    /*!
+      This event occurs on each managed screen during shutdown.
+    */
     Shutdown,
+    //! Occurs when the input focus target changes
+    /*!
+      The data.client will be None of no client is focused.
+    */
     Focus,
+    //! Occurs when the system is fired through X.
+    /*!
+      The data.client will hold the client associated with the bell if
+      one has been specified, or None.
+    */
     Bell,
-    UrgentWindow,
-    NUM_EVENTS
+    //! Occurs when a client toggles its urgent status.
+    /*!
+      The Client::urgent method can be used to get the status.
+    */
+    UrgentWindow
+#if ! (defined(DOXYGEN_IGNORE) || defined(SWIG))
+    , NUM_EVENTS
+#endif
   };
 };
 
index e2bab5c8efa48796b3071cb03a9f0cfa56f16bcd..d47a1540f83133130d2cf4e3e14c29e7c4914ba3 100644 (file)
@@ -520,6 +520,9 @@ void Screen::manageWindow(Window window)
     openbox->bindings()->fireEvent(&data);
   }
 
+  EventData data(_number, client, EventAction::DisplayingWindow, 0);
+  openbox->bindings()->fireEvent(&data);
+
   // if on the current desktop.. (or all desktops)
   if (client->desktop() == _desktop ||
       client->desktop() == (signed)0xffffffff) {
@@ -532,6 +535,9 @@ void Screen::manageWindow(Window window)
 
   // add to the screen's list
   clients.push_back(client);
+  // once the client is in the list, update our strut to include the new
+  // client's
+  updateStrut();
   // this puts into the stacking order, then raises it
   _stacking.push_back(client);
   raiseWindow(client);
@@ -540,7 +546,6 @@ void Screen::manageWindow(Window window)
 
   openbox->bindings()->grabButtons(true, client);
 
-  // call the python NEWWINDOW binding
   EventData data(_number, client, EventAction::NewWindow, 0);
   openbox->bindings()->fireEvent(&data);
 
This page took 0.029371 seconds and 4 git commands to generate.