/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/branches/seamlessrdp-branch/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1144 by ossman_, Thu Mar 16 10:14:18 2006 UTC revision 1149 by ossman_, Thu Mar 16 15:27:59 2006 UTC
# Line 62  typedef struct _seamless_window Line 62  typedef struct _seamless_window
62          struct _seamless_window *next;          struct _seamless_window *next;
63  } seamless_window;  } seamless_window;
64  static seamless_window *g_seamless_windows = NULL;  static seamless_window *g_seamless_windows = NULL;
65    static BOOL g_seamless_started = False; /* Server end is up and running */
66    static BOOL g_seamless_active = False;  /* We are currently in seamless mode */
67  extern BOOL g_seamless_rdp;  extern BOOL g_seamless_rdp;
68    
69  extern uint32 g_embed_wnd;  extern uint32 g_embed_wnd;
# Line 1565  ui_create_window(void) Line 1567  ui_create_window(void)
1567          }          }
1568    
1569          XSelectInput(g_display, g_wnd, input_mask);          XSelectInput(g_display, g_wnd, input_mask);
1570          if (!g_seamless_rdp)  
1571            XMapWindow(g_display, g_wnd);
1572            /* wait for VisibilityNotify */
1573            do
1574          {          {
1575                  XMapWindow(g_display, g_wnd);                  XMaskEvent(g_display, VisibilityChangeMask, &xevent);
                 /* wait for VisibilityNotify */  
                 do  
                 {  
                         XMaskEvent(g_display, VisibilityChangeMask, &xevent);  
                 }  
                 while (xevent.type != VisibilityNotify);  
                 g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured;  
1576          }          }
1577            while (xevent.type != VisibilityNotify);
1578            g_Unobscured = xevent.xvisibility.state == VisibilityUnobscured;
1579    
1580          g_focused = False;          g_focused = False;
1581          g_mouse_in_wnd = False;          g_mouse_in_wnd = False;
# Line 1639  xwin_toggle_fullscreen(void) Line 1639  xwin_toggle_fullscreen(void)
1639  {  {
1640          Pixmap contents = 0;          Pixmap contents = 0;
1641    
1642          if (g_seamless_rdp)          if (g_seamless_active)
1643                  /* Turn off SeamlessRDP mode */                  /* Turn off SeamlessRDP mode */
1644                  ui_seamless_toggle();                  ui_seamless_toggle();
1645    
# Line 1988  xwin_process_events(void) Line 1988  xwin_process_events(void)
1988    
1989                                  break;                                  break;
1990                          case MapNotify:                          case MapNotify:
1991                                  if (!g_seamless_rdp)                                  if (!g_seamless_active)
1992                                          rdp_send_client_window_status(1);                                          rdp_send_client_window_status(1);
1993                                  break;                                  break;
1994                          case UnmapNotify:                          case UnmapNotify:
1995                                  if (!g_seamless_rdp)                                  if (!g_seamless_active)
1996                                          rdp_send_client_window_status(0);                                          rdp_send_client_window_status(0);
1997                                  break;                                  break;
1998                  }                  }
# Line 3006  ui_end_update(void) Line 3006  ui_end_update(void)
3006  }  }
3007    
3008  void  void
3009    ui_seamless_begin()
3010    {
3011            if (!g_seamless_rdp)
3012                    return;
3013    
3014            if (g_seamless_started)
3015                    return;
3016    
3017            g_seamless_started = True;
3018    
3019            ui_seamless_toggle();
3020    }
3021    
3022    void
3023  ui_seamless_toggle()  ui_seamless_toggle()
3024  {  {
3025          if (g_seamless_rdp)          if (!g_seamless_rdp)
3026                    return;
3027    
3028            if (!g_seamless_started)
3029                    return;
3030    
3031            if (g_seamless_active)
3032          {          {
3033                  /* Deactivate */                  /* Deactivate */
3034                  while (g_seamless_windows)                  while (g_seamless_windows)
# Line 3021  ui_seamless_toggle() Line 3041  ui_seamless_toggle()
3041          else          else
3042          {          {
3043                  /* Activate */                  /* Activate */
                 if (g_win_button_size)  
                 {  
                         error("SeamlessRDP mode cannot be activated when using single application mode\n");  
                         return;  
                 }  
                 if (!g_using_full_workarea)  
                 {  
                         error("SeamlessRDP mode requires a session that covers the whole screen");  
                         return;  
                 }  
   
3044                  XUnmapWindow(g_display, g_wnd);                  XUnmapWindow(g_display, g_wnd);
3045                  seamless_send_sync();                  seamless_send_sync();
3046          }          }
3047    
3048          g_seamless_rdp = !g_seamless_rdp;          g_seamless_active = !g_seamless_active;
3049  }  }
3050    
3051  void  void
# Line 3049  ui_seamless_create_window(unsigned long Line 3058  ui_seamless_create_window(unsigned long
3058          long input_mask;          long input_mask;
3059          seamless_window *sw, *sw_parent;          seamless_window *sw, *sw_parent;
3060    
3061            if (!g_seamless_active)
3062                    return;
3063    
3064          /* Ignore CREATEs for existing windows */          /* Ignore CREATEs for existing windows */
3065          sw = seamless_get_window_by_id(id);          sw = seamless_get_window_by_id(id);
3066          if (sw)          if (sw)
# Line 3128  ui_seamless_destroy_window(unsigned long Line 3140  ui_seamless_destroy_window(unsigned long
3140  {  {
3141          seamless_window *sw;          seamless_window *sw;
3142    
3143            if (!g_seamless_active)
3144                    return;
3145    
3146          sw = seamless_get_window_by_id(id);          sw = seamless_get_window_by_id(id);
3147          if (!sw)          if (!sw)
3148          {          {
# Line 3145  ui_seamless_move_window(unsigned long id Line 3160  ui_seamless_move_window(unsigned long id
3160  {  {
3161          seamless_window *sw;          seamless_window *sw;
3162    
3163            if (!g_seamless_active)
3164                    return;
3165    
3166          sw = seamless_get_window_by_id(id);          sw = seamless_get_window_by_id(id);
3167          if (!sw)          if (!sw)
3168          {          {
# Line 3186  ui_seamless_settitle(unsigned long id, c Line 3204  ui_seamless_settitle(unsigned long id, c
3204  {  {
3205          seamless_window *sw;          seamless_window *sw;
3206    
3207            if (!g_seamless_active)
3208                    return;
3209    
3210          sw = seamless_get_window_by_id(id);          sw = seamless_get_window_by_id(id);
3211          if (!sw)          if (!sw)
3212          {          {
# Line 3204  ui_seamless_setstate(unsigned long id, u Line 3225  ui_seamless_setstate(unsigned long id, u
3225  {  {
3226          seamless_window *sw;          seamless_window *sw;
3227    
3228            if (!g_seamless_active)
3229                    return;
3230    
3231          sw = seamless_get_window_by_id(id);          sw = seamless_get_window_by_id(id);
3232          if (!sw)          if (!sw)
3233          {          {
# Line 3253  ui_seamless_setstate(unsigned long id, u Line 3277  ui_seamless_setstate(unsigned long id, u
3277  void  void
3278  ui_seamless_syncbegin(unsigned long flags)  ui_seamless_syncbegin(unsigned long flags)
3279  {  {
3280            if (!g_seamless_active)
3281                    return;
3282    
3283          /* Destroy all seamless windows */          /* Destroy all seamless windows */
3284          while (g_seamless_windows)          while (g_seamless_windows)
3285          {          {

Legend:
Removed from v.1144  
changed lines
  Added in v.1149

  ViewVC Help
Powered by ViewVC 1.1.26