Example #1
0
void TransparentPlugin::setState()
{
    QWidget *main = getMainWindow();
    if (main == NULL)
        return;
#ifdef WIN32
    if (timer == NULL){
        timer = new QTimer(this);
        connect(timer, SIGNAL(timeout()), this, SLOT(tick()));
        main->installEventFilter(this);
        SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
        SetLayeredWindowAttributes(main->winId(), main->colorGroup().background().rgb(), 0, LWA_ALPHA);
        RedrawWindow(main->winId(), NULL, NULL, RDW_UPDATENOW);
        main->setMouseTracking(true);
        m_bActive = main->isActiveWindow();
        m_bState  = !m_bActive;
    }
    bool bNewState = m_bActive || m_bHaveMouse;
    if (bNewState == m_bState){
        BYTE d = (BYTE)(bNewState ? 255 : QMIN((100 - getTransparency()) * 256 / 100, 255));
        SetLayeredWindowAttributes(main->winId(), main->colorGroup().background().rgb(), d, LWA_ALPHA);
        return;
    }
    m_bState = bNewState;
    startTime = GetTickCount();
    timer->start(10);
#else
    if (!top) {
        top = new TransparentTop(main, getTransparency());
        connect(top,SIGNAL(destroyed()),this,SLOT(topDestroyed()));
    }
    top->setTransparent(getTransparency());
#endif
}
Example #2
0
/**
      \brief Retrieve info from window, needed for accel layer
*/
void UI_getWindowInfo(void *draw, GUI_WindowInfo *xinfo)
{
    ADM_assert(videoWindow);
    QWidget* widget = videoWindow->parentWidget();
    xinfo->widget = videoWindow;
    xinfo->systemWindowId = 0;

#if defined(_WIN32)
	xinfo->display=(void *)videoWindow->winId();
        xinfo->systemWindowId=videoWindow->winId();
#elif defined(__APPLE__)
	#if defined(ADM_CPU_X86_64)
		xinfo->display = (void*)videoWindow->winId();
                xinfo->systemWindowId=videoWindow->winId();
	#else
		xinfo->display = HIViewGetWindow(HIViewRef(widget->winId()));
                xinfo->systemWindowId= HIViewGetWindow(HIViewRef(widget->winId()));
	#endif
#else
        #if QT_VERSION < QT_VERSION_CHECK(5,0,0) 
                const QX11Info &info=videoWindow->x11Info();
                xinfo->display=info.display();
        #else
                xinfo->display=XOpenDisplay(NULL);
        #endif
        xinfo->systemWindowId=videoWindow->winId();
#endif
        QPoint localPoint(0,0);
        QPoint windowPoint = videoWindow->mapToGlobal(localPoint);        
	xinfo->x = windowPoint.x();
	xinfo->y = windowPoint.y();
	xinfo->width  = displayW;
	xinfo->height = displayH;
}
Example #3
0
void KSystemTray::minimizeRestore(bool restore)
{
    QWidget *pw = parentWidget();
    if(!pw)
        return;
#ifdef Q_WS_X11
    KWin::WindowInfo info = KWin::windowInfo(pw->winId(), NET::WMGeometry | NET::WMDesktop);
    if(restore)
    {
        if(d->on_all_desktops)
            KWin::setOnAllDesktops(pw->winId(), true);
        else
            KWin::setCurrentDesktop(info.desktop());
        pw->move(info.geometry().topLeft()); // avoid placement policies
        pw->show();
        pw->raise();
        KWin::activateWindow(pw->winId());
    }
    else
    {
        d->on_all_desktops = info.onAllDesktops();
        pw->hide();
    }
#endif
}
Example #4
0
void KDecorationPreview::setPreviewMask( const QRegion& reg, int mode, bool active )
    {
    QWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget();

    // FRAME duped from client.cpp
    if( mode == Unsorted )
        {
        XShapeCombineRegion( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
            reg.handle(), ShapeSet );
        }
    else
        {
        QMemArray< QRect > rects = reg.rects();
        XRectangle* xrects = new XRectangle[ rects.count() ];
        for( unsigned int i = 0;
             i < rects.count();
             ++i )
            {
            xrects[ i ].x = rects[ i ].x();
            xrects[ i ].y = rects[ i ].y();
            xrects[ i ].width = rects[ i ].width();
            xrects[ i ].height = rects[ i ].height();
            }
        XShapeCombineRectangles( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0,
	    xrects, rects.count(), ShapeSet, mode );
        delete[] xrects;
        }
    if( active )
        mask = reg; // keep shape of the active window for unobscuredRegion()
    }
