aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaX11.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-10-28 16:05:04 -0400
committerKen Moore <moorekou@gmail.com>2015-10-28 16:05:04 -0400
commiteb47ffab6182cba7330b3abb079819d0a6ec18c6 (patch)
treed071558114edb26da91565577d644fb4926fe604 /libLumina/LuminaX11.cpp
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-eb47ffab6182cba7330b3abb079819d0a6ec18c6.tar.gz
lumina-eb47ffab6182cba7330b3abb079819d0a6ec18c6.tar.bz2
lumina-eb47ffab6182cba7330b3abb079819d0a6ec18c6.zip
Add new X11 functions for about 1/2 of the ICCCM standards
Diffstat (limited to 'libLumina/LuminaX11.cpp')
-rw-r--r--libLumina/LuminaX11.cpp80
1 files changed, 79 insertions, 1 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 392d22db..57455f16 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -1080,4 +1080,82 @@ void LXCB::closeSystemTray(WId trayID){
void LXCB::WM_CloseWindow(WId win){
xcb_destroy_window(QX11Info::connection(), win);
}
-
+
+// --------------------------------------------------
+// ICCCM Standards (older standards)
+// --------------------------------------------------
+// -- WM_NAME
+QString LXCB::WM_ICCCM_GetName(WId win){
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_name_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_text_property_reply_t reply;
+ if(1 != xcb_icccm_get_wm_name_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ return ""; //error in fetching name
+ }else{
+ return QString::fromLocal8Bit(reply.name);
+ }
+}
+
+void LXCB::WM_ICCCM_SetName(WId win, QString name){
+ xcb_icccm_set_wm_name(QX11Info::connection(), win, XCB_ATOM_STRING, 8, name.length(), name.toLocal8Bit());
+}
+
+// -- WM_ICON_NAME
+QString LXCB::WM_ICCCM_GetIconName(WId win){
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_icon_name_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_text_property_reply_t reply;
+ if(1 != xcb_icccm_get_wm_icon_name_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ return ""; //error in fetching name
+ }else{
+ return QString::fromLocal8Bit(reply.name);
+ }
+}
+
+void LXCB::WM_ICCCM_SetIconName(WId win, QString name){
+ xcb_icccm_set_wm_icon_name(QX11Info::connection(), win, XCB_ATOM_STRING, 8, name.length(), name.toLocal8Bit());
+}
+
+// -- WM_CLIENT_MACHINE
+QString LXCB::WM_ICCCM_GetClientMachine(WId win){
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_client_machine_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_text_property_reply_t reply;
+ if(1 != xcb_icccm_get_wm_client_machine_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ return ""; //error in fetching name
+ }else{
+ return QString::fromLocal8Bit(reply.name);
+ }
+}
+
+void LXCB::WM_ICCCM_SetClientMachine(WId win, QString name){
+ xcb_icccm_set_wm_client_machine(QX11Info::connection(), win, XCB_ATOM_STRING, 8, name.length(), name.toLocal8Bit());
+}
+
+// -- WM_CLASS
+QString LXCB::WM_ICCCM_GetClass(WId win){
+ xcb_get_property_cookie_t cookie = xcb_icccm_get_wm_class_unchecked(QX11Info::connection(), win);
+ xcb_icccm_get_wm_class_reply_t reply;
+ if(1 != xcb_icccm_get_wm_class_reply(QX11Info::connection(), cookie, &reply, NULL) ){
+ return ""; //error in fetching name
+ }else{
+ //Returns: "<instance name>::::<class name>"
+ return ( QString::fromLocal8Bit(reply.instance_name)+"::::"+QString::fromLocal8Bit(reply.class_name) );
+ }
+}
+
+void LXCB::WM_ICCCM_SetClass(WId win, QString name){
+ xcb_icccm_set_wm_class(QX11Info::connection(), win, name.length(), name.toLocal8Bit());
+}
+
+// --------------------------------------------------------
+// NET_WM Standards (newer standards)
+// --------------------------------------------------------
+void LXCB::WM_Set_Root_Supported(){
+ //NET_WM standards (ICCCM implied - no standard way to list those)
+ xcb_atom_t list[] = {};
+ xcb_ewmh_set_supported(&EWMH, QX11Info::appScreen(), 0,list);
+}
+
+void LXCB::WM_Set_Window_Supported(WId win){
+ //NET_WM standards (ICCCM implied - no standard way to list those)
+ xcb_atom_t list[] = {};
+ xcb_ewmh_set_wm_allowed_actions(&EWMH, win, 0, list);
+} \ No newline at end of file
bgstack15