aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
commit690d926ac444243611cd875fb84fabb4e6db2cf2 (patch)
treec8ef84056b295071f9a9207ffea5393c6cf4ad4d /src/Window.cc
parent1e8fe2bc14856fa16508686a28a85e72cb0e422c (diff)
downloadfluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.zip
fluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.tar.bz2
introduced FbTk::BidiString
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/Window.cc b/src/Window.cc
index b30a849..5f64705 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -329,7 +329,7 @@ FluxboxWindow::~FluxboxWindow() {
329 } 329 }
330 330
331 331
332 const char* title = m_client ? m_client->title().c_str() : "" ; 332 const char* title = m_client ? m_client->title().logical().c_str() : "" ;
333 fbdbg<<"starting ~FluxboxWindow("<<this<<","<<title<<")"<<endl; 333 fbdbg<<"starting ~FluxboxWindow("<<this<<","<<title<<")"<<endl;
334 fbdbg<<"num clients = "<<numClients()<<endl; 334 fbdbg<<"num clients = "<<numClients()<<endl;
335 fbdbg<<"curr client = "<<m_client<<endl; 335 fbdbg<<"curr client = "<<m_client<<endl;
@@ -487,11 +487,11 @@ void FluxboxWindow::init() {
487 } else // if no parent then set default layer 487 } else // if no parent then set default layer
488 moveToLayer(m_state.layernum, m_state.layernum != ::Layer::NORMAL); 488 moveToLayer(m_state.layernum, m_state.layernum != ::Layer::NORMAL);
489 489
490 fbdbg<<"FluxboxWindow::init("<<title()<<") transientFor: "<< 490 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<<
491 m_client->transientFor()<<endl; 491 m_client->transientFor()<<endl;
492 if (m_client->transientFor() && m_client->transientFor()->fbwindow()) { 492 if (m_client->transientFor() && m_client->transientFor()->fbwindow()) {
493 fbdbg<<"FluxboxWindow::init("<<title()<<") transientFor->title(): "<< 493 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor->title(): "<<
494 m_client->transientFor()->fbwindow()->title()<<endl; 494 m_client->transientFor()->fbwindow()->title().logical()<<endl;
495 } 495 }
496 496
497 497
@@ -976,7 +976,7 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
976 button<<endl; 976 button<<endl;
977 977
978 if (old != &client) { 978 if (old != &client) {
979 titleSig().emit(title(), *this); 979 titleSig().emit(title().logical(), *this);
980 frame().setFocusTitle(title()); 980 frame().setFocusTitle(title());
981 frame().setShapingClient(&client, false); 981 frame().setShapingClient(&client, false);
982 } 982 }
@@ -1627,7 +1627,7 @@ void FluxboxWindow::raise() {
1627 if (isIconic()) 1627 if (isIconic())
1628 return; 1628 return;
1629 1629
1630 fbdbg<<"FluxboxWindow("<<title()<<")::raise()[layer="<<layerNum()<<"]"<<endl; 1630 fbdbg<<"FluxboxWindow("<<title().logical()<<")::raise()[layer="<<layerNum()<<"]"<<endl;
1631 1631
1632 // get root window 1632 // get root window
1633 WinClient *client = getRootTransientFor(m_client); 1633 WinClient *client = getRootTransientFor(m_client);
@@ -1655,7 +1655,7 @@ void FluxboxWindow::lower() {
1655 if (isIconic()) 1655 if (isIconic())
1656 return; 1656 return;
1657 1657
1658 fbdbg<<"FluxboxWindow("<<title()<<")::lower()"<<endl; 1658 fbdbg<<"FluxboxWindow("<<title().logical()<<")::lower()"<<endl;
1659 1659
1660 /* Ignore all EnterNotify events until the pointer actually moves */ 1660 /* Ignore all EnterNotify events until the pointer actually moves */
1661 screen().focusControl().ignoreAtPointer(); 1661 screen().focusControl().ignoreAtPointer();
@@ -1686,7 +1686,7 @@ void FluxboxWindow::changeLayer(int diff) {
1686 1686
1687void FluxboxWindow::moveToLayer(int layernum, bool force) { 1687void FluxboxWindow::moveToLayer(int layernum, bool force) {
1688 1688
1689 fbdbg<<"FluxboxWindow("<<title()<<")::moveToLayer("<<layernum<<")"<<endl; 1689 fbdbg<<"FluxboxWindow("<<title().logical()<<")::moveToLayer("<<layernum<<")"<<endl;
1690 1690
1691 // don't let it set its layer into menu area 1691 // don't let it set its layer into menu area
1692 if (layernum <= ::Layer::MENU) 1692 if (layernum <= ::Layer::MENU)
@@ -1751,7 +1751,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1751 bool was_focused = isFocused(); 1751 bool was_focused = isFocused();
1752 m_focused = focus; 1752 m_focused = focus;
1753 1753
1754 fbdbg<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl; 1754 fbdbg<<"FluxboxWindow("<<title().logical()<<")::setFocusFlag("<<focus<<")"<<endl;
1755 1755
1756 1756
1757 installColormap(focus); 1757 installColormap(focus);
@@ -1942,7 +1942,7 @@ void FluxboxWindow::popupMenu() {
1942void FluxboxWindow::handleEvent(XEvent &event) { 1942void FluxboxWindow::handleEvent(XEvent &event) {
1943 switch (event.type) { 1943 switch (event.type) {
1944 case ConfigureRequest: 1944 case ConfigureRequest:
1945 fbdbg<<"ConfigureRequest("<<title()<<")"<<endl; 1945 fbdbg<<"ConfigureRequest("<<title().logical()<<")"<<endl;
1946 1946
1947 configureRequestEvent(event.xconfigurerequest); 1947 configureRequestEvent(event.xconfigurerequest);
1948 break; 1948 break;
@@ -1957,7 +1957,7 @@ void FluxboxWindow::handleEvent(XEvent &event) {
1957 1957
1958#ifdef DEBUG 1958#ifdef DEBUG
1959 char *atomname = XGetAtomName(display, event.xproperty.atom); 1959 char *atomname = XGetAtomName(display, event.xproperty.atom);
1960 fbdbg<<"PropertyNotify("<<title()<<"), property = "<<atomname<<endl; 1960 fbdbg<<"PropertyNotify("<<title().logical()<<"), property = "<<atomname<<endl;
1961 if (atomname) 1961 if (atomname)
1962 XFree(atomname); 1962 XFree(atomname);
1963#endif // DEBUG 1963#endif // DEBUG
@@ -1973,7 +1973,7 @@ void FluxboxWindow::handleEvent(XEvent &event) {
1973 if (Fluxbox::instance()->haveShape() && 1973 if (Fluxbox::instance()->haveShape() &&
1974 event.type == Fluxbox::instance()->shapeEventbase() + ShapeNotify) { 1974 event.type == Fluxbox::instance()->shapeEventbase() + ShapeNotify) {
1975 1975
1976 fbdbg<<"ShapeNotify("<<title()<<")"<<endl; 1976 fbdbg<<"ShapeNotify("<<title().logical()<<")"<<endl;
1977 1977
1978 XShapeEvent *shape_event = (XShapeEvent *)&event; 1978 XShapeEvent *shape_event = (XShapeEvent *)&event;
1979 1979
@@ -2068,7 +2068,7 @@ void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) {
2068 2068
2069 2069
2070 fbdbg<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl; 2070 fbdbg<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl;
2071 fbdbg<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl; 2071 fbdbg<<"("<<__FUNCTION__<<"): title="<<client->title().logical()<<endl;
2072 2072
2073 restore(client, false); 2073 restore(client, false);
2074 2074
@@ -2081,7 +2081,7 @@ void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) {
2081*/ 2081*/
2082void FluxboxWindow::destroyNotifyEvent(XDestroyWindowEvent &de) { 2082void FluxboxWindow::destroyNotifyEvent(XDestroyWindowEvent &de) {
2083 if (de.window == m_client->window()) { 2083 if (de.window == m_client->window()) {
2084 fbdbg<<"DestroyNotifyEvent this="<<this<<" title = "<<title()<<endl; 2084 fbdbg<<"DestroyNotifyEvent this="<<this<<" title = "<<title().logical()<<endl;
2085 delete m_client; 2085 delete m_client;
2086 if (numClients() == 0) 2086 if (numClients() == 0)
2087 delete this; 2087 delete this;
@@ -2109,7 +2109,7 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2109 2109
2110 case XA_WM_HINTS: 2110 case XA_WM_HINTS:
2111 client.updateWMHints(); 2111 client.updateWMHints();
2112 titleSig().emit(title(), *this); 2112 titleSig().emit(title().logical(), *this);
2113 // nothing uses this yet 2113 // nothing uses this yet
2114 // hintSig().notify(); // notify listeners 2114 // hintSig().notify(); // notify listeners
2115 break; 2115 break;
@@ -2123,7 +2123,7 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2123 break; 2123 break;
2124 2124
2125 case XA_WM_NORMAL_HINTS: { 2125 case XA_WM_NORMAL_HINTS: {
2126 fbdbg<<"XA_WM_NORMAL_HINTS("<<title()<<")"<<endl; 2126 fbdbg<<"XA_WM_NORMAL_HINTS("<<title().logical()<<")"<<endl;
2127 unsigned int old_max_width = client.maxWidth(); 2127 unsigned int old_max_width = client.maxWidth();
2128 unsigned int old_min_width = client.minWidth(); 2128 unsigned int old_min_width = client.minWidth();
2129 unsigned int old_min_height = client.minHeight(); 2129 unsigned int old_min_height = client.minHeight();
@@ -3347,19 +3347,19 @@ Window FluxboxWindow::clientWindow() const {
3347} 3347}
3348 3348
3349 3349
3350const string &FluxboxWindow::title() const { 3350const FbTk::BiDiString& FluxboxWindow::title() const {
3351 return (m_client ? m_client->title() : m_title); 3351 return (m_client ? m_client->title() : m_title);
3352} 3352}
3353 3353
3354const std::string &FluxboxWindow::getWMClassName() const { 3354const FbTk::FbString& FluxboxWindow::getWMClassName() const {
3355 return (m_client ? m_client->getWMClassName() : getWMClassName()); 3355 return (m_client ? m_client->getWMClassName() : getWMClassName());
3356} 3356}
3357 3357
3358const std::string &FluxboxWindow::getWMClassClass() const { 3358const FbTk::FbString& FluxboxWindow::getWMClassClass() const {
3359 return (m_client ? m_client->getWMClassClass() : getWMClassClass()); 3359 return (m_client ? m_client->getWMClassClass() : getWMClassClass());
3360} 3360}
3361 3361
3362std::string FluxboxWindow::getWMRole() const { 3362FbTk::FbString FluxboxWindow::getWMRole() const {
3363 return (m_client ? m_client->getWMRole() : "FluxboxWindow"); 3363 return (m_client ? m_client->getWMRole() : "FluxboxWindow");
3364} 3364}
3365 3365