Example #5
0
void bringToFront(QWidget *widget, bool)
{
	Q_ASSERT(widget);
	QWidget* w = widget->window();

#ifdef Q_WS_X11
	// If we're not on the current desktop, do the hide/show trick
	long dsk, curr_dsk;
	Window win = w->winId();
	if(desktopOfWindow(&win, &dsk) && currentDesktop(&curr_dsk)) {
		if((dsk != curr_dsk) && (dsk != -1)) {  // second condition for sticky windows
			w->hide();
		}
	}

	// FIXME: multi-desktop hacks for Win and Mac required
#endif

	if(w->isMaximized())
		w->showMaximized();
	else
		w->showNormal();

	//if(grabFocus)
	//	w->setActiveWindow();
	w->raise();
	w->activateWindow();

#ifdef Q_WS_WIN
	// TODO: unify with AdvancedWidget::bringToFront()
	ForceForegroundWindow(w->winId());
#endif
}
Example #6
0
/**
 * Send the file to the contact
 * @param uid the KABC uid you are sending to.
 * @param sourceURL a KURL to send.
 * @param altFileName an alternate filename describing the file
 * @param fileSize file size in bytes
 */
void Addressbook::sendFile(const QString &uid, const KURL &sourceURL, const QString &altFileName, uint fileSize)
{
    if(uid.isEmpty())
    {
        focusAndShowErrorMessage(i18n("Another KDE application tried to use Konversation to send a file to a contact, but did not specify any contact to send the file to.  This is probably a bug in the other application."));
        return;
    }
    KABC::Addressee addressee = addressBook->findByUid(uid);
    if(addressee.isEmpty())
    {
        focusAndShowErrorMessage(i18n("Another KDE application tried to use Konversation to send a file to a contact, but Konversation could not find the specified contact in the KDE address book."));
        return;
    }
    NickInfoPtr nickInfo = getNickInfo(addressee);
    if(!nickInfo)
    {
        QString user = addressee.fullEmail();
        if(!user.isEmpty()) user = "******" + user + ')';
        focusAndShowErrorMessage(i18n("Another KDE application tried to use Konversation to send a file to a contact, but the requested user%1 is not currently online.").arg(user));
        return;
    }
    nickInfo->getServer()->addDccSend(nickInfo->getNickname(), sourceURL, altFileName, fileSize);
    QWidget *widget = nickInfo->getServer()->getViewContainer()->getWindow();
    KWin::demandAttention(widget->winId());       //If activeWindow request is denied, at least demand attention!
    KWin::activateWindow(widget->winId());        //May or may not work, depending on focus stealing prevention.

}
Example #7
0
void TaskbarPreviews::changeOrder(QWidget *tab, QWidget *before)
{
	QWidget *inttab    = m_tabs.internal(tab);
	QWidget *intbefore = m_tabs.internal(before);
	if(!(inttab && intbefore))
		return;
	SetTabOrder((HWND)inttab->winId(), (HWND)intbefore->winId());
}
Example #8
0
void TaskbarPreviews::changeOrder(unsigned tabid, unsigned beforeid)
{
	QWidget *inttab   = m_tabs.internal(tabid);
	QWidget *intbefore = m_tabs.internal(beforeid);
	if(!(inttab && intbefore))
		return;
	SetTabOrder((HWND)inttab->winId(), (HWND)intbefore->winId());
}
void
bringToFront()
{
#if defined(Q_WS_X11)
    {
        qDebug() << Q_FUNC_INFO;

        QWidget* widget = tomahawkWindow();
        if ( !widget )
            return;

        widget->show();
        widget->activateWindow();
        widget->raise();

        WId wid = widget->winId();
        NETWM::init();

        XEvent e;
        e.xclient.type = ClientMessage;
        e.xclient.message_type = NETWM::NET_ACTIVE_WINDOW;
        e.xclient.display = QX11Info::display();
        e.xclient.window = wid;
        e.xclient.format = 32;
        e.xclient.data.l[0] = 2;
        e.xclient.data.l[1] = QX11Info::appTime();
        e.xclient.data.l[2] = 0;
        e.xclient.data.l[3] = 0l;
        e.xclient.data.l[4] = 0l;

        XSendEvent( QX11Info::display(), RootWindow( QX11Info::display(), DefaultScreen( QX11Info::display() ) ), False, SubstructureRedirectMask | SubstructureNotifyMask, &e );
    }
#elif defined(Q_WS_WIN)
    {
        qDebug() << Q_FUNC_INFO;

        QWidget* widget = tomahawkWindow();
        if ( !widget )
            return;

        widget->show();
        widget->activateWindow();
        widget->raise();

        WId wid = widget->winId();

        HWND hwndActiveWin = GetForegroundWindow();
        int  idActive      = GetWindowThreadProcessId(hwndActiveWin, NULL);
        if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
        {
            SetForegroundWindow( wid );
            SetFocus( wid );
            AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
        }
    }
#endif
}
Example #10
0
void WinDockPlugin::uninit()
{
    QWidget *main = getMainWindow();
    if (main && oldProc){
        appBarMessage(ABM_REMOVE);
        WNDPROC p;
        p = (WNDPROC)SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        if (p == 0)
            p = (WNDPROC)SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)oldProc);
		oldProc = NULL;
    }
}
Example #11
0
void QWSInputContext::update()
{
    QWidget *w = focusWidget();
    if (!w)
        return;

    QWidget *tlw = w->window();
    int winid = tlw->winId();

    int widgetid = w->winId();
    QPaintDevice::qwsDisplay()->sendIMUpdate(QWSInputMethod::Update, winid, widgetid);

}
Example #12
0
void WinDockPlugin::uninit()
{
    QWidget *main = getMainWindow();
    if (main && oldProc){
        appBarMessage(ABM_REMOVE);
        if (IsWindowUnicode(pMain->winId())){
            SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        }else{
            SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        }
        oldProc = NULL;
    }
}
Example #13
0
TransparentPlugin::~TransparentPlugin()
{
#ifdef WIN32
    QWidget *main = getMainWindow();
    if (main)
        SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
    if (timer)
        delete timer;
#else
    if (top)
        delete top;
#endif
    free_data(transparentData, &data);
}
Example #14
0
bool TaskbarPreviews::WasTabActivated(HWND hwnd)
{
	QWidget *internal = m_tabs.internal(hwnd);
	if (internal) {
		QWidget *owner = m_tabs.owner(hwnd);
		SetTabActive((HWND)internal->winId(), (HWND)owner->winId());
		if (owner->isMinimized())
			owner->showNormal();
		qApp->setActiveWindow(owner);
		emit tabActivated(m_tabs.user(hwnd));
		return true;
	} else
		return false;
}
Example #15
0
void ShortcutsPlugin::init()
{
    if (m_bInit)
        return;
    QWidget *main = getMainWindow();
    if (main){
        if (IsWindowUnicode(main->winId())){
            oldProc = (WNDPROC)SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)keysWndProc);
        }else{
            oldProc = (WNDPROC)SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)keysWndProc);
        }
        m_bInit = true;
        applyKeys();
    }
}
Example #16
0
ShortcutsPlugin::~ShortcutsPlugin()
{
#ifdef WIN32
    QWidget *main = getMainWindow();
    if (main && oldProc){
        if (IsWindowUnicode(main->winId())){
            SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        }else{
            SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        }
    }
#endif
    releaseKeys();
    free_data(shortcutsData, &data);
}
Example #17
0
bool KApplication::notify(QObject *receiver, QEvent *event)
{
    QEvent::Type t = event->type();
    if( t == QEvent::Show && receiver->isWidgetType())
    {
        QWidget* w = static_cast< QWidget* >( receiver );
#if defined Q_WS_X11
        if( w->isTopLevel() && !startupId().isEmpty()) // TODO better done using window group leader?
            KStartupInfo::setWindowStartupId( w->winId(), startupId());
#endif
        if( w->isTopLevel() && !( w->windowFlags() & Qt::X11BypassWindowManagerHint ) && w->windowType() != Qt::Popup && !event->spontaneous())
        {
            if( d->app_started_timer == NULL )
            {
                d->app_started_timer = new QTimer( this );
                connect( d->app_started_timer, SIGNAL(timeout()), SLOT(_k_checkAppStartedSlot()));
            }
            if( !d->app_started_timer->isActive()) {
                d->app_started_timer->setSingleShot( true );
                d->app_started_timer->start( 0 );
            }
        }
    }
    return QApplication::notify(receiver, event);
}
Example #18
0
void QWidget::setActiveWindow()
{
    QWidget *tlw = topLevelWidget();
    if ( tlw->isVisible() ) {
	qwsDisplay()->requestFocus( tlw->winId(), TRUE);
    }
}
Example #19
0
WId QWidgetProto::winId() const
{
  QWidget *item = qscriptvalue_cast<QWidget*>(thisObject());
  if (item)
    return item->winId();
  return WId();
}
Example #20
0
void QWSEmbedWidgetPrivate::updateWindow()
{
    Q_Q(QWSEmbedWidget);

    QWidget *win = q->window();
    if (win == window)
        return;

    if (window) {
        window->removeEventFilter(q);
        QWSEmbedCommand command;
        command.setData(windowId, embeddedId, QWSEmbedEvent::StopEmbed);
        QWSDisplay::instance()->d->sendCommand(command);
    }

    window = win;
    if (!window)
        return;
    windowId = window->winId();

    QWSEmbedCommand command;
    command.setData(windowId, embeddedId, QWSEmbedEvent::StartEmbed);
    QWSDisplay::instance()->d->sendCommand(command);
    window->installEventFilter(q);
    q->installEventFilter(q);
}
Example #21
0
static void setTrayIcon(QWidget &widget)
{
    /* System Tray Protocol Specification. */

    Display *dpy = qt_xdisplay();

    Screen *screen = XDefaultScreenOfDisplay(dpy);
    int iScreen = XScreenNumberOfScreen(screen);
    char szAtom[32];
    snprintf(szAtom, sizeof(szAtom), "_NET_SYSTEM_TRAY_S%d", iScreen);
    Atom selectionAtom = XInternAtom(dpy, szAtom, False);
    XGrabServer(dpy);
    Window managerWin = XGetSelectionOwner(dpy, selectionAtom);
    if (managerWin != None)
        XSelectInput(dpy, managerWin, StructureNotifyMask);
    XUngrabServer(dpy);
    XFlush(dpy);
    if (managerWin != None) {
        XEvent ev;
        memset(&ev, 0, sizeof(ev));
        ev.xclient.type = ClientMessage;
        ev.xclient.window = managerWin;
        ev.xclient.message_type = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False);
        ev.xclient.format = 32;
        ev.xclient.data.l[0] = CurrentTime;
        ev.xclient.data.l[1] = SYSTEM_TRAY_REQUEST_DOCK;
        ev.xclient.data.l[2] = widget.winId();
        ev.xclient.data.l[3] = 0;
        ev.xclient.data.l[4] = 0;
        XSendEvent(dpy, managerWin, False, NoEventMask, &ev);
        XSync(dpy, False);
    }
}
Example #22
0
void Task::updateThumbnail()
{
  if ( !isOnCurrentDesktop() )
    return;
  if ( !isActive() )
    return;
  if ( !_grab.isNull() ) // We're already processing one...
    return;

   //
   // We do this as a two stage process to remove the delay caused
   // by the thumbnail generation. This makes things much smoother
   // on slower machines.
   //
  QWidget *rootWin = qApp->desktop();
#ifdef KDE_3_2
  QRect geom = _info.geometry();
#else
  QRect geom = _info.geometry;
#endif
   _grab = QPixmap::grabWindow( rootWin->winId(),
        geom.x(), geom.y(),
        geom.width(), geom.height() );

   if ( !_grab.isNull() )
     QTimer::singleShot( 200, this, SLOT( generateThumbnail() ) );
}
Example #23
0
void WinIntegration::updateAssocs()
{
	QWidget *window = dynamic_cast<QWidget*>(sender());
	if (window)
		window = window->window();
	ShellExecuteA(window->winId(), "runas", "wininthelper.exe", "assocreg", 0, 0);
}
Example #24
0
/*!
  Enables / disables the Swipe of the Harmattan. This is used on sorting mode
  when the user can drag item over the edge of the UI.
*/
void QtHelper::enableSwipe(bool enable)
{
#ifdef Q_WS_HARMATTAN
    QWidget *activeWindow = QApplication::activeWindow();
    Display *dpy = QX11Info::display();
    Atom atom;

    if (!activeWindow) {
        return;
    }

    atom = XInternAtom(dpy, "_MEEGOTOUCH_CUSTOM_REGION", False);

    if (enable) {
        XDeleteProperty(dpy, activeWindow->effectiveWinId(), atom);
    }
    else {
        unsigned int customRegion[] =
        {
            activeWindow->x(),
            activeWindow->y(),
            activeWindow->width(),
            activeWindow->height()
        };

        XChangeProperty(dpy, activeWindow->winId(), atom,
                        XA_CARDINAL, 32, PropModeReplace,
                        reinterpret_cast<unsigned char*>(&customRegion[0]), 4);
    }
    #endif
}
Example #25
0
void remove_sm_from_client_leader()
{
#ifdef Q_WS_X11
  Atom type;
  int format, status;
  unsigned long nitems = 0;
  unsigned long extra = 0;
  unsigned char *data = 0;

  Atom atoms[ 2 ];
  char *atom_names[ 2 ] = { ( char * ) "WM_CLIENT_LEADER",
                            ( char * ) "SM_CLIENT_ID" };

  XInternAtoms( QX11Info::display(), atom_names, 2, False, atoms );

  QWidget w;
  KXErrorHandler handler; // ignore X errors
  status = XGetWindowProperty( QX11Info::display(), w.winId(), atoms[ 0 ], 0,
                               10000, false, XA_WINDOW, &type, &format, &nitems,
                               &extra, &data );

  if ( ( status == Success ) && !handler.error( false ) ) {
      if ( data && ( nitems > 0 ) ) {
          Window leader = * ( ( Window * ) data );
          XDeleteProperty( QX11Info::display(), leader, atoms[ 1 ] );
      }
      XFree( data );
  }
#endif
}
QRgb pickScreenRGB(const QRect &rect) {
  QWidget *widget = QApplication::desktop();

#ifdef MACOSX

  //   #Bugzilla 6514, possibly related to #QTBUG 23516

  // Screen grabbing on a secondary screen seems to be broken on MAC
  // (see what happens using PixelTool), when no piece of the *primary*
  // screen is involved in the grab. As it seems to be very Qt-based,
  // the workaround is to trivially grab the smallest rect including the
  // requested one and a part of the primary screen.

  const QRect &screen0Geom = QApplication::desktop()->screenGeometry(0);

  int left   = std::min(rect.left(), screen0Geom.right());
  int top    = std::min(rect.top(), screen0Geom.bottom());
  int right  = std::max(rect.right(), screen0Geom.left());
  int bottom = std::max(rect.bottom(), screen0Geom.right());

  QRect theRect(QPoint(left, top), QPoint(right, bottom));

#else

  const QRect &theRect = rect;

#endif

  QImage img(QPixmap::grabWindow(widget->winId(), theRect.x(), theRect.y(),
                                 theRect.width(), theRect.height())
                 .toImage());
  return meanColor(
      img, QRect(rect.left() - theRect.left(), rect.top() - theRect.top(),
                 rect.width(), rect.height()));
}
Example #27
0
QColor
KColorDialog::grabColor(const QPoint &p)
{
#ifdef Q_WS_X11
    // we use the X11 API directly in this case as we are not getting back a valid
    // return from QPixmap::grabWindow in the case where the application is using
    // an argb visual
    Window root = RootWindow(QX11Info::display(), QX11Info::appScreen());
//     XImage *ximg = XGetImage(QX11Info::display(), root, p.x(), p.y(), 1, 1, -1, ZPixmap);
//     unsigned long xpixel = XGetPixel(ximg, 0, 0);
//     XDestroyImage(ximg);
    XColor xcol;
//     xcol.pixel = xpixel;
    xcol.flags = DoRed | DoGreen | DoBlue;
//     XQueryColor(QX11Info::display(),
//                 DefaultColormap(QX11Info::display(), QX11Info::appScreen()),
//                 &xcol);
    return QColor::fromRgbF(xcol.red / 65535.0, xcol.green / 65535.0, xcol.blue / 65535.0);
#else
    QWidget *desktop = QApplication::desktop();
    QPixmap pm = QPixmap::grabWindow(desktop->winId(), p.x(), p.y(), 1, 1);
    QImage i = pm.toImage();
    return i.pixel(0, 0);
#endif
}
Example #28
0
WId Session::windowId() const
{
  // Returns a window ID for this session which is used
  // to set the WINDOWID environment variable in the shell
  // process.
  //
  // Sessions can have multiple views or no views, which means
  // that a single ID is not always going to be accurate.
  //
  // If there are no views, the window ID is just 0.  If
  // there are multiple views, then the window ID for the
  // top-level window which contains the first view is
  // returned

  if ( _views.count() == 0 )
    return 0;
  else
  {
    QWidget* window = _views.first();

    Q_ASSERT( window );

    while ( window->parentWidget() != 0 )
      window = window->parentWidget();

    return window->winId();
  }
}
Example #29
0
bool QGLContext::chooseContext(const QGLContext* shareContext)
{
    Q_D(QGLContext);
    if(!d->paintDevice || d->paintDevice->devType() != QInternal::Widget) {
        d->valid = false;
    }else {
        QWidget *widget = static_cast<QWidget *>(d->paintDevice);
        if (!widget->platformWindow()){
            QGLFormat glformat = format();
            QPlatformWindowFormat winFormat = QGLFormat::toPlatformWindowFormat(glformat);
            if (shareContext) {
                winFormat.setSharedContext(shareContext->d_func()->platformContext);
            }
            if (widget->testAttribute(Qt::WA_TranslucentBackground))
                winFormat.setAlpha(true);
            winFormat.setWindowApi(QPlatformWindowFormat::OpenGL);
            winFormat.setWindowSurface(false);
            widget->setPlatformWindowFormat(winFormat);
            widget->winId();//make window
        }
        d->platformContext = widget->platformWindow()->glContext();
        Q_ASSERT(d->platformContext);
        d->glFormat = QGLFormat::fromPlatformWindowFormat(d->platformContext->platformWindowFormat());
        d->valid =(bool) d->platformContext;
        if (d->valid) {
            d->platformContext->setQGLContextHandle(this,qDeleteQGLContext);
        }
        d->setupSharing();
    }


    return d->valid;
}
/*!
    \internal
    Motif callback to resolve a QtMotifDialog and set the initial
    geometry of the dialog.
*/
void qmotif_dialog_change_managed( Widget w )
{
    QtMotifDialog *dialog = ( (QtMotifDialogWidget) w )->qmotifdialog.dialog;

    Widget p = w->core.parent;

    TopLevelShellRec shell;

    if ( p == NULL && dialog->parentWidget() ) {
	// fake a motif widget parent for proper dialog
	// sizing/placement, which happens during change_managed by
	// going through geometry_manager

	QWidget *qwidget = dialog->parentWidget();
	QRect geom = qwidget->geometry();

	memset( &shell, 0, sizeof( shell ) );

	char fakename[] = "fakename";

	shell.core.self = (Widget) &shell;
	shell.core.widget_class = (WidgetClass) &topLevelShellClassRec;
	shell.core.parent = NULL;
	shell.core.xrm_name = w->core.xrm_name;
	shell.core.being_destroyed = False;
	shell.core.destroy_callbacks = NULL;
	shell.core.constraints = NULL;
	shell.core.x = geom.x();
	shell.core.y = geom.y();
	shell.core.width = geom.width();
	shell.core.height = geom.height();
	shell.core.border_width = 0;
	shell.core.managed = True;
	shell.core.sensitive = True;
	shell.core.ancestor_sensitive = True;
	shell.core.event_table = NULL;
	shell.core.accelerators = NULL;
	shell.core.border_pixel = 0;
	shell.core.border_pixmap = 0;
	shell.core.popup_list = NULL;
        shell.core.num_popups = 0;
	shell.core.name = fakename;
	shell.core.screen = ScreenOfDisplay( qwidget->x11Info().display(),
					     qwidget->x11Info().screen() );
	shell.core.colormap = qwidget->x11Info().colormap();
	shell.core.window = qwidget->winId();
	shell.core.depth = qwidget->x11Info().depth();
	shell.core.background_pixel = 0;
	shell.core.background_pixmap = None;
	shell.core.visible = True;
	shell.core.mapped_when_managed = True;

	w->core.parent = (Widget) &shell;
    }

    XtWidgetProc change_managed = xmDialogShellClassRec.composite_class.change_managed;
    (*change_managed)( w );
    w->core.parent = p;
}