Skip to content

Commit

Permalink
Don't probe X11 display, for better integration with Wayland (bsc#107…
Browse files Browse the repository at this point in the history
…2411)
  • Loading branch information
mvidner committed Dec 18, 2017
1 parent 8d8725c commit 8310c61
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
30 changes: 0 additions & 30 deletions src/YQUI.cc
Expand Up @@ -149,9 +149,6 @@ void YQUI::initUI()
_ui_argc = cmdLine.argc();
char ** argv = cmdLine.argv();

// Probe X11 display for better error handling if it can't be opened
probeX11Display( cmdLine );

yuiDebug() << "Creating QApplication" << std::endl;
new QApplication( _ui_argc, argv );
Q_CHECK_PTR( qApp );
Expand Down Expand Up @@ -571,33 +568,6 @@ int YQUI::defaultSize(YUIDimension dim) const
}


void YQUI::probeX11Display( const YCommandLine & cmdLine )
{
int displayArgPos = cmdLine.find( "-display" );
std::string displayNameStr;

if ( displayArgPos > 0 && displayArgPos+1 < cmdLine.argc() )
{
displayNameStr = cmdLine[ displayArgPos+1 ];
yuiMilestone() << "Using X11 display \"" << displayNameStr << "\"" << std::endl;
}

const char * displayName = ( displayNameStr.empty() ? 0 : displayNameStr.c_str() );
Display * display = XOpenDisplay( displayName );

if ( display )
{
yuiDebug() << "Probing X11 display successful" << std::endl;
XCloseDisplay( display );
}
else
{
string msg = "Can't open display " + displayNameStr;
YUI_THROW( YUIException( msg ) );
}
}


void YQUI::deleteNotify( YWidget * widget )
{
_eventHandler.deletePendingEventsFor( widget );
Expand Down
6 changes: 0 additions & 6 deletions src/YQUI.h
Expand Up @@ -293,12 +293,6 @@ class YQUI: public YUI
**/
void processCommandLineArgs( int argc, char **argv );

/**
* Probe the X11 display. Throw exception upon failure.
* A "-display" command line argument is taken into account.
**/
void probeX11Display( const YCommandLine & cmdLine );

/**
* Calculate size of `opt(`defaultsize) dialogs
**/
Expand Down

0 comments on commit 8310c61

Please sign in to comment.