Ignore:
Timestamp:
Nov 4, 2013 10:47:36 AM (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
ba86ec7
Parents:
65d5ce2
Message:

Setup PCDM to throw the theme's background image on any additional monitors/screens while PCDM is running.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-gui.cpp

    r577dd9b rb7bd617  
    2424    //Create the GUI based upon the current Theme 
    2525    createGUIfromTheme(); 
     26    //Put the background image on all the other screens 
     27    fillExtraScreens(); 
    2628    //Now make sure that the login widget has keyboard focus 
    2729    loginW->resetFocus(); 
     
    248250} 
    249251 
     252void PCDMgui::fillExtraScreens(){ 
     253    //Set a background image on any other available screens 
     254    QDesktopWidget *DE = QApplication::desktop(); 
     255    screens.clear(); 
     256    //Generate the background style sheet 
     257    QString tmpIcon = currentTheme->itemIcon("background"); 
     258    if( tmpIcon.isEmpty() || !QFile::exists(tmpIcon) ){ tmpIcon = ":/images/backgroundimage.jpg"; } 
     259    QString bgstyle = "border-image: url(BGIMAGE) stretch;";  
     260      bgstyle.replace("BGIMAGE", tmpIcon); 
     261    //Now apply the background to all the other screens     
     262    for(int i=0; i<DE->screenCount(); i++){ 
     263      if(i != DE->screenNumber(this)){ 
     264        //Just show a generic QWidget with the proper background image on every other screen 
     265        QWidget *screen = new QWidget(0, Qt::X11BypassWindowManagerHint); 
     266        screen->setGeometry( DE->screenGeometry(i) ); 
     267        screen->setStyleSheet(bgstyle); 
     268        screen->show(); 
     269        screens << screen; 
     270      } 
     271    }    
     272} 
     273 
    250274void PCDMgui::slotStartLogin(QString displayname, QString password){ 
    251275  //Get user inputs 
     
    348372void PCDMgui::slotClosePCDM(){ 
    349373  system("killall -9 xvkbd"); //be sure to close the virtual keyboard 
     374  for(int i=0; i<screens.length(); i++){ screens[i]->close(); } //close all the other screens 
    350375  QCoreApplication::exit(0); 
    351376  close(); 
Note: See TracChangeset for help on using the changeset viewer.