/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/ewmhints.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/ewmhints.c

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

revision 1143 by ossman_, Thu Mar 16 08:41:53 2006 UTC revision 1146 by ossman_, Thu Mar 16 13:27:13 2006 UTC
# Line 229  ewmh_get_window_state(Window w) Line 229  ewmh_get_window_state(Window w)
229  }  }
230    
231  static int  static int
232  ewmh_add_state(Window wnd, Atom atom1, Atom atom2)  ewmh_modify_state(Window wnd, int add, Atom atom1, Atom atom2)
233  {  {
234          Status status;          Status status;
235          XEvent xevent;          XEvent xevent;
# Line 238  ewmh_add_state(Window wnd, Atom atom1, A Line 238  ewmh_add_state(Window wnd, Atom atom1, A
238          xevent.xclient.window = wnd;          xevent.xclient.window = wnd;
239          xevent.xclient.message_type = g_net_wm_state_atom;          xevent.xclient.message_type = g_net_wm_state_atom;
240          xevent.xclient.format = 32;          xevent.xclient.format = 32;
241          xevent.xclient.data.l[0] = _NET_WM_STATE_ADD;          if (add)
242          xevent.xclient.data.l[1] = atom1;                  xevent.xclient.data.l[0] = _NET_WM_STATE_ADD;
243          xevent.xclient.data.l[2] = atom2;          else
244          xevent.xclient.data.l[3] = 0;                  xevent.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
         xevent.xclient.data.l[4] = 0;  
         status = XSendEvent(g_display, DefaultRootWindow(g_display), False,  
                             SubstructureNotifyMask | SubstructureRedirectMask, &xevent);  
         if (!status)  
                 return -1;  
   
         return 0;  
 }  
   
 static int  
 ewmh_remove_state(Window wnd, Atom atom1, Atom atom2)  
 {  
         Status status;  
         XEvent xevent;  
   
         xevent.type = ClientMessage;  
         xevent.xclient.window = wnd;  
         xevent.xclient.message_type = g_net_wm_state_atom;  
         xevent.xclient.format = 32;  
         xevent.xclient.data.l[0] = _NET_WM_STATE_REMOVE;  
245          xevent.xclient.data.l[1] = atom1;          xevent.xclient.data.l[1] = atom1;
246          xevent.xclient.data.l[2] = atom2;          xevent.xclient.data.l[2] = atom2;
247          xevent.xclient.data.l[3] = 0;          xevent.xclient.data.l[3] = 0;
# Line 286  ewmh_change_state(Window wnd, int state) Line 266  ewmh_change_state(Window wnd, int state)
266           */           */
267          if (state == SEAMLESSRDP_MAXIMIZED)          if (state == SEAMLESSRDP_MAXIMIZED)
268          {          {
269                  if (ewmh_add_state                  if (ewmh_modify_state
270                      (wnd, g_net_wm_state_maximized_vert_atom,                      (wnd, 1, g_net_wm_state_maximized_vert_atom,
271                       g_net_wm_state_maximized_horz_atom) < 0)                       g_net_wm_state_maximized_horz_atom) < 0)
272                          return -1;                          return -1;
273          }          }
274          else          else
275          {          {
276                  if (ewmh_remove_state                  if (ewmh_modify_state
277                      (wnd, g_net_wm_state_maximized_vert_atom,                      (wnd, 0, g_net_wm_state_maximized_vert_atom,
278                       g_net_wm_state_maximized_horz_atom) < 0)                       g_net_wm_state_maximized_horz_atom) < 0)
279                          return -1;                          return -1;
280          }          }
# Line 362  ewmh_set_wm_name(Window wnd, const char Line 342  ewmh_set_wm_name(Window wnd, const char
342  int  int
343  ewmh_set_window_popup(Window wnd)  ewmh_set_window_popup(Window wnd)
344  {  {
345          if (ewmh_add_state(wnd, g_net_wm_state_skip_taskbar_atom, g_net_wm_state_skip_pager_atom) <          if (ewmh_modify_state
346              0)              (wnd, 1, g_net_wm_state_skip_taskbar_atom, g_net_wm_state_skip_pager_atom) < 0)
347                  return -1;                  return -1;
348          return 0;          return 0;
349  }  }

Legend:
Removed from v.1143  
changed lines
  Added in v.1146

  ViewVC Help
Powered by ViewVC 1.1.26