pekdon patch

This commit is contained in:
fluxgen 2002-01-04 21:21:43 +00:00
parent 502f1a959c
commit bec0065e4a
28 changed files with 364 additions and 256 deletions

View file

@ -8,6 +8,18 @@ Changes for 0.1.6:
* Changed Keygrabbing constants to uppercase
* Changed Texture constants to uppercase and moved them into class BImage
to clean up the global namespace
*01/12/27:
* Fixed grabVertMax and grabHorizMax + 1 pixel maximise bug. (Claes Nästén)
* Now relative and vertical tabs gets textures rendered ok, still
interlaced and gradients aren't rendered in right direction. (Claes Nästén)
*01/12/26:
* Fixed tab and iconbar uppdating so that tab and iconbar labels will have
the right text. (Claes Nästén)
*01/12/23:
* Fixed a bug in Tab::buttonReleaseEvent and added sloppyWindowGrouping
wich lets you release windows tabs on other windows and not only other
tabs to group them (Claes Nästén)
*01/12/19:
* Moved some structs from file scope of BaseDisplay.hh in to class BaseDisplay
* Fixed redraw bug when changing workspace

6
TODO
View file

@ -1,4 +1,7 @@
TODO for Fluxbox 0.2.0
* "Dont use tab" doesnt save
* Remove the cylic dep between class Tab and class Window
* Remove the cylic dep between class Theme and class Fluxbox
!* Fix "no font" crash
* Remove cyclic dep on Basemenu with class Fluxbox
* sloppy focus - auto-raise
@ -24,9 +27,6 @@ TODO for Fluxbox 0.2.0
* 0,0-pos fix
* reconfigure tar upp nya dekorationer
* fluxbox wont currently build on linux-hppa, needs the config.{sub,
guess} updated from ftp://ftp.gnu.org/pub/gnu/config/
* Create fbrun style app
(* Add wheelscroll-workspace-change configuration (reversed order or
regular)- Add "system menu" for minimized apps in the toolbar.

281
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -160,7 +160,7 @@ AC_ARG_ENABLE(debug,
[ --enable-debug include verbose debugging code [default=no]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
DEBUG="-DDEBUG"
DEBUG="-DDEBUG -fno-inline"
else
AC_MSG_RESULT([no])
fi,

View file

@ -107,9 +107,9 @@ GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -161,6 +161,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -34,6 +34,7 @@
#define ConfigmenuTabPlacement 0x15
#define ConfigmenuTabRotateVertical 0x16
#define ConfigmenuSemiSloppyFocus 0x17
#define ConfigmenuSloppyWindowGrouping 0x18
#define IconSet 0x4
#define IconIcons 0x1

View file

@ -44,3 +44,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Routa Verticalmente I Tab
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Закладки вертикально
$ #SemiSloppyFocus
# Размытый фокус
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotera Vertikala Flikar
$ #SemiSloppyFocus
# Halv hafsig fokus
$ #SloppyWindowGrouping
# Hafsig Fönster Gruppering

View file

@ -46,3 +46,5 @@ $ #TabRotateVertical
# Rotate Vertical Tabs
$ #SemiSloppyFocus
# Semi Sloppy Focus
$ #SloppyWindowGrouping
# Sloppy Window Grouping

View file

@ -36,6 +36,7 @@
#define CMENU_USE_TABS 8
#define CMENU_USE_ICONS 9
#define CMENU_SLOPPY_WIN_GROUP 10
#define CMENU_TAB_ROTATE 21
Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
@ -128,8 +129,13 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
0, 0,
#endif // NLS
"Use Icons"), CMENU_USE_ICONS);
insert(i18n->getMessage(
#ifdef NLS
ConfigmenuSet, ConfigmenuSloppyWindowGrouping,
#else // !NLS
0, 0,
#endif // NLS
"Sloppy Window Grouping"), CMENU_SLOPPY_WIN_GROUP);
update();
@ -140,6 +146,7 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
setItemSelected(7, screen->doFocusLast());
setItemSelected(CMENU_USE_TABS, Fluxbox::instance()->useTabs());
setItemSelected(CMENU_USE_ICONS, Fluxbox::instance()->useIconBar());
setItemSelected(CMENU_SLOPPY_WIN_GROUP, screen->isSloppyWindowGrouping());
}
@ -203,6 +210,14 @@ void Configmenu::itemSelected(int button, int index) {
screen->reconfigure();
}
break;
case CMENU_SLOPPY_WIN_GROUP:
{
screen->saveSloppyWindowGrouping(!screen->isSloppyWindowGrouping());
setItemSelected(index, screen->isSloppyWindowGrouping());
screen->reconfigure();
}
break;
}
}
}

