all repos — fluxbox @ dda34421a3d586e6efd70a4a672266267dda7474

custom fork of the fluxbox windowmanager

fix shape - all menus shaped, and some weird shape bugs
rathnor rathnor
commit

dda34421a3d586e6efd70a4a672266267dda7474

parent

9a155ea7b5cf1b76aa7b9864aa3c1a7342f1f67c

M ChangeLogChangeLog

@@ -1,5 +1,11 @@

(Format: Year/Month/Day) Changes for 0.9.6: +*03/10/06: + * Fix shaped windows+menus (Simon) + - make sure all existing menus use shape + - fix Shape itself, particularly to work properly with borders + Shape.cc IconBarTool.hh/cc Toolbar.hh/cc ToolbarHandler.hh/cc + Window.hh/cc Workspace.hh/cc WinClient.cc *03/10/05: * Fix frame size when changing titlebar size (Simon) - also send configure notify when toggling decorations
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTool.cc,v 1.12 2003/09/15 20:19:36 fluxgen Exp $ +// $Id: IconbarTool.cc,v 1.13 2003/10/06 06:22:42 rathnor Exp $ #include "IconbarTool.hh"

@@ -30,7 +30,7 @@ #include "Window.hh"

#include "IconButton.hh" #include "Workspace.hh" #include "fluxbox.hh" - +#include "FbMenu.hh" #include "FbTk/Menu.hh" #include "FbTk/MenuItem.hh"

@@ -181,7 +181,8 @@ m_unfocused_pm(0),

m_empty_pm(0), m_rc_mode(screen.resourceManager(), WORKSPACE, screen.name() + ".iconbar.mode", screen.altName() + ".Iconbar.Mode"), - m_menu(*screen.menuTheme(), menu.screenNumber(), screen.imageControl()) { + m_menu(*screen.menuTheme(), menu.screenNumber(), screen.imageControl(), + *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) { // setup menu setupModeMenu(m_menu, *this);
M src/IconbarTool.hhsrc/IconbarTool.hh

@@ -20,13 +20,14 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTool.hh,v 1.8 2003/09/10 11:08:14 fluxgen Exp $ +// $Id: IconbarTool.hh,v 1.9 2003/10/06 06:22:42 rathnor Exp $ #ifndef ICONBARTOOL_HH #define ICONBARTOOL_HH #include "ToolbarItem.hh" #include "Container.hh" +#include "FbMenu.hh" #include "FbTk/Observer.hh" #include "FbTk/Resource.hh"

@@ -108,7 +109,7 @@

IconList m_icon_list; FbTk::Resource<Mode> m_rc_mode; - FbTk::Menu m_menu; + FbMenu m_menu; }; #endif // ICONBARTOOL_HH
M src/Shape.ccsrc/Shape.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Shape.cc,v 1.6 2003/09/17 14:16:53 fluxgen Exp $ +// $Id: Shape.cc,v 1.7 2003/10/06 06:22:42 rathnor Exp $ #include "Shape.hh" #include "FbTk/FbWindow.hh"

@@ -49,8 +49,9 @@ static char right_bits[] = { 0x03, 0x1f, 0x3f, 0x7f, 0x7f, 0x7f, 0xff, 0xff};

static char bottom_left_bits[] = { 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xfc, 0xf8, 0xc0 }; static char bottom_right_bits[] = { 0xff, 0xff, 0x7f, 0x7f, 0x7f, 0x3f, 0x1f, 0x03 }; - const int win_width = win.width() + 2*win.borderWidth() + 1; - const int win_height = win.height() + 2*win.borderWidth(); + const int borderw = win.borderWidth(); + const int win_width = win.width() + 2*borderw; + const int win_height = win.height() + 2*borderw; const int pixmap_width = min(8, win_width); const int pixmap_height = min(8, win_height);

@@ -60,7 +61,7 @@ char *data = new char[data_size];

memset(data, 0xFF, data_size); XImage *ximage = XCreateImage(disp, - DefaultVisual(disp, DefaultScreen(disp)), + DefaultVisual(disp, win.screenNumber()), 1, XYPixmap, 0, data,

@@ -76,7 +77,7 @@

if (place & Shape::TOPLEFT) { for (int y=0; y<pixmap_height; y++) { for (int x=0; x<pixmap_width; x++) { - XPutPixel(ximage, x + 1, y, (left_bits[y] & (0x01 << x)) ? 1 : 0); + XPutPixel(ximage, x, y, (left_bits[y] & (0x01 << x)) ? 1 : 0); } } }

@@ -93,7 +94,7 @@

if (place & Shape::BOTTOMLEFT) { for (int y=0; y<pixmap_height; y++) { for (int x=0; x<pixmap_width; x++) { - XPutPixel(ximage, x + 1, y + win_height - pixmap_height, + XPutPixel(ximage, x, y + win_height - pixmap_height, (bottom_left_bits[y] & (0x01 << x)) ? 1 : 0); } }

@@ -107,11 +108,6 @@ (bottom_right_bits[y] & (0x01 << x)) ? 1 : 0);

} } } - - for (int y = 0; y<pixmap_height; ++y) { - XPutPixel(ximage, 0, y, 1); - } - Pixmap pm = XCreatePixmap(disp, win.window(), win_width, win_height, 1);

