Changeset 7a05d924 in mainline for uspace/srv/hid/display/wmops.c


Ignore:
Timestamp:
2022-10-20T08:05:06Z (14 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade
Children:
7cc30e9
Parents:
1766326
git-author:
Jiri Svoboda <jiri@…> (2022-10-19 18:04:42)
git-committer:
Jiri Svoboda <jiri@…> (2022-10-20 08:05:06)
Message:

Return correct number of windows from display server

But not the caption since the display server does not have it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/wmops.c

    r1766326 r7a05d924  
    3535
    3636#include <errno.h>
    37 //#include <io/log.h>
     37#include <io/log.h>
    3838#include <stdlib.h>
    3939#include <str.h>
    4040#include <wndmgt_srv.h>
    41 //#include "client.h"
    42 //#include "display.h"
    43 //#include "dsops.h"
    44 //#include "seat.h"
    45 //#include "window.h"
     41#include "display.h"
    4642
    4743static errno_t dispwm_get_window_list(void *, wndmgt_window_list_t **);
     
    6258{
    6359        wndmgt_window_list_t *list;
     60        ds_display_t *disp = (ds_display_t *)arg;
     61        ds_window_t *wnd;
     62        unsigned i;
     63
     64        log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_get_window_list()");
    6465
    6566        list = calloc(1, sizeof(wndmgt_window_list_t));
     
    6768                return ENOMEM;
    6869
    69         list->nwindows = 2;
    70         list->windows = calloc(2, sizeof(sysarg_t));
     70        /* Count the number of windows */
     71        list->nwindows = 0;
     72        wnd = ds_display_first_window(disp);
     73        while (wnd != NULL) {
     74                ++list->nwindows;
     75                wnd = ds_display_next_window(wnd);
     76        }
     77
     78        /* Allocate array for window IDs */
     79        list->windows = calloc(list->nwindows, sizeof(sysarg_t));
    7180        if (list->windows == NULL) {
    7281                free(list);
     
    7483        }
    7584
    76         list->windows[0] = 1;
    77         list->windows[1] = 2;
     85        /* Fill in window IDs */
     86        i = 0;
     87        wnd = ds_display_first_window(disp);
     88        while (wnd != NULL) {
     89                list->windows[i++] = wnd->id;
     90                wnd = ds_display_next_window(wnd);
     91        }
    7892
    7993        *rlist = list;
     
    8498    wndmgt_window_info_t **rinfo)
    8599{
     100
    86101/*      ds_client_t *client = (ds_client_t *) arg;
    87102        ds_window_t *wnd;
     
    101116        wndmgt_window_info_t *info;
    102117
     118        log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_get_window_info()");
     119
    103120        info = calloc(1, sizeof(wndmgt_window_info_t));
    104121        if (info == NULL)
     
    117134static errno_t dispwm_activate_window(void *arg, sysarg_t wnd_id)
    118135{
     136        log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_activate_window()");
    119137        (void)arg;
    120138        (void)wnd_id;
     
    124142static errno_t dispwm_close_window(void *arg, sysarg_t wnd_id)
    125143{
     144        log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_close_window()");
    126145        (void)arg;
    127146        (void)wnd_id;
Note: See TracChangeset for help on using the changeset viewer.