Ticket #1915: 1915.patch
File 1915.patch, 7.6 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/videoout_xv.cpp
982 982 (void)stream_type, (void)xvmc_chroma, (void)test_surface; 983 983 984 984 #ifdef USING_XVMC 985 Display *disp; 986 X11S(disp = XOpenDisplay(NULL)); 985 Display *disp = MythXOpenDisplay(); 987 986 988 987 // Disable features based on environment and DB values. 989 988 bool use_xvmc_vld = false, use_xvmc_idct = false, use_xvmc = false; … … 1185 1184 1186 1185 XV_INIT_FATAL_ERROR_TEST(winid <= 0, "Invalid Window ID."); 1187 1186 1188 X 11S(XJ_disp = XOpenDisplay(NULL));1187 XJ_disp = MythXOpenDisplay(); 1189 1188 XV_INIT_FATAL_ERROR_TEST(!XJ_disp, "Failed to open display."); 1190 1189 1191 1190 // Initialize X stuff -
libs/libmythtv/XvMCSurfaceTypes.cpp
5 5 6 6 static inline Display* createXvMCDisplay() 7 7 { 8 Display *disp = NULL; 9 X11S(disp = XOpenDisplay(NULL)); 8 Display *disp = MythXOpenDisplay(); 10 9 if (!disp) 11 { 12 VERBOSE(VB_IMPORTANT, "XOpenDisplay failed"); 13 return 0; 14 } 10 return NULL; 15 11 16 12 unsigned int p_version, p_release, p_request_base, p_event_base, 17 13 p_error_base; -
libs/libmyth/mythcontext.h
222 222 223 223 /// Update this whenever the plug-in API changes. 224 224 /// Including changes in the libmythtv class methods used by plug-ins. 225 #define MYTH_BINARY_VERSION "0.19.2006061 4-1"225 #define MYTH_BINARY_VERSION "0.19.20060619-1" 226 226 227 227 /** \brief Increment this whenever the MythTV network protocol changes. 228 228 * … … 412 412 QString removeCurrentLocation(void); 413 413 QString getCurrentLocation(void); 414 414 415 void SetX11Display(const QString &display); 416 QString GetX11Display(void) const; 417 415 418 static QMutex verbose_mutex; 416 419 417 420 private: -
libs/libmyth/util-x11.cpp
34 34 int nr_xinerama_screens = 0; 35 35 36 36 #ifdef Q_WS_X11 37 Display *d = MythXOpenDisplay(); 37 38 X11L; 38 Display *d = XOpenDisplay(NULL);39 39 int event_base = 0, error_base = 0; 40 40 if (XineramaQueryExtension(d, &event_base, &error_base) && 41 41 XineramaIsActive(d)) … … 51 51 return nr_xinerama_screens; 52 52 } 53 53 54 Display *MythXOpenDisplay(void) 55 { 56 #ifdef Q_WS_X11 57 QString dispStr = gContext->GetX11Display(); 58 const char *dispCStr = NULL; 59 if (!dispStr.isEmpty()) 60 dispCStr = dispStr.ascii(); 61 62 X11L; 63 Display *disp = XOpenDisplay(dispCStr); 64 X11U; 65 66 if (!disp) 67 VERBOSE(VB_IMPORTANT, "MythXOpenDisplay() failed"); 68 69 return disp; 70 #else 71 return NULL; 72 #endif 73 } 74 54 75 // Everything below this line is only compiled if using X11 55 76 56 77 #ifdef Q_WS_X11 -
libs/libmyth/util-x11.h
10 10 #include <X11/Xlib.h> 11 11 #include <vector> 12 12 13 Display *MythXOpenDisplay(void); 13 14 int XJ_error_catcher(Display * d, XErrorEvent * xeev); 14 15 void InstallXErrorHandler(Display *d); 15 16 void PrintXErrors(Display *d, const std::vector<XErrorEvent>& events); -
libs/libmyth/DisplayResX.cpp
12 12 #include <X11/extensions/Xrandr.h> 13 13 } 14 14 15 16 15 #include "util-x11.h" 17 16 18 17 using namespace X11; 19 18 19 Display *MythXOpenDisplay(void); 20 20 static XRRScreenConfiguration *GetScreenConfig(Display*& display); 21 21 22 22 DisplayResX::DisplayResX(void) … … 30 30 31 31 bool DisplayResX::GetDisplaySize(int &width_mm, int &height_mm) const 32 32 { 33 Display *display = NULL; 34 X11S(display = XOpenDisplay(NULL)); 33 Display *display = MythXOpenDisplay(); 35 34 if (display == NULL) 36 35 return false; 37 36 … … 113 112 114 113 static XRRScreenConfiguration *GetScreenConfig(Display*& display) 115 114 { 116 X11S(display = XOpenDisplay(NULL));115 display = MythXOpenDisplay(); 117 116 if (!display) 118 117 { 119 cerr<<"DisplaResX: Unable to XOpenDisplay"<<endl;118 cerr<<"DisplaResX: MythXOpenDisplay call failed"<<endl; 120 119 return NULL; 121 120 } 122 121 -
libs/libmyth/mythcontext.cpp
218 218 219 219 MythMainWindow *mainWindow; 220 220 221 QString m_x11_display; 222 221 223 float m_wmult, m_hmult; 222 224 223 225 // The part of the screen(s) allocated for the GUI. Unless … … 276 278 attemptingToConnect(false), 277 279 language(""), 278 280 mainWindow(NULL), 281 m_x11_display(QString::null), 279 282 m_wmult(1.0), m_hmult(1.0), 280 283 m_screenxbase(0), m_screenybase(0), m_screenwidth(0), m_screenheight(0), 281 284 m_geometry_x(0), m_geometry_y(0), m_geometry_w(0), m_geometry_h(0), … … 2881 2884 return d->screensaver->Asleep(); 2882 2885 } 2883 2886 2887 void MythContext::SetX11Display(const QString &display) 2888 { 2889 d->m_x11_display = QDeepCopy<QString>(display); 2890 } 2891 2892 QString MythContext::GetX11Display(void) const 2893 { 2894 return QDeepCopy<QString>(d->m_x11_display); 2895 } 2896 2884 2897 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
programs/mythfrontend/main.cpp
746 746 int main(int argc, char **argv) 747 747 { 748 748 QString geometry = ""; 749 QString display = QString::null; 749 750 #ifdef Q_WS_X11 750 // Remember any -geometry argument which QApplication init will remove 751 // Remember any -display or -geometry argument 752 // which QApplication init will remove. 751 753 for(int argpos = 1; argpos + 1 < argc; ++argpos) 754 { 752 755 if (!strcmp(argv[argpos],"-geometry")) 753 756 geometry = argv[argpos+1]; 757 else if (!strcmp(argv[argpos],"-display")) 758 display = argv[argpos+1]; 759 } 754 760 #endif 755 761 756 762 #ifdef Q_WS_MACX … … 870 876 871 877 ++argpos; 872 878 } 879 else if (!strcmp(a.argv()[argpos],"-display") || 880 !strcmp(a.argv()[argpos],"--display")) 881 { 882 if (a.argc()-1 > argpos) 883 { 884 display = a.argv()[argpos+1]; 885 if (display.startsWith("-")) 886 { 887 cerr << "Invalid or missing argument to -display option\n"; 888 return FRONTEND_EXIT_INVALID_CMDLINE; 889 } 890 else 891 ++argpos; 892 } 893 else 894 { 895 cerr << "Missing argument to -display option\n"; 896 return FRONTEND_EXIT_INVALID_CMDLINE; 897 } 898 } 873 899 else if (!strcmp(a.argv()[argpos],"-geometry") || 874 900 !strcmp(a.argv()[argpos],"--geometry")) 875 901 { … … 980 1006 return FRONTEND_EXIT_OK; 981 1007 } 982 1008 1009 if (!display.isEmpty()) 1010 { 1011 gContext->SetX11Display(display); 1012 } 1013 983 1014 if (geometry != "" && !gContext->ParseGeometryOverride(geometry)) 984 1015 { 985 1016 VERBOSE(VB_IMPORTANT,