]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Minor refactoring to initialize_monitor
authorMikko Rasa <tdb@tdb.fi>
Sat, 12 Dec 2015 14:53:00 +0000 (16:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 12 Dec 2015 14:53:00 +0000 (16:53 +0200)
source/main.c

index 4beab4b93f10f9d092620335b64607db8344f754..6412285729296df8fabe6f8053612bd7ac3da8b4 100644 (file)
@@ -529,13 +529,16 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito
        free(index_data);
 }
 
-int initialize_monitor(Compositor *compositor, CompositedScreen *screen, CompositedMonitor *monitor, XRRScreenResources *xrr_res, unsigned index)
+int initialize_monitor(Compositor *compositor, CompositedScreen *screen, XRRScreenResources *xrr_res, unsigned index)
 {
+       CompositedMonitor *monitor;
        XRROutputInfo *output;
        XRRCrtcInfo *crtc;
        unsigned buffers[2];
        unsigned stride;
 
+       monitor = &screen->monitors[index];
+
        output = XRRGetOutputInfo(compositor->display, xrr_res, xrr_res->outputs[index]);
        monitor->enabled = !!output->crtc;
        if(!monitor->enabled)
@@ -618,7 +621,7 @@ int initialize_screen(Compositor *compositor, unsigned number)
        screen->nmonitors = xrr_res->noutput;
        screen->monitors = (CompositedMonitor *)malloc(screen->nmonitors*sizeof(CompositedMonitor));
        for(i=0; i<screen->nmonitors; ++i)
-               if(!initialize_monitor(compositor, screen, &screen->monitors[i], xrr_res, i))
+               if(!initialize_monitor(compositor, screen, xrr_res, i))
                        return 0;
        XRRFreeScreenResources(xrr_res);