all repos — fluxbox @ 3ac43716b79cd6ee207aee4c0444678f2ac6298b

custom fork of the fluxbox windowmanager

transparent slit
fluxgen fluxgen
commit

3ac43716b79cd6ee207aee4c0444678f2ac6298b

parent

d050c6d0a6a103d743bd5c6b75eb6f0a92a204cb

4 files changed, 49 insertions(+), 10 deletions(-)

jump to
M src/Screen.ccsrc/Screen.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: Screen.cc,v 1.163 2003/05/13 14:03:27 fluxgen Exp $ +// $Id: Screen.cc,v 1.164 2003/05/13 21:12:18 fluxgen Exp $ #include "Screen.hh"

@@ -485,7 +485,8 @@ scrname+".toolbar.placement", altscrname+".Toolbar.Placement"),

slit_auto_hide(rm, false, scrname+".slit.autoHide", altscrname+".Slit.AutoHide"), slit_placement(rm, Slit::BOTTOMRIGHT, scrname+".slit.placement", altscrname+".Slit.Placement"), - slit_direction(rm, Slit::VERTICAL, scrname+".slit.direction", altscrname+".Slit.Direction") + slit_direction(rm, Slit::VERTICAL, scrname+".slit.direction", altscrname+".Slit.Direction"), + slit_alpha(rm, 255, scrname+".slit.alpha", altscrname+".Slit.Alpha") {
M src/Screen.hhsrc/Screen.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: Screen.hh,v 1.95 2003/05/13 14:02:48 fluxgen Exp $ +// $Id: Screen.hh,v 1.96 2003/05/13 21:12:17 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -111,10 +111,11 @@ inline const Slit *getSlit() const { return m_slit.get(); }

inline Slit::Placement getSlitPlacement() const { return *resource.slit_placement; } inline Slit::Direction getSlitDirection() const { return *resource.slit_direction; } + inline Resource<int> &slitAlphaResource() { return resource.slit_alpha; } inline void saveSlitPlacement(Slit::Placement p) { resource.slit_placement = p; } inline void saveSlitDirection(Slit::Direction d) { resource.slit_direction = d; } inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; } - + inline unsigned int getSlitOnHead() const { return resource.slit_on_head; } inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; }

@@ -411,6 +412,7 @@ Resource<Toolbar::Placement> toolbar_placement;

Resource<bool> slit_auto_hide; Resource<Slit::Placement> slit_placement; Resource<Slit::Direction> slit_direction; + Resource<int> slit_alpha; unsigned int slit_on_head;
M src/Slit.ccsrc/Slit.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: Slit.cc,v 1.51 2003/05/13 13:28:28 fluxgen Exp $ +// $Id: Slit.cc,v 1.52 2003/05/13 21:09:43 fluxgen Exp $ #include "Slit.hh"

@@ -49,6 +49,8 @@ #include "XLayer.hh"

#include "RootTheme.hh" #include "FbTk/Theme.hh" #include "FbMenu.hh" +#include "Transparent.hh" +#include "IntResMenuItem.hh" #include <algorithm> #include <iostream>

@@ -318,6 +320,9 @@ screen().rootWindow().depth(), InputOutput, screen().rootWindow().visual(),

create_mask, &attrib); FbTk::EventManager::instance()->add(*this, frame.window); + m_transp.reset(new FbTk::Transparent(screen().rootPixmap(), frame.window.drawable(), + *screen().slitAlphaResource(), + screen().getScreenNumber())); m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer));

@@ -470,7 +475,7 @@ FbTk::EventManager::instance()->add(*this, client->client_window);

FbTk::EventManager::instance()->add(*this, client->icon_window); frame.window.show(); - frame.window.clear(); + clearWindow(); reconfigure(); updateClientmenu();

@@ -557,6 +562,8 @@ }

void Slit::reconfigure() { + m_transp->setAlpha(*screen().slitAlphaResource()); + frame.width = 0; frame.height = 0;

@@ -654,8 +661,7 @@

if (tmp) image_ctrl->removeImage(tmp); - frame.window.clear(); - + clearWindow(); int x, y; switch (direction()) {

@@ -1064,7 +1070,21 @@ reconfigure();

} void Slit::exposeEvent(XExposeEvent &ev) { + clearWindow(); +} + +void Slit::clearWindow() { frame.window.clear(); + if (frame.pixmap != 0) { + if (screen().rootPixmap() != m_transp->source()) + m_transp->setSource(screen().rootPixmap(), screen().getScreenNumber()); + + m_transp->render(frame.window.x(), frame.window.y(), + 0, 0, + frame.window.width(), frame.window.height()); + + } + } void Slit::timeout() {

@@ -1162,12 +1182,20 @@ using namespace FBNLS;

using namespace FbTk; FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); + FbTk::MacroCommand *s_a_reconf_slit_macro = new FbTk::MacroCommand(); FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), &Fluxbox::save_rc)); FbTk::RefCount<FbTk::Command> reconf_cmd(new FbCommands::ReconfigureFluxboxCmd()); + FbTk::RefCount<FbTk::Command> reconf_slit_cmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::reconfigure)); + s_a_reconf_macro->add(saverc_cmd); s_a_reconf_macro->add(reconf_cmd); + + s_a_reconf_slit_macro->add(saverc_cmd); + s_a_reconf_slit_macro->add(reconf_slit_cmd); + FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); + FbTk::RefCount<FbTk::Command> save_and_reconfigure_slit(s_a_reconf_slit_macro); // setup base menu m_slitmenu.setLabel("Slit");

@@ -1182,7 +1210,13 @@ m_slitmenu.insert(new BoolMenuItem(i18n->getMessage(

CommonSet, CommonAutoHide, "Auto hide"), screen().doSlitAutoHide(), - save_and_reconfigure)); + save_and_reconfigure_slit)); + + FbTk::MenuItem *alpha_menuitem = new IntResMenuItem("Alpha", + screen().slitAlphaResource(), + 0, 255); + alpha_menuitem->setCommand(save_and_reconfigure_slit); + m_slitmenu.insert(alpha_menuitem); m_slitmenu.insert(new SlitDirMenuItem(i18n->getMessage( SlitSet, SlitSlitDirection,
M src/Slit.hhsrc/Slit.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: Slit.hh,v 1.27 2003/05/11 17:42:51 fluxgen Exp $ +/// $Id: Slit.hh,v 1.28 2003/05/13 21:09:43 fluxgen Exp $ #ifndef SLIT_HH #define SLIT_HH

@@ -111,6 +111,7 @@ virtual void timeout();

private: + void clearWindow(); void setupMenu(); void removeClient(SlitClient *client, bool remap, bool destroy);

@@ -144,6 +145,7 @@ Atom m_kwm1_dockwindow, m_kwm2_dockwindow;

std::auto_ptr<FbTk::XLayerItem> m_layeritem; std::auto_ptr<SlitTheme> m_slit_theme; + std::auto_ptr<FbTk::Transparent> m_transp; };