diff options
Diffstat (limited to 'src/kernel/tqwidget_x11.cpp')
| -rw-r--r-- | src/kernel/tqwidget_x11.cpp | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/src/kernel/tqwidget_x11.cpp b/src/kernel/tqwidget_x11.cpp index 808d2ef4c..06fa0cb53 100644 --- a/src/kernel/tqwidget_x11.cpp +++ b/src/kernel/tqwidget_x11.cpp @@ -90,15 +90,15 @@ extern Time tqt_x_time; extern Time tqt_x_user_time; #ifndef TQT_NO_XSYNC -extern Atom qt_net_wm_sync_request_counter; -extern Atom qt_net_wm_sync_request; +extern Atom tqt_net_wm_sync_request_counter; +extern Atom tqt_net_wm_sync_request; extern bool qt_use_xsync; #endif // defined in tqfont_x11.cpp extern bool tqt_has_xft; -int qt_x11_create_desktop_on_screen = -1; +int tqt_x11_create_desktop_on_screen = -1; /***************************************************************************** TQWidget member functions @@ -113,53 +113,53 @@ extern Atom qt_wm_client_leader; extern Atom tqt_window_role; extern Atom tqt_sm_client_id; extern Atom qt_utf8_string; -extern Atom qt_net_wm_context_help; -extern Atom qt_net_wm_ping; +extern Atom tqt_net_wm_context_help; +extern Atom tqt_net_wm_ping; extern Atom qt_xa_motif_wm_hints; -extern Atom qt_net_wm_name; -extern Atom qt_net_wm_icon_name; -extern Atom qt_net_wm_state; -extern Atom qt_net_wm_state_modal; -extern Atom qt_net_wm_state_max_v; -extern Atom qt_net_wm_state_max_h; -extern Atom qt_net_wm_state_fullscreen; -extern Atom qt_net_wm_state_above; -extern Atom qt_net_wm_state_stays_on_top; -extern Atom qt_net_wm_action; -extern Atom qt_net_wm_action_move; -extern Atom qt_net_wm_action_resize; -extern Atom qt_net_wm_action_minimize; -extern Atom qt_net_wm_action_shade; -extern Atom qt_net_wm_action_stick; -extern Atom qt_net_wm_action_max_h; -extern Atom qt_net_wm_action_max_v; -extern Atom qt_net_wm_action_fullscreen; -extern Atom qt_net_wm_action_change_desktop; -extern Atom qt_net_wm_action_close; -extern Atom qt_net_wm_action_above; -extern Atom qt_net_wm_action_below; -extern Atom qt_net_wm_window_type; -extern Atom qt_net_wm_window_type_normal; -extern Atom qt_net_wm_window_type_dialog; -extern Atom qt_net_wm_window_type_toolbar; -extern Atom qt_net_wm_window_type_menu; -extern Atom qt_net_wm_window_type_utility; -extern Atom qt_net_wm_window_type_splash; -extern Atom qt_net_wm_window_type_override; -extern Atom qt_net_wm_window_type_dropdown_menu; -extern Atom qt_net_wm_window_type_popup_menu; -extern Atom qt_net_wm_window_type_combo; -extern Atom qt_net_wm_window_type_dnd; -extern Atom qt_net_wm_window_type_tooltip; -extern Atom qt_net_wm_pid; -extern Atom qt_net_wm_user_time; +extern Atom tqt_net_wm_name; +extern Atom tqt_net_wm_icon_name; +extern Atom tqt_net_wm_state; +extern Atom tqt_net_wm_state_modal; +extern Atom tqt_net_wm_state_max_v; +extern Atom tqt_net_wm_state_max_h; +extern Atom tqt_net_wm_state_fullscreen; +extern Atom tqt_net_wm_state_above; +extern Atom tqt_net_wm_state_stays_on_top; +extern Atom tqt_net_wm_action; +extern Atom tqt_net_wm_action_move; +extern Atom tqt_net_wm_action_resize; +extern Atom tqt_net_wm_action_minimize; +extern Atom tqt_net_wm_action_shade; +extern Atom tqt_net_wm_action_stick; +extern Atom tqt_net_wm_action_max_h; +extern Atom tqt_net_wm_action_max_v; +extern Atom tqt_net_wm_action_fullscreen; +extern Atom tqt_net_wm_action_change_desktop; +extern Atom tqt_net_wm_action_close; +extern Atom tqt_net_wm_action_above; +extern Atom tqt_net_wm_action_below; +extern Atom tqt_net_wm_window_type; +extern Atom tqt_net_wm_window_type_normal; +extern Atom tqt_net_wm_window_type_dialog; +extern Atom tqt_net_wm_window_type_toolbar; +extern Atom tqt_net_wm_window_type_menu; +extern Atom tqt_net_wm_window_type_utility; +extern Atom tqt_net_wm_window_type_splash; +extern Atom tqt_net_wm_window_type_override; +extern Atom tqt_net_wm_window_type_dropdown_menu; +extern Atom tqt_net_wm_window_type_popup_menu; +extern Atom tqt_net_wm_window_type_combo; +extern Atom tqt_net_wm_window_type_dnd; +extern Atom tqt_net_wm_window_type_tooltip; +extern Atom tqt_net_wm_pid; +extern Atom tqt_net_wm_user_time; extern Atom qt_enlightenment_desktop; -extern Atom qt_net_virtual_roots; +extern Atom tqt_net_virtual_roots; extern bool qt_broken_wm; // defined in tqapplication_x11.cpp -extern bool qt_net_supports(Atom); -extern unsigned long *qt_net_virtual_root_list; +extern bool tqt_net_supports(Atom); +extern unsigned long *tqt_net_virtual_root_list; #if defined (QT_TABLET_SUPPORT) extern XDevice *devStylus; @@ -244,13 +244,13 @@ TQ_EXPORT void tqt_wait_for_window_manager( TQWidget* w ) tqApp->x11ProcessEvent( &ev ); } -static void qt_net_change_wm_state(const TQWidget* w, bool set, Atom one, Atom two = 0) +static void tqt_net_change_wm_state(const TQWidget* w, bool set, Atom one, Atom two = 0) { if (w->isShown()) { // managed by WM XEvent e; e.xclient.type = ClientMessage; - e.xclient.message_type = qt_net_wm_state; + e.xclient.message_type = tqt_net_wm_state; e.xclient.display = w->x11Display(); e.xclient.window = w->winId(); e.xclient.format = 32; @@ -268,7 +268,7 @@ static void qt_net_change_wm_state(const TQWidget* w, bool set, Atom one, Atom t unsigned long nitems = 0, after = 0; Atom *old_states = 0; status = XGetWindowProperty(w->x11Display(), w->winId(), - qt_net_wm_state, 0, 1024, False, + tqt_net_wm_state, 0, 1024, False, XA_ATOM, &ret, &format, &nitems, &after, &data); if (status == Success && ret == XA_ATOM && format == 32 && nitems > 0) @@ -289,10 +289,10 @@ static void qt_net_change_wm_state(const TQWidget* w, bool set, Atom one, Atom t } if (j) - XChangeProperty(w->x11Display(), w->winId(), qt_net_wm_state, XA_ATOM, 32, + XChangeProperty(w->x11Display(), w->winId(), tqt_net_wm_state, XA_ATOM, 32, PropModeReplace, (uchar *) new_states, j); else - XDeleteProperty(w->x11Display(), w->winId(), qt_net_wm_state); + XDeleteProperty(w->x11Display(), w->winId(), tqt_net_wm_state); delete [] new_states; if (data) XFree(data); @@ -349,11 +349,11 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) initializeWindow = true; if ( desktop && - qt_x11_create_desktop_on_screen >= 0 && - qt_x11_create_desktop_on_screen != x11Screen() ) { + tqt_x11_create_desktop_on_screen >= 0 && + tqt_x11_create_desktop_on_screen != x11Screen() ) { // desktop on a certain screen other than the default requested TQPaintDeviceX11Data* xd = getX11Data( true ); - xd->x_screen = qt_x11_create_desktop_on_screen; + xd->x_screen = tqt_x11_create_desktop_on_screen; xd->x_depth = TQPaintDevice::x11AppDepth( xd->x_screen ); xd->x_cells = TQPaintDevice::x11AppCells( xd->x_screen ); xd->x_colormap = TQPaintDevice::x11AppColormap( xd->x_screen ); @@ -481,11 +481,11 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) int curr_winaction = 0; // Add all default actions that cannot be turned off - net_winactions[curr_winaction++] = qt_net_wm_action_stick; - net_winactions[curr_winaction++] = qt_net_wm_action_fullscreen; - net_winactions[curr_winaction++] = qt_net_wm_action_change_desktop; - net_winactions[curr_winaction++] = qt_net_wm_action_above; - net_winactions[curr_winaction++] = qt_net_wm_action_below; + net_winactions[curr_winaction++] = tqt_net_wm_action_stick; + net_winactions[curr_winaction++] = tqt_net_wm_action_fullscreen; + net_winactions[curr_winaction++] = tqt_net_wm_action_change_desktop; + net_winactions[curr_winaction++] = tqt_net_wm_action_above; + net_winactions[curr_winaction++] = tqt_net_wm_action_below; struct { ulong flags, functions, decorations; @@ -504,7 +504,7 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) mwmhints.flags |= (1L << 0); // MWM_HINTS_FUNCTIONS } else { - net_winactions[curr_winaction++] = qt_net_wm_action_resize; + net_winactions[curr_winaction++] = tqt_net_wm_action_resize; } if ( testNFlags(WX11DisableMove) ) { @@ -513,7 +513,7 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) mwmhints.flags |= (1L << 0); // MWM_HINTS_FUNCTIONS } else { - net_winactions[curr_winaction++] = qt_net_wm_action_move; + net_winactions[curr_winaction++] = tqt_net_wm_action_move; } if ( testNFlags(WX11DisableMinimize) ) { @@ -522,7 +522,7 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) mwmhints.flags |= (1L << 0); // MWM_HINTS_FUNCTIONS } else { - net_winactions[curr_winaction++] = qt_net_wm_action_minimize; + net_winactions[curr_winaction++] = tqt_net_wm_action_minimize; } if ( testNFlags(WX11DisableMaximize) ) { @@ -531,8 +531,8 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) mwmhints.flags |= (1L << 0); // MWM_HINTS_FUNCTIONS } else { - net_winactions[curr_winaction++] = qt_net_wm_action_max_h; - net_winactions[curr_winaction++] = qt_net_wm_action_max_v; + net_winactions[curr_winaction++] = tqt_net_wm_action_max_h; + net_winactions[curr_winaction++] = tqt_net_wm_action_max_v; } if ( testNFlags(WX11DisableClose) ) { @@ -541,18 +541,18 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) mwmhints.flags |= (1L << 0); // MWM_HINTS_FUNCTIONS } else { - net_winactions[curr_winaction++] = qt_net_wm_action_close; + net_winactions[curr_winaction++] = tqt_net_wm_action_close; } if ( ! testNFlags(WX11DisableShade) ) { - net_winactions[curr_winaction++] = qt_net_wm_action_shade; + net_winactions[curr_winaction++] = tqt_net_wm_action_shade; } if (topLevel && ! (desktop || popup)) { ulong wsa_mask = 0; if ( testWFlags(WStyle_Splash) ) { - if (qt_net_supports(qt_net_wm_window_type_splash)) { + if (tqt_net_supports(tqt_net_wm_window_type_splash)) { clearWFlags( WX11BypassWM ); } else { setWFlags( WX11BypassWM | WStyle_Tool | WStyle_NoBorder ); @@ -592,22 +592,22 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) // maximized netwm state if (testWFlags(WState_Maximized)) { - net_winstates[curr_winstate++] = qt_net_wm_state_max_v; - net_winstates[curr_winstate++] = qt_net_wm_state_max_h; + net_winstates[curr_winstate++] = tqt_net_wm_state_max_v; + net_winstates[curr_winstate++] = tqt_net_wm_state_max_h; } } // stays on top if (testWFlags(WStyle_StaysOnTop)) { - net_winstates[curr_winstate++] = qt_net_wm_state_above; - net_winstates[curr_winstate++] = qt_net_wm_state_stays_on_top; + net_winstates[curr_winstate++] = tqt_net_wm_state_above; + net_winstates[curr_winstate++] = tqt_net_wm_state_stays_on_top; } if (testWFlags(WShowModal)) { mwmhints.input_mode = 3L; // MWM_INPUT_FULL_APPLICATION_MODAL mwmhints.flags |= (1L << 2); // MWM_HINTS_INPUT_MODE - net_winstates[curr_winstate++] = qt_net_wm_state_modal; + net_winstates[curr_winstate++] = tqt_net_wm_state_modal; } if ( testWFlags( WX11BypassWM ) ) { @@ -682,12 +682,12 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) int n = 0; protocols[n++] = tqt_wm_delete_window; // support del window protocol protocols[n++] = tqt_wm_take_focus; // support take focus window protocol - protocols[n++] = qt_net_wm_ping; // support _NET_WM_PING protocol + protocols[n++] = tqt_net_wm_ping; // support _NET_WM_PING protocol #ifndef TQT_NO_XSYNC - protocols[n++] = qt_net_wm_sync_request;// support the _NET_WM_SYNC_REQUEST protocol + protocols[n++] = tqt_net_wm_sync_request;// support the _NET_WM_SYNC_REQUEST protocol #endif if ( testWFlags( WStyle_ContextHelp ) ) - protocols[n++] = qt_net_wm_context_help; + protocols[n++] = tqt_net_wm_context_help; XSetWMProtocols( dpy, id, protocols, n ); // set mwm hints @@ -699,23 +699,23 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) // set _NET_WM_WINDOW_STATE if (curr_winstate > 0) - XChangeProperty(dpy, id, qt_net_wm_state, XA_ATOM, 32, PropModeReplace, + XChangeProperty(dpy, id, tqt_net_wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *) net_winstates, curr_winstate); else - XDeleteProperty(dpy, id, qt_net_wm_state); + XDeleteProperty(dpy, id, tqt_net_wm_state); // set _NET_WM_ALLOWED_ACTIONS if (curr_winaction > 0) - XChangeProperty(dpy, id, qt_net_wm_action, XA_ATOM, 32, PropModeReplace, + XChangeProperty(dpy, id, tqt_net_wm_action, XA_ATOM, 32, PropModeReplace, (unsigned char *) net_winactions, curr_winaction); else - XDeleteProperty(dpy, id, qt_net_wm_action); + XDeleteProperty(dpy, id, tqt_net_wm_action); #ifndef TQT_NO_XSYNC // set _NET_WM_SYNC_COUNTER createSyncCounter(); long counterVal = topData()->syncCounter; - XChangeProperty( dpy, id, qt_net_wm_sync_request_counter, XA_CARDINAL, 32, PropModeReplace, + XChangeProperty( dpy, id, tqt_net_wm_sync_request_counter, XA_CARDINAL, 32, PropModeReplace, (unsigned char*) &counterVal, 1); #endif @@ -733,7 +733,7 @@ void TQWidget::create( WId window, bool initializeWindow, bool destroyOldWindow) // set _NET_WM_PID long curr_pid = getpid(); - XChangeProperty(dpy, id, qt_net_wm_pid, XA_CARDINAL, 32, PropModeReplace, + XChangeProperty(dpy, id, tqt_net_wm_pid, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &curr_pid, 1); // declare the widget's object name as window role @@ -1010,47 +1010,47 @@ void TQWidget::x11SetWindowType( X11WindowType type ) return; if( type == X11WindowTypeSelect ) { if ( testWFlags(WStyle_Splash)) { - if (qt_net_supports(qt_net_wm_window_type_splash)) { - net_wintypes[curr_wintype++] = qt_net_wm_window_type_splash; + if (tqt_net_supports(tqt_net_wm_window_type_splash)) { + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_splash; } } else if (inherits("TQToolBar")) { // toolbar netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_toolbar; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_toolbar; } else if (testWFlags(WStyle_Customize) && testWFlags(WStyle_Tool)) { // utility netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_utility; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_utility; } else if (testWFlags(WType_Dialog)) { // dialog netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_dialog; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_dialog; } } else if( type == X11WindowTypeCombo ) { // combo netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_combo; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_combo; } else if( type == X11WindowTypeDND ) { // dnd netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_dnd; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_dnd; } else if( type == X11WindowTypeDropdown ) { // dropdown netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_dropdown_menu; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_dropdown_menu; } else if( type == X11WindowTypePopup ) { // popup netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_popup_menu; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_popup_menu; } else if( type == X11WindowTypeMenu ) { // menu netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_menu; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_menu; } else if( type == X11WindowTypeTooltip ) { // tooltip netwm type - net_wintypes[curr_wintype++] = qt_net_wm_window_type_tooltip; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_tooltip; } // normal netwm type - default - net_wintypes[curr_wintype++] = qt_net_wm_window_type_normal; + net_wintypes[curr_wintype++] = tqt_net_wm_window_type_normal; // set _NET_WM_WINDOW_TYPE if (curr_wintype > 0) - XChangeProperty(x11Display(), winId(), qt_net_wm_window_type, XA_ATOM, 32, PropModeReplace, + XChangeProperty(x11Display(), winId(), tqt_net_wm_window_type, XA_ATOM, 32, PropModeReplace, (unsigned char *) net_wintypes, curr_wintype); else - XDeleteProperty(x11Display(), winId(), qt_net_wm_window_type); + XDeleteProperty(x11Display(), winId(), tqt_net_wm_window_type); } void TQWidget::x11SetWindowTransient( TQWidget* parent ) @@ -1295,7 +1295,7 @@ void TQWidget::setCaption( const TQString &caption ) XSetWMName( x11Display(), winId(), tqstring_to_xtp(caption) ); TQCString net_wm_name = caption.utf8(); - XChangeProperty(x11Display(), winId(), qt_net_wm_name, qt_utf8_string, 8, + XChangeProperty(x11Display(), winId(), tqt_net_wm_name, qt_utf8_string, 8, PropModeReplace, (unsigned char *)net_wm_name.data(), net_wm_name.length()); @@ -1380,7 +1380,7 @@ void TQWidget::setIconText( const TQString &iconText ) XSetWMIconName( x11Display(), winId(), tqstring_to_xtp(iconText) ); TQCString net_wm_icon_name = iconText.utf8(); - XChangeProperty(x11Display(), winId(), qt_net_wm_icon_name, qt_utf8_string, 8, PropModeReplace, + XChangeProperty(x11Display(), winId(), tqt_net_wm_icon_name, qt_utf8_string, 8, PropModeReplace, (unsigned char *) net_wm_icon_name.data(), net_wm_icon_name.length()); } @@ -1829,9 +1829,9 @@ void TQWidget::setWindowState(uint newstate) TQTLWExtra *top = topData(); if ((oldstate & WindowMaximized) != (newstate & WindowMaximized)) { - if (qt_net_supports(qt_net_wm_state_max_h) && qt_net_supports(qt_net_wm_state_max_v)) { - qt_net_change_wm_state(this, (newstate & WindowMaximized), - qt_net_wm_state_max_h, qt_net_wm_state_max_v); + if (tqt_net_supports(tqt_net_wm_state_max_h) && tqt_net_supports(tqt_net_wm_state_max_v)) { + tqt_net_change_wm_state(this, (newstate & WindowMaximized), + tqt_net_wm_state_max_h, tqt_net_wm_state_max_v); } else if (! (newstate & WindowFullScreen)) { if (newstate & WindowMaximized) { // save original geometry @@ -1858,9 +1858,9 @@ void TQWidget::setWindowState(uint newstate) } if ((oldstate & WindowFullScreen) != (newstate & WindowFullScreen)) { - if (qt_net_supports(qt_net_wm_state_fullscreen)) { - qt_net_change_wm_state(this, (newstate & WindowFullScreen), - qt_net_wm_state_fullscreen); + if (tqt_net_supports(tqt_net_wm_state_fullscreen)) { + tqt_net_change_wm_state(this, (newstate & WindowFullScreen), + tqt_net_wm_state_fullscreen); } else { needShow = isVisible(); @@ -1964,7 +1964,7 @@ void TQWidget::showWindow() XFree( (char *)h ); if (tqt_x_user_time != CurrentTime) { - XChangeProperty(x11Display(), winId(), qt_net_wm_user_time, XA_CARDINAL, + XChangeProperty(x11Display(), winId(), tqt_net_wm_user_time, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &tqt_x_user_time, 1); } @@ -1977,8 +1977,8 @@ void TQWidget::showWindow() } if (isMaximized() && !isFullScreen() - && !(qt_net_supports(qt_net_wm_state_max_h) - && qt_net_supports(qt_net_wm_state_max_v))) { + && !(tqt_net_supports(tqt_net_wm_state_max_h) + && tqt_net_supports(tqt_net_wm_state_max_v))) { XMapWindow( x11Display(), winId() ); tqt_wait_for_window_manager(this); @@ -2002,7 +2002,7 @@ void TQWidget::showWindow() return; } - if (isFullScreen() && !qt_net_supports(qt_net_wm_state_fullscreen)) { + if (isFullScreen() && !tqt_net_supports(tqt_net_wm_state_fullscreen)) { XMapWindow(x11Display(), winId()); tqt_wait_for_window_manager(this); return; @@ -2162,10 +2162,10 @@ void TQWidget::internalSetGeometry( int x, int y, int w, int h, bool isMove ) if ( testWFlags(WType_Desktop) ) return; if (isTopLevel()) { - if (!qt_net_supports(qt_net_wm_state_max_h) - && !qt_net_supports(qt_net_wm_state_max_v)) + if (!tqt_net_supports(tqt_net_wm_state_max_h) + && !tqt_net_supports(tqt_net_wm_state_max_v)) clearWState(WState_Maximized); - if (!qt_net_supports(qt_net_wm_state_fullscreen)) + if (!tqt_net_supports(tqt_net_wm_state_fullscreen)) clearWState(WState_FullScreen); topData()->normalGeometry = TQRect(0, 0, -1, -1); } else { @@ -2865,10 +2865,10 @@ void TQWidget::updateFrameStrut() const XFree(data_ret); break; - } else if (qt_net_supports(qt_net_virtual_roots) && qt_net_virtual_root_list) { + } else if (tqt_net_supports(tqt_net_virtual_roots) && tqt_net_virtual_root_list) { int i = 0; - while (qt_net_virtual_root_list[i] != 0) { - if (qt_net_virtual_root_list[i++] == p) + while (tqt_net_virtual_root_list[i] != 0) { + if (tqt_net_virtual_root_list[i++] == p) break; } } |
