all repos — fluxbox @ 06d696f99b276e3394aec10f52c206aec4697c76

custom fork of the fluxbox windowmanager

fix some consts and private functions
Mark Tiefenbruck mark@fluxbox.org
commit

06d696f99b276e3394aec10f52c206aec4697c76

parent

4093d2641f371bb8e80616a4c51dea9af508dac2

2 files changed, 21 insertions(+), 30 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -874,7 +874,6 @@

updateClientLeftWindow(); } -//list<*WinClient>::iterator FluxboxWindow::getClientInsertPosition(int x, int y) { FluxboxWindow::ClientList::iterator FluxboxWindow::getClientInsertPosition(int x, int y) { int dest_x = 0, dest_y = 0;

@@ -1261,25 +1260,18 @@ }

} -void FluxboxWindow::maxSize(unsigned int &max_width, unsigned int &max_height) { +void FluxboxWindow::maxSize(unsigned int &width, unsigned int &height) const { ClientList::const_iterator it = clientList().begin(); ClientList::const_iterator it_end = clientList().end(); - max_width = (unsigned int) ~0; // unlimited - max_height = (unsigned int) ~0; // unlimited + width = height = 0; // unlimited for (; it != it_end; ++it) { // special case for max height/width == 0 // 0 indicates unlimited size, so we skip them - // and set max size to 0 if max size == ~0 after the loop - if ((*it)->maxHeight() != 0) - max_height = std::min( (*it)->maxHeight(), max_height ); - if ((*it)->maxWidth() != 0) - max_width = std::min( (*it)->maxWidth(), max_width ); + if (!height || (*it)->maxHeight() && height > (*it)->maxHeight()) + height = (*it)->maxHeight(); + if (!width || (*it)->maxWidth() && width > (*it)->maxWidth()) + width = (*it)->maxWidth(); } - - if (max_width == (unsigned int) ~0) - max_width = 0; - if (max_height == (unsigned int) ~0) - max_height = 0; } // returns whether the focus was "set" to this window

@@ -2597,7 +2589,7 @@ // otherwise, make a note that the user is typing

gettimeofday(&m_last_keypress_time, 0); } -bool FluxboxWindow::isTyping() { +bool FluxboxWindow::isTyping() const { timeval now; if (gettimeofday(&now, NULL) == -1) return false;

@@ -3345,7 +3337,7 @@

} FluxboxWindow::ResizeDirection FluxboxWindow::getResizeDirection(int x, int y, - ResizeModel model) { + ResizeModel model) const { int cx = frame().width() / 2; int cy = frame().height() / 2; if (model == CENTERRESIZE)
M src/Window.hhsrc/Window.hh

@@ -199,14 +199,6 @@ * @param y position

*/ void moveClientTo(WinClient &win, int x, int y); /** - * Calculates insertition position in the list by - * using pixel position x and y. - * @param x position - * @param y position - * @return iterator position for insertion - */ - ClientList::iterator getClientInsertPosition(int x, int y); - /** * Take focus. * @see Focusable * @return true if it took focus.

@@ -313,7 +305,7 @@ * Determines maximum size using all clients that this window can have.

* @param width will be filled in with maximum width * @param height will be filled in with maximum height */ - void maxSize(unsigned int &width, unsigned int &height); + void maxSize(unsigned int &width, unsigned int &height) const; void setWorkspace(int n); void updateFunctions(); void restoreAttributes();

@@ -381,7 +373,7 @@ * @param dir the resize direction

*/ void startResizing(int x, int y, ResizeDirection dir); /// determine which edge or corner to resize - ResizeDirection getResizeDirection(int x, int y, ResizeModel model); + ResizeDirection getResizeDirection(int x, int y, ResizeModel model) const; /// stops the resizing void stopResizing(bool interrupted = false); /// starts tabbing

@@ -395,7 +387,7 @@

// whether this window can be tabbed with other windows, // and others tabbed with it void setTabable(bool tabable) { functions.tabable = tabable; } - bool isTabable() { return functions.tabable; } + bool isTabable() const { return functions.tabable; } void setMovable(bool movable) { functions.move = movable; } void setResizable(bool resizable) { functions.resize = resizable; }

@@ -403,9 +395,7 @@ bool isFocusHidden() const { return m_focus_hidden; }

bool isIconHidden() const { return m_icon_hidden; } bool isManaged() const { return m_initialized; } bool isVisible() const; - bool isIconic() { return iconic; } bool isIconic() const { return iconic; } - bool isShaded() { return shaded; } bool isShaded() const { return shaded; } bool isFullscreen() const { return fullscreen; } bool isMaximized() const { return maximized == MAX_FULL; }

@@ -429,7 +419,7 @@ const ClientList &clientList() const { return m_clientlist; }

WinClient &winClient() { return *m_client; } const WinClient &winClient() const { return *m_client; } - bool isTyping(); + bool isTyping() const; const FbTk::XLayerItem &layerItem() const { return m_frame.layerItem(); } FbTk::XLayerItem &layerItem() { return m_frame.layerItem(); }

@@ -522,6 +512,15 @@

void init(); void updateClientLeftWindow(); void grabButtons(); + + /** + * Calculates insertition position in the list by + * using pixel position x and y. + * @param x position + * @param y position + * @return iterator position for insertion + */ + ClientList::iterator getClientInsertPosition(int x, int y); /// try to attach current attaching client to a window at pos x, y void attachTo(int x, int y, bool interrupted = false);