29 #include <kuniqueapplication.h>
32 #include <tqwhatsthis.h>
33 #include <tqcstring.h>
38 #include "tdeapplication.h"
40 #include <tdeglobal.h>
41 #include <kiconloader.h>
44 #include <kdatastream.h>
46 #include <dcopclient.h>
49 #include <tdestartupinfo.h>
50 #include <kxerrorhandler.h>
53 #include <X11/Xatom.h>
54 #include <X11/Xutil.h>
58 static bool atoms_created =
false;
59 extern Atom tqt_wm_protocols;
61 static Atom net_wm_context_help;
62 static Atom kde_wm_change_state;
63 static Atom kde_wm_window_opacity;
64 static Atom kde_wm_window_shadow;
65 static Atom twin_UTF8_STRING;
66 static Atom net_wm_cm;
68 static void twin_net_create_atoms() {
72 const char* names[max];
73 Atom atoms_return[max];
76 atoms[n] = &net_wm_context_help;
77 names[n++] =
"_NET_WM_CONTEXT_HELP";
79 atoms[n] = &kde_wm_change_state;
80 names[n++] =
"_TDE_WM_CHANGE_STATE";
82 atoms[n] = &kde_wm_window_opacity;
83 names[n++] = (
char*)
"_TDE_WM_WINDOW_OPACITY";
85 atoms[n] = &kde_wm_window_shadow;
86 names[n++] = (
char*)
"_TDE_WM_WINDOW_SHADOW";
88 char net_wm_cm_name[ 100 ];
89 sprintf( net_wm_cm_name,
"_NET_WM_CM_S%d", DefaultScreen( tqt_xdisplay()));
90 atoms[n] = &net_wm_cm;
91 names[n++] = net_wm_cm_name;
94 XInternAtoms( tqt_xdisplay(), const_cast<char**>(names), n,
false, atoms_return );
95 for (
int i = 0; i < n; i++ )
96 *atoms[i] = atoms_return[i];
107 static void sendClientMessageToRoot(Window w, Atom a,
long x,
long y = 0,
long z = 0 ){
111 memset(&ev, 0,
sizeof(ev));
112 ev.xclient.type = ClientMessage;
113 ev.xclient.window = w;
114 ev.xclient.message_type = a;
115 ev.xclient.format = 32;
116 ev.xclient.data.l[0] = x;
117 ev.xclient.data.l[1] = y;
118 ev.xclient.data.l[2] = z;
119 mask = SubstructureRedirectMask;
120 XSendEvent(tqt_xdisplay(), tqt_xrootwin(), False, mask, &ev);
128 static void sendClientMessage(Window w, Atom a,
long x){
132 memset(&ev, 0,
sizeof(ev));
133 ev.xclient.type = ClientMessage;
134 ev.xclient.window = w;
135 ev.xclient.message_type = a;
136 ev.xclient.format = 32;
137 ev.xclient.data.l[0] = x;
138 ev.xclient.data.l[1] = CurrentTime;
140 if (w == tqt_xrootwin())
141 mask = SubstructureRedirectMask;
142 XSendEvent(tqt_xdisplay(), w, False, mask, &ev);
149 twin_net_create_atoms();
150 return XGetSelectionOwner( tqt_xdisplay(), net_wm_cm ) != None;
159 class ContextWidget :
public TQWidget
163 virtual bool x11Event( XEvent * ev);
166 ContextWidget::ContextWidget()
169 twin_net_create_atoms();
170 kapp->installX11EventFilter(
this );
171 TQWhatsThis::enterWhatsThisMode();
172 TQCursor c = *TQApplication::overrideCursor();
173 TQWhatsThis::leaveWhatsThisMode();
174 XGrabPointer( tqt_xdisplay(), tqt_xrootwin(),
true,
175 (uint)( ButtonPressMask | ButtonReleaseMask |
176 PointerMotionMask | EnterWindowMask |
178 GrabModeAsync, GrabModeAsync,
179 None, c.handle(), CurrentTime );
184 bool ContextWidget::x11Event( XEvent * ev)
186 if ( ev->type == ButtonPress && ev->xbutton.button == Button1 ) {
187 XUngrabPointer( tqt_xdisplay(), ev->xbutton.time );
189 Window child = tqt_xrootwin();
190 int root_x, root_y, lx, ly;
195 XQueryPointer( tqt_xdisplay(), w, &root, &child,
196 &root_x, &root_y, &lx, &ly, &state );
197 }
while ( child != None && child != w );
199 ::sendClientMessage(w, tqt_wm_protocols, net_wm_context_help);
201 e.xbutton.window = w;
202 e.xbutton.subwindow = w;
205 XSendEvent( tqt_xdisplay(), w,
true, ButtonPressMask, &e );
224 NETWinInfo
info( tqt_xdisplay(), trayWin, tqt_xrootwin(), 0 );
226 forWin = tqt_xrootwin();
227 info.setKDESystemTrayWinFor( forWin );
228 NETRootInfo rootinfo( tqt_xdisplay(), NET::Supported );
229 if( !rootinfo.isSupported( NET::WMKDESystemTrayWinFor )) {
231 if( !ref.
send(
"loadModule", TQCString(
"kdetrayproxy" )))
232 kdWarning( 176 ) <<
"Loading of kdetrayproxy failed." <<
endl;
240 NETRootInfo
info( tqt_xdisplay(), 0 );
242 time = GET_QT_X_USER_TIME();
243 info.setActiveWindow( win, NET::FromApplication, time,
244 kapp->activeWindow() ? kapp->activeWindow()->winId() : 0 );
245 #endif // Q_WS_X11 ...
246 KUniqueApplication::setHandleAutoStarted();
252 NETRootInfo
info( tqt_xdisplay(), 0 );
254 time = GET_QT_X_TIME();
255 info.setActiveWindow( win, NET::FromTool, time, 0 );
257 KUniqueApplication::setHandleAutoStarted();
263 NETRootInfo
info( tqt_xdisplay(), 0 );
264 info.setActiveWindow( win, NET::FromUnknown, 0, 0 );
266 KUniqueApplication::setHandleAutoStarted();
272 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
280 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
281 info.setUserTime( time );
287 return WindowInfo( win, properties, properties2 );
295 Window transient_for = None;
296 if( XGetTransientForHint( tqt_xdisplay(), win, &transient_for ))
297 return transient_for;
308 if( mainwindow != 0 )
313 if( tqqt_cast< TQDialog* >( subwindow ) != NULL
314 && subwindow->parentWidget() == NULL
315 && kapp->mainWidget() != NULL )
317 kdWarning() <<
"KWin::setMainWindow(): There either mustn't be kapp->mainWidget(),"
318 " or the dialog must have a non-NULL parent, otherwise Qt will reset the change. Bummer." <<
endl;
320 XSetTransientForHint( tqt_xdisplay(), subwindow->winId(), mainwindow );
323 XDeleteProperty( tqt_xdisplay(), subwindow->winId(), XA_WM_TRANSIENT_FOR );
331 XWMHints *hints = XGetWMHints( tqt_xdisplay(), win );
332 Window window_group = None;
335 if( hints->flags & WindowGroupHint )
336 window_group = hints->window_group;
337 XFree( reinterpret_cast< char* >( hints ));
351 NETWinInfo inf( tqt_xdisplay(), win, tqt_xrootwin(),
359 NET::WMKDEFrameStrut |
364 w.
state = inf.state();
365 w.mappingState = inf.mappingState();
366 w.
strut = inf.strut();
369 w.
name = TQString::fromUtf8( inf.name() );
372 if ( XFetchName( tqt_xdisplay(), win, &c ) != 0 ) {
373 w.
name = TQString::fromLocal8Bit( c );
377 if ( inf.visibleName() )
378 w.
visibleName = TQString::fromUtf8( inf.visibleName() );
383 w.
onAllDesktops = inf.desktop() == NETWinInfo::OnAllDesktops;
386 inf.kdeGeometry( frame, geom );
393 TQPixmap
KWin::icon( WId win,
int width,
int height,
bool scale )
399 TQPixmap
KWin::icon( WId win,
int width,
int height,
bool scale,
int flags )
406 if( flags &
NETWM ) {
407 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMIcon );
408 NETIcon ni = info.icon( width, height );
411 img.setAlphaBuffer(
true );
412 if ( scale && width > 0 && height > 0 &&img.size() != TQSize( width, height ) && !img.isNull() )
413 img = TQImage(img).smoothScale( width, height );
415 result.convertFromImage( img );
422 Pixmap p_mask = None;
424 XWMHints *hints = XGetWMHints(tqt_xdisplay(), win );
425 if (hints && (hints->flags & IconPixmapHint)){
426 p = hints->icon_pixmap;
428 if (hints && (hints->flags & IconMaskHint)){
429 p_mask = hints->icon_mask;
439 unsigned int border_w, depth;
440 XGetGeometry(tqt_xdisplay(), p, &root,
441 &x, &y, &w, &h, &border_w, &depth);
443 TQPixmap pm(w, h, depth);
446 XCopyArea(tqt_xdisplay(), p, pm.handle(),
447 tqt_xget_temp_gc(tqt_xscreen(), depth==1),
451 XCopyArea(tqt_xdisplay(), p_mask, bm.handle(),
452 tqt_xget_temp_gc(tqt_xscreen(),
true),
456 if ( scale && width > 0 && height > 0 && !pm.isNull() &&
457 ( (int) w != width || (
int) h != height) ){
458 result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) );
472 else if( width < 40 )
480 if( result.isNull() ) {
483 if( XGetClassHint( tqt_xdisplay(), win, &hint ) ) {
484 TQString className = hint.res_class;
488 if( scale && !pm.isNull() )
489 result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) );
493 XFree( hint.res_name );
494 XFree( hint.res_class );
502 if ( result.isNull() ) {
505 if( scale && !pm.isNull() )
506 result.convertFromImage( TQImage(pm.convertToImage()).smoothScale( width, height ) );
520 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
521 TQImage img = TQImage(icon.convertToImage()).convertDepth( 32 );
525 ni.
data = (
unsigned char *) img.bits();
526 info.setIcon( ni,
true );
527 if ( miniIcon.isNull() )
529 img = TQImage(miniIcon.convertToImage()).convertDepth( 32 );
532 ni.
data = (
unsigned char *) img.bits();
533 info.setIcon( ni,
false );
540 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
541 info.setWindowType( windowType );
548 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMState );
549 info.setState( state, state );
556 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMState );
557 info.setState( 0, state );
564 twin_net_create_atoms();
566 XDeleteProperty (tqt_xdisplay(), win, kde_wm_window_opacity);
569 long opacity = long(0xFFFFFFFF/100.0*percent);
570 XChangeProperty(tqt_xdisplay(), win, kde_wm_window_opacity, XA_CARDINAL, 32, PropModeReplace, (
unsigned char *) &opacity, 1L);
578 twin_net_create_atoms();
579 long shadowSize = long(0xFFFFFFFF/100.0*percent);
580 XChangeProperty(tqt_xdisplay(), win, kde_wm_window_shadow, XA_CARDINAL, 32, PropModeReplace, (
unsigned char *) &shadowSize, 1L);
587 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMDesktop );
589 info.setDesktop( NETWinInfo::OnAllDesktops );
590 else if ( info.desktop() == NETWinInfo::OnAllDesktops ) {
591 NETRootInfo rinfo( tqt_xdisplay(), NET::CurrentDesktop );
592 info.setDesktop( rinfo.currentDesktop() );
600 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), NET::WMDesktop );
601 info.setDesktop( desktop );
606 int right_width,
int right_start,
int right_end,
int top_width,
int top_start,
int top_end,
607 int bottom_width,
int bottom_start,
int bottom_end )
610 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
616 strut.left_start = left_start;
617 strut.left_end = left_end;
618 strut.right_start = right_start;
619 strut.right_end = right_end;
620 strut.top_start = top_start;
621 strut.top_end = top_end;
622 strut.bottom_start = bottom_start;
623 strut.bottom_end = bottom_end;
624 info.setExtendedStrut( strut );
631 NETWinInfo
info( tqt_xdisplay(), win, tqt_xrootwin(), 0 );
637 info.setStrut( strut );
648 NETRootInfo
info( tqt_xdisplay(), NET::CurrentDesktop );
649 return info.currentDesktop();
660 NETRootInfo
info( tqt_xdisplay(), NET::NumberOfDesktops );
661 return info.numberOfDesktops();
668 NETRootInfo
info( tqt_xdisplay(), NET::CurrentDesktop );
669 info.setCurrentDesktop( desktop );
676 NETRootInfo
info( tqt_xdisplay(), NET::CurrentDesktop );
678 netview.
x = viewport.x();
679 netview.
y = viewport.y();
680 info.setDesktopViewport( desktop, netview );
689 twin_net_create_atoms();
690 sendClientMessageToRoot( win, kde_wm_change_state, IconicState, 1 );
692 XIconifyWindow( tqt_xdisplay(), win, tqt_xscreen() );
702 twin_net_create_atoms();
703 sendClientMessageToRoot( win, kde_wm_change_state, NormalState, 1 );
705 XMapWindow( tqt_xdisplay(), win );
712 NETRootInfo
info( tqt_xdisplay(), NET::Supported );
713 if( info.isSupported( NET::WM2RestackWindow ))
714 info.restackRequest( win, None, Above );
716 XRaiseWindow( tqt_xdisplay(), win );
723 NETRootInfo
info( tqt_xdisplay(), NET::Supported );
724 if( info.isSupported( NET::WM2RestackWindow ))
725 info.restackRequest( win, None, Below );
727 XLowerWindow( tqt_xdisplay(), win );
738 class KWin::WindowInfoPrivate
747 ~WindowInfoPrivate() {
delete info; }
752 TQString iconic_name_;
754 TQRect frame_geometry_;
758 WindowInfoPrivate(
const WindowInfoPrivate& );
759 void operator=(
const WindowInfoPrivate& );
767 d =
new WindowInfoPrivate;
769 if( properties == 0 )
770 properties = NET::WMState |
776 NET::WMVisibleIconName |
779 NET::WMKDEFrameStrut |
782 if( properties & NET::WMVisibleIconName )
783 properties |= NET::WMIconName | NET::WMVisibleName;
784 if( properties & NET::WMVisibleName )
785 properties |= NET::WMName;
786 if( properties2 & NET::WM2ExtendedStrut )
787 properties |= NET::WMStrut;
788 properties |= NET::XAWMState;
789 unsigned long props[ 2 ] = { properties, properties2 };
790 d->info =
new NETWinInfo( tqt_xdisplay(), win, tqt_xrootwin(), props, 2 );
792 if( properties & NET::WMName ) {
793 if( d->info->name() && d->info->name()[ 0 ] !=
'\0' )
794 d->name_ = TQString::fromUtf8( d->info->name() );
798 if( properties & NET::WMIconName ) {
799 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
800 d->iconic_name_ = TQString::fromUtf8( d->info->iconName());
804 if( properties & ( NET::WMGeometry | NET::WMKDEFrameStrut )) {
806 d->info->kdeGeometry( frame, geom );
810 d->valid = !handler.
error(
false );
815 KWin::WindowInfo::WindowInfo()
820 KWin::WindowInfo::~WindowInfo()
823 if( --d->ref == 0 ) {
838 if( d != wininfo.d ) {
853 if( !withdrawn_is_valid && mappingState() == NET::Withdrawn )
866 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMState ) == 0, 176 )
867 <<
"Pass NET::WMState to KWin::windowInfo()" <<
endl;
868 return d->info->state();
877 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::XAWMState ) == 0, 176 )
878 <<
"Pass NET::XAWMState to KWin::windowInfo()" <<
endl;
879 return d->info->mappingState();
888 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2ExtendedStrut ) == 0, 176 )
889 <<
"Pass NET::WM2ExtendedStrut to second argument of KWin::windowInfo()" <<
endl;
895 if( str.
left != 0 ) {
898 ext.left_end = XDisplayHeight( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
900 if( str.
right != 0 ) {
903 ext.right_end = XDisplayHeight( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
908 ext.top_end = XDisplayWidth( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
912 ext.bottom_start = 0;
913 ext.bottom_end = XDisplayWidth( tqt_xdisplay(), DefaultScreen( tqt_xdisplay()));
926 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMStrut ) == 0, 176 )
927 <<
"Pass NET::WMStrut to KWin::windowInfo()" <<
endl;
928 return d->info->strut();
938 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMWindowType ) == 0, 176 )
939 <<
"Pass NET::WMWindowType to KWin::windowInfo()" <<
endl;
940 return d->info->windowType( supported_types );
948 TQString s = visibleName();
949 if ( isMinimized() ) {
956 TQString KWin::Info::visibleNameWithState()
const
958 TQString s = visibleName;
959 if ( isMinimized() ) {
969 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMVisibleName ) == 0, 176 )
970 <<
"Pass NET::WMVisibleName to KWin::windowInfo()" <<
endl;
971 return d->info->visibleName() && d->info->visibleName()[ 0 ] !=
'\0'
972 ? TQString::fromUtf8(d->info->visibleName()) : name();
974 return TQString(
"name");
981 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMName ) == 0, 176 )
982 <<
"Pass NET::WMName to KWin::windowInfo()" <<
endl;
991 TQString s = visibleIconName();
992 if ( isMinimized() ) {
1002 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMVisibleIconName ) == 0, 176 )
1003 <<
"Pass NET::WMVisibleIconName to KWin::windowInfo()" <<
endl;
1004 if( d->info->visibleIconName() && d->info->visibleIconName()[ 0 ] !=
'\0' )
1005 return TQString::fromUtf8( d->info->visibleIconName());
1006 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
1007 return TQString::fromUtf8( d->info->iconName());
1008 if( !d->iconic_name_.isEmpty())
1009 return d->iconic_name_;
1011 return visibleName();
1017 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMIconName ) == 0, 176 )
1018 <<
"Pass NET::WMIconName to KWin::windowInfo()" <<
endl;
1019 if( d->info->iconName() && d->info->iconName()[ 0 ] !=
'\0' )
1020 return TQString::fromUtf8( d->info->iconName());
1021 if( !d->iconic_name_.isEmpty())
1022 return d->iconic_name_;
1039 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
1040 <<
"Pass NET::WMDesktop to KWin::windowInfo()" <<
endl;
1041 return d->info->desktop() == desktop || d->info->desktop() == NET::OnAllDesktops;
1050 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
1051 <<
"Pass NET::WMDesktop to KWin::windowInfo()" <<
endl;
1052 return d->info->desktop() == NET::OnAllDesktops;
1061 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMDesktop ) == 0, 176 )
1062 <<
"Pass NET::WMDesktop to KWin::windowInfo()" <<
endl;
1063 return d->info->desktop();
1072 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMGeometry ) == 0, 176 )
1073 <<
"Pass NET::WMGeometry to KWin::windowInfo()" <<
endl;
1074 return d->geometry_;
1076 return TQRect( 100, 100, 200, 200 );
1083 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS ] & NET::WMKDEFrameStrut ) == 0, 176 )
1084 <<
"Pass NET::WMKDEFrameStrut to KWin::windowInfo()" <<
endl;
1085 return d->frame_geometry_;
1094 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2TransientFor ) == 0, 176 )
1095 <<
"Pass NET::WM2TransientFor to KWin::windowInfo()" <<
endl;
1096 return d->info->transientFor();
1105 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2GroupLeader ) == 0, 176 )
1106 <<
"Pass NET::WM2GroupLeader to KWin::windowInfo()" <<
endl;
1107 return d->info->groupLeader();
1116 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] &
NET::WM2WindowClass ) == 0, 176 )
1117 <<
"Pass NET::WM2WindowClass to KWin::windowInfo()" <<
endl;
1118 return d->info->windowClassClass();
1127 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] &
NET::WM2WindowClass ) == 0, 176 )
1128 <<
"Pass NET::WM2WindowClass to KWin::windowInfo()" <<
endl;
1129 return d->info->windowClassName();
1138 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] &
NET::WM2WindowRole ) == 0, 176 )
1139 <<
"Pass NET::WM2WindowRole to KWin::windowInfo()" <<
endl;
1140 return d->info->windowRole();
1149 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] &
NET::WM2ClientMachine ) == 0, 176 )
1150 <<
"Pass NET::WM2ClientMachine to KWin::windowInfo()" <<
endl;
1151 return d->info->clientMachine();
1160 kdWarning(( d->info->passedProperties()[ NETWinInfo::PROTOCOLS2 ] & NET::WM2AllowedActions ) == 0, 176 )
1161 <<
"Pass NET::WM2AllowedActions to KWin::windowInfo()" <<
endl;
1163 return d->info->allowedActions() & action;
1173 if( mappingState() != NET::Iconic )
1177 && ( state() & NET::Shaded ) == 0 )
1181 return icccmCompliantMappingState() ?
false :
true;
1190 if( mappingState != NET::Iconic )
1194 && ( state & NET::Shaded ) == 0 )
1198 return icccmCompliantMappingState() ?
false :
true;
1204 bool KWin::Info::isIconified()
const
1206 return isMinimized();
1209 bool KWin::icccmCompliantMappingState()
1212 static enum { noidea, yes, no } wm_is_1_2_compliant = noidea;
1213 if( wm_is_1_2_compliant == noidea ) {
1214 NETRootInfo
info( tqt_xdisplay(), NET::Supported );
1217 return wm_is_1_2_compliant == yes;
1226 static enum { noidea, yes, no } wm_supports_allowed_actions = noidea;
1227 if( wm_supports_allowed_actions == noidea ) {
1228 NETRootInfo
info( tqt_xdisplay(), NET::Supported );
1229 wm_supports_allowed_actions = info.isSupported( NET::WM2AllowedActions ) ? yes : no;
1231 return wm_supports_allowed_actions == yes;
1246 if ( XGetTextProperty( tqt_xdisplay(), win, &tp, atom ) != 0 && tp.value != NULL )
1248 if (!twin_UTF8_STRING)
1249 twin_UTF8_STRING = XInternAtom( tqt_xdisplay(),
"UTF8_STRING", False);
1251 if ( tp.encoding == twin_UTF8_STRING ) {
1252 result = TQString::fromUtf8 ( (
const char*) tp.value );
1254 else if ( XmbTextPropertyToTextList( tqt_xdisplay(), &tp, &text, &count) == Success &&
1255 text != NULL && count > 0 ) {
1256 result = TQString::fromLocal8Bit( text[0] );
1257 }
else if ( tp.encoding == XA_STRING )
1258 result = TQString::fromLocal8Bit( (
const char*) tp.value );
1260 XFreeStringList( text );