@@ -179,7 +175,7 @@ // and make the window normal

XShapeCombineMask(FbTk::App::instance()->display(), m_win->window(), ShapeBounding, - -2, 0, + -m_win->borderWidth(), -m_win->borderWidth(), m_shape, ShapeSet);
M src/Toolbar.ccsrc/Toolbar.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.122 2003/09/08 18:17:19 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.123 2003/10/06 06:22:42 rathnor Exp $ #include "Toolbar.hh"

@@ -224,7 +224,8 @@ m_window_pm(0),

m_screen(scrn), m_toolbarmenu(menu), m_placementmenu(*scrn.menuTheme(), - scrn.screenNumber(), scrn.imageControl()), + scrn.screenNumber(), scrn.imageControl(), + *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_layermenu(*scrn.menuTheme(), scrn.screenNumber(), scrn.imageControl(),
M src/Toolbar.hhsrc/Toolbar.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.hh,v 1.46 2003/08/29 00:44:41 fluxgen Exp $ +// $Id: Toolbar.hh,v 1.47 2003/10/06 06:22:43 rathnor Exp $ #ifndef TOOLBAR_HH #define TOOLBAR_HH

@@ -45,6 +45,7 @@ #include <memory>

class BScreen; class Strut; +class FbMenu; class Container; class IconButton; class Shape;

@@ -163,7 +164,7 @@ BScreen &m_screen; ///< screen connection

FbTk::Timer m_hide_timer; ///< timer to for auto hide toolbar FbTk::Menu &m_toolbarmenu; - FbTk::Menu m_placementmenu; + FbMenu m_placementmenu; LayerMenu<Toolbar> m_layermenu; // themes
M src/ToolbarHandler.ccsrc/ToolbarHandler.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarHandler.cc,v 1.28 2003/09/08 18:18:25 fluxgen Exp $ +// $Id: ToolbarHandler.cc,v 1.29 2003/10/06 06:22:43 rathnor Exp $ /** * The ToolbarHandler class acts as a rough interface to the toolbar.

@@ -33,7 +33,7 @@ #include "Window.hh"

#include "Screen.hh" #include "Workspace.hh" #include "MenuItem.hh" -#include "Menu.hh" +#include "FbMenu.hh" #include "FbCommands.hh" #include "RefCount.hh" #include "SimpleCommand.hh"

@@ -51,9 +51,11 @@ // no need to lock since only one resource

m_toolbar(0), m_current_workspace(0), m_modemenu(*screen.menuTheme(), - screen.screenNumber(), screen.imageControl()), + screen.screenNumber(), screen.imageControl(), + *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_toolbarmenu(*screen.menuTheme(), - screen.screenNumber(), screen.imageControl()) { + screen.screenNumber(), screen.imageControl(), + *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) { m_modemenu.setInternalMenu(); m_toolbarmenu.setInternalMenu();
M src/ToolbarHandler.hhsrc/ToolbarHandler.hh

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarHandler.hh,v 1.8 2003/09/08 18:18:25 fluxgen Exp $ +// $Id: ToolbarHandler.hh,v 1.9 2003/10/06 06:22:43 rathnor Exp $ #ifndef TOOLBARHANDLER_HH #define TOOLBARHANDLER_HH

@@ -90,8 +90,8 @@ BScreen &m_screen;

std::auto_ptr<Toolbar> m_toolbar; unsigned int m_current_workspace; ToolbarMode m_mode; - FbTk::Menu m_modemenu; - FbTk::Menu m_toolbarmenu; + FbMenu m_modemenu; + FbMenu m_toolbarmenu; }; #endif // TOOLBARHANDLER_HH
M src/WinClient.ccsrc/WinClient.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: WinClient.cc,v 1.29 2003/10/02 16:14:41 rathnor Exp $ +// $Id: WinClient.cc,v 1.30 2003/10/06 06:22:43 rathnor Exp $ #include "WinClient.hh"

@@ -633,17 +633,17 @@

int i = width, j = height; // Check minimum size - if (width < 0 || width < min_width) + if (width < 0 || width < static_cast<signed>(min_width)) width = min_width; - if (height < 0 || height < min_height) + if (height < 0 || height < static_cast<signed>(min_height)) height = min_height; // Check maximum size - if (max_width > 0 && width > max_width) + if (max_width > 0 && width > static_cast<signed>(max_width)) width = max_width; - if (max_height > 0 && height > max_height) + if (max_height > 0 && height > static_cast<signed>(max_height)) height = max_height; // enforce incremental size limits, wrt base size
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.240 2003/10/05 09:03:43 rathnor Exp $ +// $Id: Window.cc,v 1.241 2003/10/06 06:22:43 rathnor Exp $ #include "Window.hh"

@@ -260,7 +260,8 @@ stuck(false), m_managed(false),

maximized(MAX_NONE), m_screen(scr), display(0), - m_windowmenu(*scr.menuTheme(), scr.screenNumber(), scr.imageControl()), + m_windowmenu(*scr.menuTheme(), scr.screenNumber(), scr.imageControl(), + *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_old_decoration(DECOR_NORMAL), m_client(&client), m_frame(new FbWinFrame(tm, scr.imageControl(), scr.screenNumber(), 0, 0, 100, 100)),
M src/Window.hhsrc/Window.hh

@@ -22,13 +22,13 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.98 2003/10/05 02:31:23 rathnor Exp $ +// $Id: Window.hh,v 1.99 2003/10/06 06:22:43 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH +#include "FbMenu.hh" #include "Timer.hh" -#include "Menu.hh" #include "Subject.hh" #include "EventHandler.hh" #include "XLayerItem.hh"

@@ -419,7 +419,7 @@ FbTk::Timer m_timer;

Display *display; /// display connection BlackboxAttributes m_blackbox_attrib; - FbTk::Menu m_windowmenu; + FbMenu m_windowmenu; timeval m_last_focus_time;
M src/Workspace.ccsrc/Workspace.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.81 2003/08/24 11:16:42 fluxgen Exp $ +// $Id: Workspace.cc,v 1.82 2003/10/06 06:22:43 rathnor Exp $ #include "Workspace.hh"

@@ -118,7 +118,8 @@ Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager,

const std::string &name, unsigned int i): m_screen(scrn), m_lastfocus(0), - m_clientmenu(*scrn.menuTheme(), scrn.screenNumber(), scrn.imageControl()), + m_clientmenu(*scrn.menuTheme(), scrn.screenNumber(), scrn.imageControl(), + *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_layermanager(layermanager), m_name(name), m_id(i) {
M src/Workspace.hhsrc/Workspace.hh

@@ -27,7 +27,7 @@ #define WORKSPACE_HH

#include "NotCopyable.hh" -#include "Menu.hh" +#include "FbMenu.hh" #include "MultLayers.hh" #include <X11/Xlib.h>

@@ -94,7 +94,7 @@ void placeWindow(FluxboxWindow &win);

BScreen &m_screen; FluxboxWindow *m_lastfocus; - FbTk::Menu m_clientmenu; + FbMenu m_clientmenu; typedef std::vector<std::string> Group; typedef std::vector<Group> GroupList;