ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.72 by gbeauche, 2004-11-08T21:07:07Z vs.
Revision 1.73 by gbeauche, 2004-11-15T23:27:43Z

# Line 197 | Line 197 | extern void *vm_acquire_mac(size_t size)
197   // From sys_unix.cpp
198   extern void SysMountFirstFloppy(void);
199  
200 + // From clip_unix.cpp
201 + extern void ClipboardSelectionClear(XSelectionClearEvent *);
202 + extern void ClipboardSelectionRequest(XSelectionRequestEvent *);
203 +
204  
205   /*
206   *  monitor_desc subclass for X11 display
# Line 2043 | Line 2047 | static int event2keycode(XKeyEvent &ev,
2047  
2048   static void handle_events(void)
2049   {
2050 <        while (XPending(x_display)) {
2050 >        for (;;) {
2051                  XEvent event;
2052 <                XNextEvent(x_display, &event);
2052 >                XDisplayLock();
2053 >
2054 >                if (!XCheckMaskEvent(x_display, eventmask, &event)) {
2055 >                        // Handle clipboard events
2056 >                        if (XCheckTypedEvent(x_display, SelectionRequest, &event))
2057 >                                ClipboardSelectionRequest(&event.xselectionrequest);
2058 >                        else if (XCheckTypedEvent(x_display, SelectionClear, &event))
2059 >                                ClipboardSelectionClear(&event.xselectionclear);
2060  
2061 +                        // Window "close" widget clicked
2062 +                        else if (XCheckTypedEvent(x_display, ClientMessage, &event)) {
2063 +                                if (event.xclient.format == 32 && event.xclient.data.l[0] == WM_DELETE_WINDOW) {
2064 +                                        ADBKeyDown(0x7f);       // Power key
2065 +                                        ADBKeyUp(0x7f);
2066 +                                }
2067 +                        }
2068 +                        XDisplayUnlock();
2069 +                        break;
2070 +                }
2071 +                
2072                  switch (event.type) {
2073  
2074                          // Mouse button
# Line 2154 | Line 2176 | static void handle_events(void)
2176                                                  memset(the_buffer_copy, 0, mode.bytes_per_row * mode.y);
2177                                  }
2178                                  break;
2157
2158                        // Window "close" widget clicked
2159                        case ClientMessage:
2160                                if (event.xclient.format == 32 && event.xclient.data.l[0] == WM_DELETE_WINDOW) {
2161                                        ADBKeyDown(0x7f);       // Power key
2162                                        ADBKeyUp(0x7f);
2163                                }
2164                                break;
2179                  }
2180 +
2181 +                XDisplayUnlock();
2182          }
2183   }
2184  
# Line 2207 | Line 2223 | static void update_display_dynamic(int t
2223                  }
2224          }
2225  
2226 +        XDisplayLock();
2227          if ((nr_boxes <= max_box) && (nr_boxes)) {
2228                  for (y1=0; y1<16; y1++) {
2229                          for (x1=0; x1<16; x1++) {
# Line 2260 | Line 2277 | static void update_display_dynamic(int t
2277                  }
2278                  nr_boxes = 0;
2279          }
2280 +        XDisplayUnlock();
2281   }
2282  
2283   // Static display update (fixed frame rate, but incremental)
# Line 2369 | Line 2387 | static void update_display_static(driver
2387          }
2388  
2389          // Refresh display
2390 +        XDisplayLock();
2391          if (high && wide) {
2392                  if (drv->have_shm)
2393                          XShmPutImage(x_display, drv->w, drv->gc, drv->img, x1, y1, x1, y1, wide, high, 0);
2394                  else
2395                          XPutImage(x_display, drv->w, drv->gc, drv->img, x1, y1, x1, y1, wide, high);
2396          }
2397 +        XDisplayUnlock();
2398   }
2399  
2400  
# Line 2416 | Line 2436 | static inline void handle_palette_change
2436  
2437          if (x_palette_changed) {
2438                  x_palette_changed = false;
2439 +                XDisplayLock();
2440                  drv->update_palette();
2441 +                XDisplayUnlock();
2442          }
2443  
2444          UNLOCK_PALETTE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines