all repos — fluxbox @ 7c85d11a950cf88ce53cf15e6d4f21c3433fd24d

custom fork of the fluxbox windowmanager

tiled pixmap fix, patch from dhx (xyx@gm...), see mailing list
fluxgen fluxgen
commit

7c85d11a950cf88ce53cf15e6d4f21c3433fd24d

parent

df570bc9452b24e963c38591cfcb185eb70a8a38

3 files changed, 34 insertions(+), 6 deletions(-)

jump to
M src/FbTk/FbPixmap.ccsrc/FbTk/FbPixmap.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: FbPixmap.cc,v 1.10 2004/01/11 12:48:46 fluxgen Exp $ +// $Id: FbPixmap.cc,v 1.11 2004/07/05 23:51:57 fluxgen Exp $ #include "FbPixmap.hh" #include "App.hh"

@@ -247,6 +247,28 @@ m_height = new_pm.height();

m_depth = new_pm.depth(); m_pm = new_pm.release(); } + +void FbPixmap::tile(unsigned int dest_width, unsigned int dest_height) { + if (drawable() == 0 || + (dest_width == width() && dest_height == height())) + return; + + Display *dpy = FbTk::App::instance()->display(); + + FbPixmap new_pm(drawable(), width(), height(), depth()); + + new_pm.copy(m_pm); + + resize(dest_width,dest_height); + + GC gc = XCreateGC(dpy, drawable(), 0, NULL); + + XSetTile(dpy,gc,new_pm.release()); + XSetFillStyle(dpy, gc, FillTiled); + XFillRectangle(dpy,drawable(),gc, 0, 0, dest_width, dest_height); +} + + void FbPixmap::resize(unsigned int width, unsigned int height) { FbPixmap pm(drawable(), width, height, depth());
M src/FbTk/FbPixmap.hhsrc/FbTk/FbPixmap.hh

@@ -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: FbPixmap.hh,v 1.11 2004/04/26 21:57:32 fluxgen Exp $ +// $Id: FbPixmap.hh,v 1.12 2004/07/05 23:51:57 fluxgen Exp $ #ifndef FBTK_FBPIXMAP_HH #define FBTK_FBPIXMAP_HH

@@ -54,6 +54,8 @@ void rotate();

/// scales the pixmap to specified size void scale(unsigned int width, unsigned int height); void resize(unsigned int width, unsigned int height); + /// tiles the pixmap to specified size + void tile(unsigned int width, unsigned int height); /// drops pixmap and returns it Pixmap release();
M src/FbTk/TextureRender.ccsrc/FbTk/TextureRender.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: TextureRender.cc,v 1.9 2004/06/07 11:46:05 rathnor Exp $ +// $Id: TextureRender.cc,v 1.10 2004/07/05 23:51:57 fluxgen Exp $ #include "TextureRender.hh"

@@ -256,12 +256,16 @@

Pixmap TextureRender::renderPixmap(const FbTk::Texture &src_texture) { if (width != src_texture.pixmap().width() || height != src_texture.pixmap().height()) { + // copy src_texture's pixmap and - // scale to fit our size + // scale/tile to fit our size FbPixmap new_pm(src_texture.pixmap()); - // if not tiled then scale it - if (! (src_texture.type() & Texture::TILED)) + + if ((src_texture.type() & Texture::TILED)) { + new_pm.tile(width,height); + } else { new_pm.scale(width, height); + } return new_pm.release(); }