View file

@ -152,14 +152,14 @@ void IconBar::exposeEvent(XExposeEvent *ee) {
}
if (obj) {
Window root;
unsigned int width, height;
unsigned int border_width, depth; //not used
int x, y;
XGetGeometry(m_display, m_parent, &root, &x, &y, &width, &height,
&border_width, &depth);
//max width on every icon
unsigned int icon_width = width / m_iconlist->count();
@ -190,7 +190,7 @@ void IconBar::repositionIcons(void) {
//load right size of theme
loadTheme(icon_width, height);
IconListIterator it(m_iconlist);
for (x = 0; it.current(); it++, x+=icon_width) {
@ -271,8 +271,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
if (l < width)
break;
}
switch (m_screen->getWindowStyle()->tab.font.justify) {
case Misc::Font::RIGHT:
dx += width - l;
@ -284,7 +283,7 @@ void IconBar::draw(IconBarObj *obj, int width) {
break;
}
//Draw title to m_tabwin
//Draw title to m_iconwin
XClearWindow(m_display, iconwin);
@ -328,6 +327,7 @@ FluxboxWindow *IconBar::findWindow(Window w) {
// returns pointer to IconBarObj on success else
// 0 on failure
//------------------------------------
IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) {
IconListIterator it(m_iconlist);
@ -341,3 +341,22 @@ IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) {
return 0;
}
//---------- getIconWidth ------------
// will return the width of an icon
// window
//------------------------------------
unsigned int IconBarObj::getWidth() {
Window root;
unsigned int width, height;
unsigned int border_width, depth; //not used
int x, y; //not used
Display *m_display = Fluxbox::instance()->getXDisplay();
XGetGeometry(m_display, m_iconwin, &root, &x, &y,
&width, &height, &border_width, &depth);
return width;
}

View file

@ -32,9 +32,10 @@ public:
~IconBarObj();
inline Window getIconWin(void) { return m_iconwin; }
inline FluxboxWindow *getFluxboxWin(void) { return m_fluxboxwin; }
unsigned int getWidth(void);
private:
Window m_iconwin;
FluxboxWindow *m_fluxboxwin;
Window m_iconwin;
};
class IconBar
@ -42,21 +43,24 @@ class IconBar
public:
IconBar(BScreen *scrn, Window parent);
~IconBar();
void draw();
void draw(); //TODO
void reconfigure();
Window addIcon(FluxboxWindow *fluxboxwin);
Window delIcon(FluxboxWindow *fluxboxwin);
void buttonPressEvent(XButtonEvent *be);
FluxboxWindow *findWindow(Window w);
IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
void exposeEvent(XExposeEvent *ee);
void draw(IconBarObj *obj, int width);
private:
typedef LinkedList<IconBarObj> IconList;
typedef LinkedListIterator<IconBarObj> IconListIterator;
void draw(IconBarObj *obj, int width);
// void draw(IconBarObj *obj, int width);
void loadTheme(unsigned int width, unsigned int height);
void decorate(Window win);
IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
// IconBarObj *findIcon(FluxboxWindow *fluxboxwin);
void repositionIcons(void);
Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent);
BScreen *m_screen;

View file

@ -27,6 +27,8 @@
#ifndef _SCREEN_HH_
#define _SCREEN_HH_
#include <X11/Xlib.h>
#include <X11/Xresource.h>
@ -100,6 +102,8 @@ public:
inline const Bool &isScreenManaged(void) const { return managed; }
inline const Bool &isTabRotateVertical(void) const
{ return resource.tab_rotate_vertical; }
inline const Bool &isSloppyWindowGrouping(void) const
{ return resource.sloppy_window_grouping; }
inline const Bool &doAutoRaise(void) const { return resource.auto_raise; }
inline const Bool &doImageDither(void) const
{ return resource.image_dither; }
@ -203,6 +207,8 @@ public:
inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; }
inline void saveTabRotateVertical(Bool r)
{ resource.tab_rotate_vertical = r; }
inline void saveSloppyWindowGrouping(Bool s)
{ resource.sloppy_window_grouping = s; }
inline void iconUpdate(void) { iconmenu->update(); }
inline Iconmenu *getIconmenu(void) { return iconmenu; }
@ -305,7 +311,8 @@ private:
Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise,
auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max,
focus_new, focus_last, tab_rotate_vertical, semi_sloppy_focus;
focus_new, focus_last, tab_rotate_vertical, semi_sloppy_focus,
sloppy_window_grouping;
int workspaces, toolbar_placement, toolbar_width_percent, placement_policy,
edge_snap_threshold, row_direction, col_direction;

