minor fix
fluxgen fluxgen
2 files changed,
13 insertions(+),
5 deletions(-)
M
src/FbTk/FbWindow.cc
→
src/FbTk/FbWindow.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: FbWindow.cc,v 1.15 2003/05/10 13:26:37 fluxgen Exp $ +// $Id: FbWindow.cc,v 1.16 2003/05/10 23:11:33 fluxgen Exp $ #include "FbWindow.hh" #include "EventManager.hh"@@ -71,7 +71,8 @@ };
FbWindow::FbWindow(Window client):m_parent(0), m_window(0), m_destroy(false) { // don't destroy this window - *this = client; + + setNew(client); } FbWindow::~FbWindow() {@@ -114,6 +115,11 @@ XClearWindow(s_display, m_window);
} FbWindow &FbWindow::operator = (Window win) { + setNew(win); + return *this; +} + +void FbWindow::setNew(Window win) { if (m_window != 0 && m_destroy) XDestroyWindow(s_display, m_window); m_window = win;@@ -127,8 +133,7 @@ m_window,
&attr) != 0 && attr.screen != 0) { m_screen_num = XScreenNumberOfScreen(attr.screen); } - } - return *this; + } } void FbWindow::show() {
M
src/FbTk/FbWindow.hh
→
src/FbTk/FbWindow.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: FbWindow.hh,v 1.13 2003/05/10 13:24:59 fluxgen Exp $ +// $Id: FbWindow.hh,v 1.14 2003/05/10 23:11:08 fluxgen Exp $ #ifndef FBTK_FBWINDOW_HH #define FBTK_FBWINDOW_HH@@ -110,6 +110,9 @@ /// creates a window with x window client (m_window = client)
explicit FbWindow(Window client); private: + // sets new window and destroys old + void setNew(Window win); + void updateGeometry(); void create(Window parent, int x, int y, unsigned int width, unsigned int height, long eventmask,