diff --git a/README.md b/README.md
index c74a5d4..beb037e 100644
--- a/README.md
+++ b/README.md
@@ -6,20 +6,32 @@
![Screenshots](https://github.com/zakariakov/qobbar/blob/master/example/qobbar1.png)
+
+
+
+
+
+
+qobbar is a status bar based on Qt5, X11 and libGl. As a status indicating panel
+with menu control, the package of this desktop environment application is to be seen
+as not yet fully functional, as it is a work in progress. Certain features or
+components of it work sufficiently but should still be improved, others remain
+to be completed or augmented.
### Dependencies
- libX11
- libXcomposite
- libXdamage
-- libQt5X11Extras
-- libQt5Widgets
-- libQt5Gui
-- libQt5Concurrent
-- libQt5DBus
-- libQt5Core
+- libQt5X11Extras (its version has to be in accordance with Qt v5.10.0 or newer)
+- libQt5Widgets (its version has to be in accordance with Qt v5.10.0 or newer)
+- libQt5Gui (its version has to be in accordance with Qt v5.10.0 or newer)
+- libQt5Concurrent (its version has to be in accordance with Qt v5.10.0 or newer)
+- libQt5DBus (its version has to be in accordance with Qt v5.10.0 or newer)
+- libQt5Core (its version has to be in accordance with Qt v5.10.0 or newer)
- libGL
- libpthread
+- libstdc++
### Building from source
@@ -41,7 +53,7 @@
The default UserScope paths "$HOME/.config/qobbar/qobbar.conf"
- to create user configuration
+ to create a user configuration
~~~ sh
$ mkdir -p "$HOME/.config/qobbar"
@@ -50,7 +62,9 @@
or create any configuration file in "$HOME/.config/qobbar"
- the suffix ".conf" is obligatoire ex;"myconf.conf"
+ from the name of the configuration file the suffix ".conf"
+
+ is obligatory; for example "myconf.conf" would be allright.
### Running the app
@@ -66,9 +80,9 @@
" -r --right right-to-left layout direction."
~~~
-to run the default configuration just run "qobbar".
+To run the default configuration, just run "qobbar"
-or cp any configuration in the example folder to $HOME/.config/qobbar.
+or cp any configuration in the example folder to $HOME/.config/qobbar
to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
@@ -107,19 +121,15 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
~~~ sh
- Top panel top or bottom default=true
- BorderColor color Hex or xrdb.color
-- BarLeft Ex:statu1,statu2
-- BarCenter Ex:Time,Date
-- BarRight Ex:Pager
+- BarLeft Ex:Systray,statu1,statu2
+- BarCenter Ex:Time,Date
+- BarRight Ex:Pager
- BarLeftSpacing default=0
- BarRightSpacing default=0
- BarCenterSpacing default=0
-- MarginLeft default=0
-- MarginTop default=0
-- MarginRight default=0
-- MarginBottom default=0
-- Systray default=false
+- Systray default=false
- -----padding has no effect in tilling i3wm -----
+ -----padding has no effect in tiling WM -----
- PaddingBottom default=0
- PaddingLeft default=0
- PaddingRight default=0
@@ -132,7 +142,7 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
~~~ sh
- ActiveBackground default window highlight
-- ActiveAlpha 0-to-255 default=255
+- ActiveAlpha 0-to-255 default=255
- ActiveForeground default window highlightText
- ActiveUnderline color Hex or xrdb.color
- ActiveOverline color Hex or xrdb.color
@@ -142,19 +152,18 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
~~~ sh
- DesktopDesplay "name" "index" "icon" default=index
- icon-[0-9] ex: home,office,multimedia,
+ icon-[0-9] ex: home,office,multimedia,
NOTE: The desktop name needs to match the name configured by the WM
- You can get a list of the defined desktops using:
+ You can get a list of the defined desktops using:
$ xprop -root _NET_DESKTOP_NAMES
- IconsList list of icon 0 to 9
-- ActiveIcon if DesktopDesplay==icon default=NULL
~~~
#### Status
~~~ sh
-- Command Command to desplay
+- Command Command to display
- Interval second default 1
- MaxSize default 100
- Label
@@ -164,6 +173,7 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
- ClickRight Command to exec
- MouseWheelUp Command to exec
- MouseWheelDown Command to exec
+- ActiveIcon if DesktopDesplay==icon default=NULL
~~~
@@ -184,8 +194,7 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
ActiveForeground=#ffffff
ActiveOverline=#ffff00
DesktopDesplay="icon"
- IconsList=,,,,,,
- ActiveIcon=
+ IconsList=,,,
Foreground=#8A8383
Border=1
ActiveAlpha=0
@@ -225,5 +234,3 @@ to run any configuration ex: top-bar.conf run "qobbar -c top-bar".
NOTE : to use this qobmenu [**@zakariakov**](https://github.com/zakariakov/qobmenu)
or jgmenu (https://github.com/johanmalm/jgmenu)
-
-
diff --git a/utils/x11utills.cpp b/utils/x11utills.cpp
index e24ac6f..6f19403 100755
--- a/utils/x11utills.cpp
+++ b/utils/x11utills.cpp
@@ -1,12 +1,15 @@
#include "x11utills.h"
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
// Keep all the X11 stuff with scary defines below normal headers.
-#include
#include
#include
@@ -148,7 +151,7 @@ bool X11UTILLS::isWindowForTaskbar(Window window)
// Let's expect that _KDE_NET_WM_WINDOW_TYPE_OVERRIDE can be set for
// regular windows too. If it should be hidden we should expect
// one of atoms listed above.
-// << atom("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");
+ // << atom("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE");
foreach (Atom i, ignoreList)
{
@@ -240,27 +243,38 @@ bool X11UTILLS::getClientIcon(Window _wid, QPixmap& _pixreturn)
XGetWindowProperty(QX11Info::display(), _wid, atom("_NET_WM_ICON"),
0, LONG_MAX, False, AnyPropertyType,
&type, &format, &nitems, &extra,
- (uchar**)&data);
+ (unsigned char**) &data);
if (!data)
{
return false;
}
-
+ else
+ {
QImage img (data[0], data[1], QImage::Format_ARGB32);
-
- //TODO FIX deprecated
- //img.sizeInBytes()
+ //
+ // Fixed: Here is the old code, not using the new img.sizeInBytes() :
+ //
// for (int i=0; i(ssize_t(img.sizeInBytes())))/4; ++i)
((uint*)img.bits())[i] = data[i+2];
- _pixreturn = QPixmap::fromImage(img);
- XFree(data);
-
+ _pixreturn = (QPixmap::fromImage(img));
+ XFree(data);
+ }
return true;
+ }
}
@@ -582,7 +596,7 @@ void X11UTILLS::setWindowLayer(unsigned long _wid, int layer)
2);
}
-//alowed
+//allowed
QHash X11UTILLS::states(unsigned long window)
@@ -612,7 +626,7 @@ QHashhash;
}
- XFree(data);
+ XFree(data);
}
return hash;
@@ -648,12 +662,12 @@ QHash X11UTILLS::allowed(unsigned long window)
return hash;
}
-/************************************************
- The Window Manager MUST set this property on the root window to be the ID of a child
- window created by himself, to indicate that a compliant window manager is active.
-
- http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2550836
- ************************************************/
+//************************************************
+// The Window Manager MUST set this property on the root window to be the ID of a child
+// window created by himself, to indicate that a compliant window manager is active.
+//
+// http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#id2550836
+//************************************************
bool X11UTILLS::isWindowManagerActive()
{
@@ -687,7 +701,7 @@ QRect rect;
XSizeHints hints;
int rx, ry;
- // QHashhash;
+// QHashhash;
Window junkwin;
XWindowAttributes win_attributes;
if (!XGetWindowAttributes(QX11Info::display(), window, &win_attributes)){
@@ -723,7 +737,7 @@ QRect rect;
/* WM reparented, so find edges of the frame */
/* Only works for ICCCM-compliant WMs, and then only if the
window has corner gravity. We would need to know the original width
- of the window to correctly handle the other gravities. */
+ of the window to correctly handle the other gravities. */
XWindowAttributes frame_attr;