View file

@ -187,7 +187,7 @@ void Slit::addClient(Window w) {
XSelectInput(display, client->window, NoEventMask);
XReparentWindow(display, client->window, frame.window, 0, 0);
XMapRaised(display, client->window);
XMapRaised(display, client->window); //TODO: bbkeys bug here?
XChangeSaveSet(display, client->window, SetModeInsert);
XSelectInput(display, frame.window, SubstructureRedirectMask |

View file

@ -110,13 +110,12 @@ void Tab::createTabWindow() {
XGrabButton(m_display, Button1, Mod1Mask, m_tabwin, True,
ButtonReleaseMask | ButtonMotionMask, GrabModeAsync,
GrabModeAsync, None, Fluxbox::instance()->getMoveCursor());
//save to tabsearch
Fluxbox::instance()->saveTabSearch(m_tabwin, this);
XMapSubwindows(m_display, m_tabwin);
XMapWindow(m_display, m_tabwin);
decorate();
@ -155,12 +154,13 @@ void Tab::raise() {
m_win->getScreen()->raiseWindows(&first->m_tabwin, 1);
}
//-------------- decorate --------------------
// decorates the tab with current theme
//-------------- loadTheme -----------------
// loads the texture with the correct
// width and height, this is necessary in
// vertical and relative tab modes
// TODO optimize this
//--------------------------------------------
void Tab::decorate() {
//------------------------------------------
void Tab::loadTheme() {
BImageControl *image_ctrl = m_win->getScreen()->getImageControl();
Pixmap tmp = m_focus_pm;
BTexture *texture = &(m_win->getScreen()->getWindowStyle()->tab.l_focus);
@ -206,18 +206,24 @@ void Tab::decorate() {
}
if (tmp) image_ctrl->removeImage(tmp);
}
//-------------- decorate --------------------
// decorates the tab with current theme
//--------------------------------------------
void Tab::decorate() {
loadTheme();
XSetWindowBorderWidth(m_display, m_tabwin,
m_win->getScreen()->getWindowStyle()->tab.border_width);
XSetWindowBorder(m_display, m_tabwin,
m_win->getScreen()->getWindowStyle()->tab.border_color.getPixel());
}
//-------------- deiconify -------------------
//-------------- deiconify -----------------
// Deiconifies the tab
// Used from FluxboxWindow to deiconify the tab when the window is deiconfied
//--------------------------------------------
//------------------------------------------
void Tab::deiconify() {
XMapWindow(m_display, m_tabwin);
}
@ -386,6 +392,7 @@ void Tab::setPosition() {
if (m_win->isShaded())
pos_y = m_win->frame.y + m_win->getTitleHeight() +
m_win->getScreen()->getBorderWidth2x();
else
pos_y = m_win->frame.y + m_win->getHeight() +
m_win->getScreen()->getBorderWidth2x();
@ -585,70 +592,63 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) {
be->x_root, be->y_root, &dest_x, &dest_y, &child)) {
Tab *tab = 0;
FluxboxWindow *win = 0;
//search tablist for a tabwindow
if ((tab = Fluxbox::instance()->searchTab(child))!=0) {
if (((tab = Fluxbox::instance()->searchTab(child))!=0) ||
(m_win->getScreen()->isSloppyWindowGrouping() &&
((win = Fluxbox::instance()->searchWindow(child))!=0) &&
(tab = win->getTab())!=0)) {
if (tab == this) // inserting ourself to ourself causes a disconnect
return;
// do only attach a hole chain if we dropped the
// first tab in the dropped chain...
if (m_prev)
disconnect();
// attach this tabwindow chain to the tabwindow chain we found.
// attach this tabwindow chain to the tabwindow chain we found.
tab->insert(this);
} else {
disconnect();
// convinience
unsigned short int placement = m_win->getScreen()->getTabPlacement();
// (ab)using dest_x and dest_y
switch(m_win->getScreen()->getTabPlacement()) {
case PTop:
dest_x = be->x_root;
dest_y = be->y_root;
switch(m_win->getScreen()->getTabAlignment()) {
dest_x = be->x_root;
dest_y = be->y_root;
if (placement == PTop || placement == PBottom || m_win->isShaded()) {
if (placement == PBottom && !m_win->isShaded())
dest_y -= m_win->frame.height;
else if (placement != PTop && m_win->isShaded())
dest_y -= m_win->getTitleHeight();
else // PTop
dest_y += m_win->getTitleHeight();
switch(m_win->getScreen()->getTabAlignment()) {
case ACenter:
dest_x -= (m_win->frame.width / 2) - (m_size_w / 2);
break;
case ARight:
dest_x -= m_win->frame.width - m_size_w;
break;
}
break;
case PBottom:
dest_x = be->x_root;
dest_y = be->y_root - m_win->frame.height;
switch(m_win->getScreen()->getTabAlignment()) {
case ACenter:
dest_x -= (m_win->frame.width / 2) - (m_size_w / 2);
dest_x -= m_win->frame.width - m_size_w;
break;
case ARight:
dest_x -= m_win->frame.width - m_size_w;
break;
}
break;
case PLeft:
dest_x = be->x_root;
dest_y = be->y_root;
switch(m_win->getScreen()->getTabAlignment()) {
case ACenter:
dest_y -= (m_win->frame.height / 2) - (m_size_h / 2);
break;
case ALeft:
dest_y -= m_win->frame.height - m_size_h;
break;
}
break;
case PRight:
}
} else { // PLeft & PRight
if (placement == PRight)
dest_x = be->x_root - m_win->frame.width;
dest_y = be->y_root;
switch(m_win->getScreen()->getTabAlignment()) {
switch(m_win->getScreen()->getTabAlignment()) {
case ACenter:
dest_y -= (m_win->frame.height / 2) - (m_size_h / 2);
break;
case ALeft:
dest_y -= m_win->frame.height - m_size_h;
break;
}
break;
}
}
//TODO: this causes an calculate increase event, even if we
// only are moving a window
@ -778,8 +778,8 @@ Tab *Tab::getFirst(Tab *current) {
return i;
}
//-------------- getFirst() ---------
// Returns the first Tab in the chain
//-------------- getLast() ---------
// Returns the last Tab in the chain
// of currentchain.
//-----------------------------------
Tab *Tab::getLast(Tab *current) {
@ -918,11 +918,15 @@ void Tab::disconnect() {
// Sets Tab width _including_ borders
// ---------------------------------------
void Tab::setTabWidth(unsigned int w) {
if (w > m_win->getScreen()->getWindowStyle()->tab.border_width_2x) {
if (w > m_win->getScreen()->getWindowStyle()->tab.border_width_2x &&
w != m_size_w) {
m_size_w = w;
XResizeWindow(m_display, m_tabwin,
m_size_w - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
m_size_h - m_win->getScreen()->getWindowStyle()->tab.border_width_2x);
loadTheme(); // rerender themes to right size
focus(); // redraw the window
}
}
@ -930,11 +934,15 @@ void Tab::setTabWidth(unsigned int w) {
// Sets Tab height _including_ borders
// ---------------------------------------
void Tab::setTabHeight(unsigned int h) {
if (h > m_win->getScreen()->getWindowStyle()->tab.border_width_2x) {
if (h > m_win->getScreen()->getWindowStyle()->tab.border_width_2x &&
h != m_size_h) {
m_size_h = h;
XResizeWindow(m_display, m_tabwin,
m_size_w - m_win->getScreen()->getWindowStyle()->tab.border_width_2x,
m_size_h - m_win->getScreen()->getWindowStyle()->tab.border_width_2x);
loadTheme(); // rerender themes to right size
focus(); // redraw the window
}
}

View file

@ -93,6 +93,7 @@ private:
static const int m_max_tabs;
bool m_focus, m_moving; // moving and focus
void createTabWindow(); // creates the X win of tab
void loadTheme(); // loads the textures with right width and height
void setTabWidth(unsigned int w);
void setTabHeight(unsigned int h);
unsigned int calcRelativeWidth();

View file

@ -422,8 +422,7 @@ void Theme::loadWindowStyle() {
readDatabaseTexture("window.title.focus", "Window.Title.Focus",
&m_windowstyle.t_focus,
WhitePixel(m_display,
m_screennum));
WhitePixel(m_display, m_screennum));
readDatabaseTexture("window.title.unfocus", "Window.Title.Unfocus",
&m_windowstyle.t_unfocus,
BlackPixel(m_display, m_screennum));
@ -512,7 +511,7 @@ void Theme::loadWindowStyle() {
}
void Theme::loadTabStyle() {
if (!readDatabaseTexture("window.tab.title.focus", "Window.Tab.Title.Focus",
&m_windowstyle.tab.t_focus,
WhitePixel(m_display, m_screennum)))
@ -532,7 +531,6 @@ void Theme::loadTabStyle() {
&m_windowstyle.tab.l_unfocus,
BlackPixel(m_display, m_screennum)))
m_windowstyle.tab.l_unfocus = m_windowstyle.l_unfocus;
if (!readDatabaseColor("window.tab.label.focus.textColor",
"Window.Tab.Label.Focus.TextColor",
@ -549,11 +547,10 @@ void Theme::loadTabStyle() {
readDatabaseColor("window.tab.borderColor", "Window.Tab.BorderColor",
&m_windowstyle.tab.border_color,
BlackPixel(m_display, m_screennum));
XrmValue value;
char *value_type;
if (XrmGetResource(m_database, "window.tab.borderWidth", "Window.Tab.BorderWidth",
&value_type, &value)) {
if (sscanf(value.addr, "%u", &m_windowstyle.tab.border_width) != 1)
@ -578,7 +575,6 @@ void Theme::loadTabStyle() {
}
//--------- rotated font for left and right tabs
// TODO: add extra checking
if (XrmGetResource(m_database, "window.tab.font", "Window.Tab.Font",
&value_type, &value)) {
@ -587,7 +583,6 @@ void Theme::loadTabStyle() {
} else
m_windowstyle.tab.rot_font = Misc::XRotLoadFont(m_display, "fixed", 90);
if (XrmGetResource(m_database, "window.tab.justify", "Window.Tab.Justify",
&value_type, &value)) {
if (strstr(value.addr, "right") || strstr(value.addr, "Right"))
@ -668,9 +663,9 @@ void Theme::loadRootCommand() {
XrmValue value;
char *value_type;
Fluxbox *fb=Fluxbox::instance();
// printf("getting root command from fb->getRootCommand()");
const char *root_cmd=fb->getRootCommand();
// printf("root kommandot: %s\n", root_cmd);
if (root_cmd) {
#ifndef __EMX__
const int display_strlen = 1024;

View file

@ -130,6 +130,7 @@ public:
{ return ((hidden) ? frame.x_hidden : frame.x); }
inline const int &getY(void) const
{ return ((hidden) ? frame.y_hidden : frame.y); }
inline IconBar *getIconBar(void) { return iconbar; }
void buttonPressEvent(XButtonEvent *);
void buttonReleaseEvent(XButtonEvent *);

View file

@ -1839,7 +1839,7 @@ void FluxboxWindow::maximize(unsigned int button) {
if (! screen->doFullMax())
dh -= screen->getToolbar()->getExposedHeight() +
screen->getBorderWidth();
screen->getBorderWidth2x();
if (dw < client.min_width) dw = client.min_width;
if (dh < client.min_height) dh = client.min_height;
@ -1862,24 +1862,24 @@ void FluxboxWindow::maximize(unsigned int button) {
if (screen->doFullMax()) {
dy = ((screen->getHeight() - dh) / 2) - screen->getBorderWidth();
} else {
dy = (((screen->getHeight() - screen->getToolbar()->getExposedHeight())
- dh) / 2) - screen->getBorderWidth();
dy = (((screen->getHeight() - (screen->getToolbar()->getExposedHeight()))
- dh) / 2) - screen->getBorderWidth2x();
switch (screen->getToolbarPlacement()) {
case Toolbar::TopLeft:
case Toolbar::TopCenter:
case Toolbar::TopRight:
dy += screen->getToolbar()->getExposedHeight() +
screen->getBorderWidth();
screen->getBorderWidth2x();
break;
}
}
if (decorations.tab && Fluxbox::instance()->useTabs()) { // Want to se the tabs
if (hasTab()) {
switch(screen->getTabPlacement()) {
case Tab::PTop:
dy += screen->getTabHeight();
dh -= screen->getTabHeight() + screen->getBorderWidth();
dh -= screen->getTabHeight();
break;
case Tab::PLeft:
if (screen->isTabRotateVertical()) {
@ -1897,11 +1897,11 @@ void FluxboxWindow::maximize(unsigned int button) {
dw -= screen->getTabWidth();
break;
case Tab::PBottom:
dh -= screen->getTabHeight() + screen->getBorderWidth();
dh -= screen->getTabHeight();
break;
default:
dy += screen->getTabHeight();
dh -= screen->getTabHeight() + screen->getBorderWidth();
dh -= screen->getTabHeight();
break;
}
}
@ -2365,13 +2365,11 @@ void FluxboxWindow::redrawLabel(void) {
GC gc = ((focused) ? screen->getWindowStyle()->l_text_focus_gc :
screen->getWindowStyle()->l_text_unfocus_gc);
Misc::DrawString(display, frame.label, gc,
&screen->getWindowStyle()->font,
client.title_text_w, frame.label_w,
frame.bevel_w, client.title);
}
@ -2587,8 +2585,27 @@ void FluxboxWindow::propertyNotifyEvent(Atom atom) {
if (decorations.titlebar)
redrawLabel();
if (hasTab()) // update tab
getTab()->draw(false);
if (! iconic)
screen->getWorkspace(workspace_number)->update();
else if (Fluxbox::instance()->useIconBar()) {
IconBar *iconbar = 0;
IconBarObj *icon = 0;
if ((iconbar = screen->getToolbar()->getIconBar()) != 0) {
if ((icon = iconbar->findIcon(this)) != 0)
iconbar->draw(icon, icon->getWidth());
#ifdef DEBUG
else
cerr<<__FILE__<<"("<<__LINE__<<"): can't find icon!"<<endl;
#endif //DEBUG
}
#ifdef DEBUG
else
cerr<<__FILE__<<"("<<__LINE__<<"): can't find iconbar!"<<endl;
#endif //DEBUG
}
break;
@ -2762,7 +2779,7 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
}
} else if (be->button == 2 && be->window == frame.label) {
screen->getWorkspace(workspace_number)->lowerWindow(this);
} else if (windowmenu && be->button == 3 &&
(frame.title == be->window || frame.label == be->window ||
frame.handle == be->window)) {

View file

@ -24,7 +24,6 @@
// forward declaration
class Workspacemenu;
class Toolbar;
#include "Basemenu.hh"

View file

@ -1027,24 +1027,12 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) {
focused_window->stick();
break;
case Keys::VERTMAX:
//!!TODO: fix this
if (focused_window->isResizable()) {
int w = focused_window->getWidth();
int x = focused_window->getXFrame();
int y = focused_window->getYFrame();
focused_window->maximize(0);
focused_window->configure(x, y, w, focused_window->getHeight());
}
if (focused_window->isResizable())
focused_window->maximize(3); // maximize vertically, done with mouse3
break;
case Keys::HORIZMAX:
//!!TODO: fix this
if (focused_window->isResizable()) {
int h = focused_window->getHeight();
int x = focused_window->getXFrame();
int y = focused_window->getYFrame();
focused_window->maximize(0);
focused_window->configure(x, y, focused_window->getWidth(), h);
}
if (focused_window->isResizable())
focused_window->maximize(2); // maximize horisontally, done with mouse2
break;
case Keys::NUDGERIGHT:
focused_window->configure(
@ -1616,6 +1604,10 @@ void Fluxbox::save_rc(void) {
((screen->isTabRotateVertical()) ? "True" : "False"));
XrmPutLineResource(&new_blackboxrc, rc_string);
sprintf(rc_string, "session.screen%d.sloppywindowgrouping: %s", screen_number,
((screen->isSloppyWindowGrouping()) ? "True" : "False"));
XrmPutLineResource(&new_blackboxrc, rc_string);
load_rc(screen);
// these are static, but may not be saved in the users resource file,
@ -2349,6 +2341,17 @@ void Fluxbox::load_rc(BScreen *screen) {
} else
screen->saveTabRotateVertical(False);
sprintf(name_lookup, "session.screen%d.sloppywindowgrouping", screen_number);
sprintf(class_lookup, "Session.Screen%d.SloppyWindowGrouping", screen_number);
if (XrmGetResource(database, name_lookup, class_lookup,
&value_type, &value)) {
if (! strncasecmp("true", value.addr, value.size))
screen->saveSloppyWindowGrouping(True);
else
screen->saveSloppyWindowGrouping(False);
} else
screen->saveSloppyWindowGrouping(False);
}